Hacker News new | ask | show | jobs
by elb0w 5473 days ago
or use vim
2 comments

I use vim for everything but Java. When it's Java time, I use Eclipse. In fact, if every language worked as well in Eclipse as Java does, I'd probably use Eclipse for everything (like I used to). The productivity gains you get from using Eclipse for Java vs a text editor (vim) are HUGE. This is not a fault of vim, it's a fault of Java for being so verbose.

Example: you can move a method to a new class in Java, and Eclipse will go through your entire project and find all references to that method and update them for you.

I guess it's the same reason C# and MS coders love Visual Studio so much.

That said, I try to avoid using Java, and generally stick to vim.

But wouldn't you apply some of those refactorings in other languages too? Movings methods, refactoring out inner classes, removing/adding parameters to methods and constructors etc. It all adds up if the language has good support in your IDE.

I'm not a power user of vim, but perhaps there are some kind of extensions for some of these things there?

I wish there was be something, actually, that would match what you can do with the Eclipse/Java combo for other languages.

Eclipse turns java into a ctrl-space fest. People yell at java for being verbose and statically typed, but all this verbosity is what allows an IDE such as Eclipse to exist. Just press ctrl+space and the verbosity turns into clarity and speed for both the programmer and the IDE.

I have more than a million lines of codes behind me since I learned how to program, 4 years ago. That's 250 thousand lines of working code per year, and I didn't even code more than half-time in java, and I can't type faster than 40wpm. I'm not advocating quantity vs quality, just saying that quantity becomes a completely irrelevant measure when you use Eclipse & Java, and that's very refreshing; you can keep coding long, dumb, and not performance-critical code while you think about another more important/complex section of your project, participate to a meeting, discuss stuff on the phone - you just set sail and let Eclipse do the hard rowing for you.

As for refactoring - delete a class named MyClass with a doStuff() method in a project, create a new interface MyClass with a doStuff() method in another project and another package, add this project as a dependency to the first project, select the first project, press ctrl+shift+O, et voila, every file was fixed, and it simply works within a few seconds even if there are a thousand sources referencing that MyClass. I'm not sure if there's any language/IDE that allows that sort of fast & furious refactor, but do tell!

What are other great IDE/language combos?

Other combos? Prehaps Visual Studio for C# with ReSharper. It even gives suggestions about folding loops into LINQ statements and simillar.

What I'm really disappointed is abysmal quality of IDEs for dynamic languages (Python and JavaScript for example). I know that's because of the language design, but writing code in those languages after coming from Java/Eclipse or VS2010/C# feels like I'm crippled.

Unity3d has its own javascript-like language and introduced the keyword #pragma-strict - it enforces static typing within a script. I imagine an IDE could make good use of such toggle, for the best of both worlds.

http://unity3d.com/support/documentation/ScriptReference/ind...

Personally I prefer intellij due to good integration with maven, spring and hibernate out of the box. It's been some years since I tried out Eclipse, so I'm going to try out the latest release in some spare time since I now hear maven support is getting much better.

Jetbrains also have a (fairly) decent Ruby IDE as well. And also ok JS support in their software.

There are some, but Vim is a text editor at its core, not an IDE. It excels at editing text but it pretty much treats everything as such, too. It does not have much concept of 'code'.
refactor in vim:

    :g/\<sv\>/s//some_nicer_name/g
That's not refactoring. That's a specific refactoring known as rename.

Rename is handy, and might even be the most often applied refactoring, but it's also the easiest to craft. Move Method, Pull Up, et al are useful and not as easy to craft.

Then there is the Move class refactoring, which, if integrated well with your source control system, is an almost magical time saver.

Have you seen Eclim?

http://eclim.org/

You can either 1) run a headless eclipse with a vim front end, 2) use a headed eclipse and vim together, or 3) use a headed eclipse with gvim as an embedded editor.

Looks like it might be worth a try.

Vim doesn't compile as you type, so it can't give you much intelligent interaction with your code.

Obviously, there are work-arounds (like using clean APIs and libraries), but that's not always an option.

>intelligent interaction with your code.

I use cscope for intelligent interaction with my code, vim as the primary editor/interface (keybindings for cscope are awesome..) and ddd in an 'always on top' window for building/debugging .. in comparison to my Eclipse (android) environment where I am also working, I think that an easy balance can be made if you use the 'apps as pipes' philosophy that a good vim experience requires ..

Good programmers don't need this.
It depends on the stack you are working with. Need to work with a big, unfamiliar, badly documented API? Good programmers don't want to be in that kind of situation, but it happens.
For me, cscope+vim+ddd has all the editing/building/debugging power I need .. I think with this combination of tools I can match the prowess of any fat IDE for any degree of 'cruddy project' > 'power codebase' ..
I'll disagree, and assert that this is the logical conclusion of your statement: http://xkcd.com/378/
Good programmers code in hex.
Good programmers don't need this, like good sprinters don't need bicycles.
Ah yes, the classic "if you haven't memorized all of the APIs and their side effects you're not a real developer" schtick.