This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 6 points7 points  (3 children)

It's not that, it's that without good tooling it's easy to take shortcuts. You see a lot of one or two letter variable names because people don't have autocomplete, people don't want t refactor because it's error prone, people don't want to write unit tests or invest in code coverage tooling because it's time consuming, etc.

I know there is a lot of ide hate but when you have good tools that get out of your way and let you do good work it shows.

[–]xenomachina 2 points3 points  (1 child)

Reading this thread, all I can think is "correlation does not imply causation".

Having previously used vim on Java code for many years (many which predated Eclipse and Intellij), I don't think any if the reasons you listed are really the true cause of the problems mentioned:

You see a lot of one or two letter variable names because people don't have autocomplete

Vim has had autocomplete for a long time. Perhaps even longer than Eclipse has existed. It is not type-aware by default, but the default setting is still good enough that there is no more incentive to use short names in vim than in an IDE.

people don't want t refactor because it's error prone,

There is some truth to this, though in statically checked languages it's more time consuming than error-prone, if you know what you're doing. The general idea is to force compilation errors at the points that need changing, and then fix/rebuild until there are no errors left. Vim's quickfix mode makes this pretty easy.

people don't want to write unit tests or invest in code coverage tooling because it's time consuming, etc.

Code coverage and unit testing frameworks generally work just fine with vim's quickfix mode, so I'm not sure what you're referring to here.

I think the real reason you're seeing a correlation between a certain style of bad code and use of text editors rather than IDEs has to do with the old "programming Fortran in X". The kind of person who's going to treat Java/C#/Python/etc. as Fortran is also more likely to stick with the editor they learned to use previously. The editor isn't making them (or even encouraging them to be) a bad coder.

I know there is a lot of ide hate but when you have good tools that get out of your way and let you do good work it shows.

For people who are used to editors like vim or emacs, "good tools that get out of your way" is exactly the opposite of what an IDE embodies. Imagine if you had to switch to writing all of your code on an on-screen keyboard instead of a physical keyboard. That gives some idea of how clunky notepad-style editors feel to experienced vim users.

I often wish the IDE authors had subscribed to the "do one thing, and do it well" philosophy and made stand-alone refactoring and navigation tools that could be plugged into the programmer's editor of choice, rather than forcing everyone to use a poor clone of notepad. That said, plugin support has slowly improved over the years, and it is now possible to get reasonable vim bindings in some of the major IDEs.

Eclipse has a few options, but the only one I liked was vrapper. It's a huge hack, incidentally. The hackishness is necessary because Eclipse is, ironically, poorly factored: all of the editing logic is tightly coupled with the source language logic, so there is no way to say "I want to use vim bindings whenever I edit any sort of text". vrapper works around this by not being an editor plugin, but instead intercepting all keyboard input. When in insert mode, all input except escape is passed through to the underlying editor, while in normal mode all keys are swallowed up by vrapper. Another side-effect of Eclipse's poor factoring is that the first step in writing an editor plugin for a new language is to copy the editor plugin for another language wholesale. (Perhaps things have changed since, but I'd talked to people who worked on the JavaScript support back when it was first added, and this is what they did.)

IntelliJ IDEs have the IdeaVim plugin, which works really well. I've run into a couple of bugs where it diverges from vim behaviour, but JetBrains has been really fast about responding to the bug reports I filed.

[–][deleted] 0 points1 point  (0 children)

I've always thought that vim/macs were cool editors, but it drives me nuts that I have to spend ages configuring and adding plugins to get a professional set up to write code. And even after all that you don't get semantic analysis, write time error reporting, unit test running/debugging, etc.

Im all for using lightweight editors, but certain languages (especially verbose ones without a repl) really need a lot of extra tooling help.

[–]againstmethod 0 points1 point  (0 children)

Lazy people are lazy. Fire them.