4 ms·
The issue with autocomplete is that it makes writing a lot of code really easy but offers no help when reading the code. Syntax/semantic highlighting may help a
by exDM69 12y ago
The issue with autocomplete is that it makes writing a lot of code really easy but offers no help when reading the code. Syntax/semantic highlighting may help a little but the issue is still there.
Given that more time is spent reading than writing code, autocomplete is only a partial solution to this problem.
- yoz-y 12y agoI consider verbose code to be more readable in general. However one has to take more time when naming their functions and parameters.
- mpweiher 12y agoThis comment makes sense for the original problem, but not for the message you're replying to, as keyword parameters help tremendously with readability.
- BurningFrog 12y agoI've never worked in those languages, but I suspect I'd end up with a lot code like this: foo(author: author, title: title, price: price) The problem in the article is real, but it is the exception. If it's hard to see what 5% of your parameters mean, forcing 100% of them is probably a cure worse than the disease. When I worked in Java with IntelliJ, the solution was to simply hover over the call, and the declaration would appear.
- jjoonathan 12y agoIDEs fix both problems: writing verbose code and reading terse code. The thing is, code isn't always examined in a working IDE, and it tends to be read outside of an IDE more than it tends to be written outside of an IDE. The disease is far worse than the cure. I frequently (at least once a day) find myself wishing code was written in the smalltalk style but I've only found the smalltalk style inconvenient on a small number of occasions.
- mpweiher 12y agoWhile I can't speak to what you would end up with, my experience (~quarter of a century) is that this is not the case. To verify, I just did ack '\[.*:' | less to search my code-base for message sends with parameters. Scanning the first hundred or so results shows the pattern you mention to be rare. Dan Ingalls explains the syntax really nicely in this video: https://youtu.be/P2mh92d-T3Y?t=600 With this type of syntax, most APIs turn into EDSLs all by themselves, and often read like fairly natural sentences. I ramble on a bit about the relationship between keyword syntax and (lack of) operator overloading: http://blog.metaobject.com/2015/03/why-overload-operators.html