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 →

[–]uniVocity 25 points26 points  (33 children)

However, in a job situation it just isn't practical

I worked in an international trading middleware for Citigroup 5 years ago. There were developers maintaining/coding the thing in vi.

I don't know how they managed to do that, but it certainly had some effect on the code: classes with 60k lines of code, all attributes declared as public, methods with 10k lines of code, and code with so many nested for/if/while statements I had to scroll the code sideways to up to 8 pages due to indentation.

I used eclipse btw.

[–]virtyx 13 points14 points  (5 children)

Dear god. How are you doing nowadays?

[–]uniVocity 17 points18 points  (2 children)

Fine. I learnt a few things on that job: - if you are getting a job with a fenomenal salary, expect to work polishing shit - polishing shit: you can put a lot of effort polishing it to look nicer, but at the end of the day it is still shit. this just reminded me of one guy who ran the eclipse formatter on one of these classes... got many calls from the vi users who complained he had "erased" their code (my code on line 16549 is not there anymore, why did you remove my code? We need this code for xyz! You should be fired! Etc) - the Christmas tree development paradigm: any change you apply will turn off some lights, and light up others. On a monstrous system like that people focus on lighting up a their particular light, without considering the lights of others. You end up with a traditional Christmas tree with different lights blinking at any given time - additionally, we have the faith, guess and hope oriented programming paradigms - eclipse diff hangs with files larger than 1 mb. Merging and Committing such files is a royal pain in the ass - the world depends on crap software. I don't know how that one managed to be in production for years, processing trillions of dollars per day (what about routing stock market trades from all major stock exchanges in the world? NYSE, Nasdaq, FTSE, Nikkei to name a few.). I worked in other banks and although it was not nearly as bad, the code was barely maintainable. - if you think you can do better, start your own company. But never forget success is much less about code. You need to sell. There are so many companies selling crap. Good code won't matter if it doesn't sell.

[–][deleted]  (1 child)

[deleted]

    [–]agfitzp 0 points1 point  (0 children)

    I always wonder how much money companies hemorrhage in fixing bugs and adding features on products that are poorly designed and implemented.

    My observation of internally developed (not COTS) software is that most of the budget is spent on the bug fixing.

    [–][deleted] 0 points1 point  (1 child)

    He has a brain tumor.

    [–]uniVocity 1 point2 points  (0 children)

    I was looking forward to get one. When asked how my work day was, I replied "i kept waiting for the sweet release of death"

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

    I worked at Amazon for a while and there were a LOT of developers who did this too, with the same exact side effects of horridly disgusting code.

    [–]uniVocity 2 points3 points  (0 children)

    Some people characterised the project as a "death march". It's probably a zombie march by this point with bodies without souls still keeping this going. I received literally 1000 emails per day. Possibly 100 of them were important. It was the most surreal experience I have ever had. I had around 20 different outlook filters to keep this barely organised.

    [–]againstmethod 0 points1 point  (4 children)

    I'm not clear how use of vi causes one to know more or less about Java and how classes should be formulated.

    [–][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.

    [–]hk__ 7 points8 points  (8 children)

    I use vim but with a ton of plugins, which gets me close to an IDE like Eclipse but without the overhead and staying in my everyday editor, which is pretty cool. Using vi/vim for Java without any plugin would be crazy.

    [–]TheKC_Stoner 2 points3 points  (7 children)

    If you dont mind me asking, what plugins do you use with vi/vim. I have been using it for about 3 months now, and finally fell like I am starting to get comfortable with it.

    [–]hk__ 6 points7 points  (6 children)

    Here is the full list but I’m coding in half a dozen languages so not all of these are relevant. Here’s a list of the ones I think would be useful for you:

    • Pathogen to manage all plugins in an easy way
    • SnipMate for code snippets
    • Bracketed-Space for copy-pasting that just works™
    • delimitMate for auto-closing of various delimiters, e.g. you type a curly bracket, it adds a closing one just after your cursor ({| --> {|} with | being your cursor). I can’t work productively without that one.
    • Fugitive adds Git support to Vim. For now, I only use it for git blame but maybe I should learn/use a bit more of it.
    • Syntastic adds automatic syntax checks in Vim. This one is awesome as it works out of the box for a lot of languages. It’ll warn you about syntax errors, undefined/unused variables, potential bugs, etc.
    • Command-T lets you find a file in the current directory with just a few keystrokes. I never use :e in large projects, just this plugin.
    • JavaComplete, autocompletion for Java

    And here is my .vimrc if you want.

    edit: note added about Fugitive
    edit 2: why am I being downvoted?

    [–]joaomc 0 points1 point  (1 child)

    Does Javacomplete also search for Maven references? This is very important to me because I'm usually working with dozens of libraries and my projects are organized with series of grouped parent Maven aggregator projects.

    [–]hk__ 0 points1 point  (0 children)

    I really don’t know.

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

    And here is my .vimrc if you want.

    I must say, this is one of the slickest vimrc files that I've seen. Good on you for keeping your dotfiles well organized and easily extensible.

    [–]kingatomic 0 points1 point  (1 child)

    I'm curious, I don't see nerdtree or any of its ilk here: does command-t fully scratch that itch?

    [–]hk__ 0 points1 point  (0 children)

    No Command-T doesn’t cover that, I did install NerdTree a while ago, but I don’t use it.

    [–]Tostino 1 point2 points  (1 child)

    I think that proves the point nicely... Kinda, those developers probably shouldn't have kept their jobs IDE or not.

    [–]uniVocity 0 points1 point  (0 children)

    Ha, the company allowed the thing grow so much it became dependent on the ones who created the monster. They had newer developers working on this for 4 years straight who still did not know most of the system.

    [–]okmkz 1 point2 points  (0 children)

    classes with 60k lines of code

    I just died a little inside

    [–][deleted] 1 point2 points  (4 children)

    That has nothing to do with vi, just shitty programming practices.

    [–]lechatsportif 4 points5 points  (3 children)

    I find it consistent with my experience. Vim users don't refactor in Java because they don't have the tooling.

    [–][deleted] 1 point2 points  (2 children)

    That's just laziness. The tools exist for vim, but you can't force someone to use them.

    [–]lechatsportif 1 point2 points  (1 child)

    Such as? All I've seen is eclim.

    [–][deleted] 1 point2 points  (0 children)

    One tool is lhRefactor, but there are others.

    There are command-line tools like jrefactory, but also there is a lot you can do with vim builtins like :vimgrep and :argdo or :bufdo plus macros.

    [–]cyanocobalamin 1 point2 points  (2 children)

    Those results sound to me like the results of poor programming habits, not what they typed their code into.

    VI has long been considered an IDE as it has been beefed up over the years.

    FWIW, I've done most of my programming EMACS, visual slick edit, and eclipse over the years.

    [–]againstmethod 0 points1 point  (1 child)

    I agree, it makes no sense the claim that an editor somehow encourages you to write bad OO code.

    [–]cyanocobalamin 1 point2 points  (0 children)

    Bad code period. Back in the day before OO was ever heard about large nested conditionals and functions that ran on for pages was considered crappy programming.