Postfix Code Completion in IntelliJ IDEA 13.1
blog.jetbrains.com
blog.jetbrains.com
For me, and it is a personal thing, actually writing code - that is physically typing braces etc. is not the time consuming part of coding. Far, far more time is spent thinking about my code than actually typing it. Shaving off a few seconds when working in my editor feels like an optimisation too far, especially if it essentially means learning new syntax.
Like I said, it's a personal thing - I know others have good reason to love code completion tools. Now if someone could come up with something like this for when I'm writing in my notebook....
I wonder if any tests were made about how much time is spend to actual thinking versus coding the idea? Which area is more worth to work on?
I doubt it, if they did it would almost certainly be disappointing.
This is a question I have posed in the past, how helpful/useful is auto-complete/intelli-sense?
I think it is one of those IDE features that is similar to the automatic window slider in your car, you come to expect it because it does offer some convenience but adds little to your overall driving comfort.
It is indeed the case that most of what you spend time on isn't the code writing part when trying to solve problems. Typically you spend most time thinking about the problem and the actual code that results from that thinking can be just a few lines. Heck, sometimes the end result of thinking is to eliminate code:)
For me I think syntax highlighting and automatic syntax checking offers more utility than auto-complete. My startup's product is a web development tool that I now use as my primary IDE but it currently lacks automatic syntax checking, I can definitely say that this is something I miss from when I was using Netbeans.
Overall I think auto-complete has utility but the reverence for it far outweigh its actually utility.
Autocomplete allows libraries to get larger and more complex, for better or worse, since developers can just forgo documentation (paper maps) and rely on autocomplete menus (GPS). Your power windows don't help you drive at all.
it's not really faster, it just avoid de-focusing, it's the continuation of the bicycle for the mind thing.
Or even better for testers. Lots of code. Some initial thinking and then you need to write 50 lines of something before you have to think about it again.
The time it takes to write a the first few characters of a method name and then hit the completion key is a tiny amount smaller than just typing the method name outright. But that isn't the point: if I didn't have autocomplete, I'd alt+tab to a browser with class documentation or start searching in the code for a previous invocation of a method with that name I only vaguely remember.
With autocomplete, I don't have to remember variable/property/method names, I can either list them or see a list that begins if I just remember a prefix. This is less unnecessary state in my head and thus more time to think about the actual problem.
It's an absolutely enormous difference in time spent, and considering the time it takes to context switch back to where you were, I'd say it saves me hours every day.
I think there is a deeper issue if identifiers are becoming so long that it's hard to remember them. But working with someone else's code is one of the few times I've found autocomplete to be useful, largely because it helps with getting around these issues.
Identifiers (e.g. class or method names) don't have to be particularly long before you can screw up something silly like how to CamelCase it, or accidentally swap the order of a 2-argument method.
When I have reasonable domain knowledge, like say I include a vector math library, I can guess the type and method names and use the lib through autocomplete without ever looking at documentation.
The text editor people don't seem to get it but _not_ spending significant amounts of time each day looking up method names / parameters does add up.
The other reason is because.
It annoys the shit out of me when something that could be automated isn't.
When I had it available to me, I'd often use it to explore the class or object I'm working with.
But working with others (and occasionally using it myself), I've also found that code completion tends to encourage a "I think this is the right method/class/variable because it's in the list, I'll use it" type of thought process; and while it makes for easy generation of code that has no syntax errors, it also feels like it increases making logic errors since there is less thinking about "is this really want I want to write here" - it tells you what you can write here, and the instinct is to just pick the one that seems to feel like it would work.
Without completion I already code in the 100-120wpm+ range (and can comfortably write prose in the 150-160 range), so I don't think I need to make that any faster...
If someone would use autocomplete in the way you describe I don't think they'd be better developers without it. It's like saying we should all type with one hand since it makes us think more before we type.
Whether or not this is the correct way to create an API for others to consume, who knows. But I tend to think of code completion as part of the "UX" of a library.
I do the same thing on the command-line: if I'm going to cd into a long path, I'll often forget I've typed cd and try to tab-complete file names instead of just directory names. When hitting tab refuses to autocomplete the file (it only completes directories), I'm forced to rethink what I'm doing before I finish typing an invalid command.
The more the computer does, the better.
of course some argue otherwise, usually blaming IDEs as being a crutch for poor programmers. Surely it can be, but otherwise I say it's a very convenient tool.
If I had a baby for every time I've said that, I'd probably have a sizeable brood by now.
Also it seem Chronon debugger is free with IntelliJ IDEA 13.1 Ultimate http://blog.jetbrains.com/idea/2014/03/try-chronon-debugger-...
AppCode is the reason I still have hair. If I had been using XCode for the last 2 years I'd have it all pulled out by now. Or I might have given up on iOS altogether.
I often write code backwards using the IDE capabilities. Say I instantiate an object, I'd write "[[Foo alloc] init]" (most of that auto-completed), then use the keyboard shortcut to assign it to an appropriately classed and named local variable.
It just seems redundant to write all of "Foo *foo = [[Foo alloc] init]". For one you're typing the class twice - clearly redundant. Secondly, this is a temporary local variable, it doesn't need a custom name. It shouldn't have a custom name.
It's not so much about typing speed, more like a general dislike of redundancy.
The theorem is the more redundant the language, the more IDE help it requires. Objective-C is the worst I know. Although they're adding more and more layers to the compiler to make it less so.
Neat idea, reminds me a bit of Reverse Polish Notation, Forth & friends.
Now it's got me wondering about a text editor built on RPN lines, kinda like an inverted emacs + ed...
It is an appropriate name however. After dabbling in Forth for fun, I became very aware how fleeting and unnecessary local variables are.
Since then I use these kinds of 'completions' by using the extract variable refactorings, and various intent transformations - they added a syntax to existing tools.