Fun Stuff > CLIKC
A programming thread!
snalin:
I've been using Eclipse for so long that IntelliJ throws my keybinds of completely. Other than that, they're pretty much the same - from what I've heard from people who work, IntelliJ paid edition is a big upgrade over Eclipse, while the free version is a sidegrade with far less cool (and uncool) available plugins. Eclipse is... a memory hog for sure, it can crash (though I haven't been through that recently), but it has that brilliant marketplace for free plugins right there in the editor. IntelliJ comes with built in support for some extra languages (like Groovy, which is really fucking groovy), but in my experience, adding additional languages to Eclipse works like a charm. I had Python with autocomplete, debugging and in-editor console running in minutes.
By the way, stay the away from Eclipse classic, as it's just bullshit. It's no faster, but has a ton of less features.
If you're using Eclipse with the Maven plugin (m2e), you'll want to know that you don't have to use the bogus maven gui they include, you just have to right click and open as text file. On the other hand, whenever you want to add something from a Maven repo to your project, there's a right click menu that allows you to search and add from all of the publicly available Maven stuff. Saves you a ton of trouble. Generally, whenever there's a problem with the interface, there's a setting. I'd seriously recommend looking into changing the theme for Eclipse too - I've got colored text on a black background, and it's the best.
No matter which one of them you use, you'll definitely want to get familiar with all of the re-factoring and code helping tools available. The university here doesn't really teach them, or their value. While the value of being able to rename a class, and have the class be renamed over all of your hirearchy has obvious value, there's things I see people just not using which they should be using, so here's a selection:
- autocomplete (shift+space on both Eclipse and IntelliJ) is the best thing in the world - remember when you had to look up APIs somewhere else? Not anymore! Also you'll be writing code ten times faster.
- Autocomplete also has built-in shortcuts for some common statements. If you write "syso", and click autocomplete, it'll automatically expand to System.out.println();, with your cursor in the parenthesis. For and simplified for loops are available through "for" and "foreach" respectively, and expand with the closest array or indexable object in yr loop. It's great.
- If you have a variable a of class A, and write a. before you go autocomplete, you'll get a list of all available methods and variables you can use with a - it'll even filter out the ones you can use where you are, so private members will only be shown if you're in A.
- autoformat is also super useful. It's highly configurable, and your code will always look great. It also helps you spot dangling if's and that kind of stuff immediately.
- Jump to last/next error (compilation problem) with ctrl+, and ctrl+. in Eclipse. Added or removed something from the signature of a method? Just jump around to the problems.
- Auto-fix problem is just, wow, much help, so best. Whenever your cursor is over a warning or error, ctrl+1 (Eclipse) gives you a menu that you can select fixes from. So, say you write MyClass implements MyInterface, where MyInterface defines some methods. You'll immediately get a compilation error, as MyClass needs to implement those methods. You ctrl+, to jump to the error on MyClass, ctrl+1 to get the menu, enter to select "add unimplemented methods", and BAM, you have each of the methods filled out.
- Further Eclipse - ctrl+shift+r is "open resource", which allows you to write in the name of any file in the hierarchy to jump to it. Ctrl+o is "go to method", which is the same, but for the class you're in.
- Generate getters, setters and constructors from variables are great tools. Generally, too many getters and setters is a sign that you're not quite into the OO way of thinking, but you'll want some. The constructor tool is amazing. Three button presses (alt+s, a, enter) gives you a constructor that sets all of the privates.
- Alt+arrow up or down moves a line of text up or down. If you do it with multiple lines selected, it moves all of those lines. Did you suddenly realize that this one line needs to be outside the if block? Well, you're in luck! Want to move this entire method higher up the document? You betcha.
Basically, get to know your IDE. Spend time getting those keybinds and features into your fingers. If you at any point think "this is a thing I do all the time that it should be possible to do automatically", the
feature probably already exists, somewhere. Hell, you can sort your methods alphabetically, if you want to.
With the OO stuff - if there's one thing I know in this world, it's OO programming. I'm not a straight up guru, but I'm still pretty decent at it, and I have some experience TAing both introductory and advanced programming courses in Java. If you want help with some exercise sheets, seriously send me a PM, and we can talk over Skype or something.
smack that isaiah:
Most IDEs that I've come across have plugins to add vim keybindings for text editing. I use the vim plugin in Visual Studio at work and in PyCharm for my personal python projects. I would bet Eclipse has some sort of vim plugin, if you want to keep to your normal text editing feel in whichever IDE you choose.
It's been a while since I did Java work, but I remember BlueJ being a good introductory IDE for Java, if you want to look into that one, too.
Dimmukane:
Ending my long period of lurking to chime in and say that JetBrains has some seriously useful IDEs if you're willing to pay for them. I use both PyCharm and Rubymine (both 199$) and they're so much more useful than what I could do with Eclipse. If you have the scratch to get them, they're definitely worth the purchase (and they come with I think a year's worth of software updates, with the option to extend the maintenance license for another 99$ a year).
ev4n:
I hate eclipse. It's so big and slow.
Most people here use notepad++. Not an IDE, but fast.
snalin:
It's fast at not doing anything else useful than writing text. You're shooting yourself in the foot, and slowing your progress considerably if you stick with a text editor.
Seriously, if I was hiring a Java developer, and asked them "what's your IDE of choice", and got a text editor as a reply, I'd show them the door. The amount of speed and utility you get from any IDE is just incredible when compared to plain text, and I'd know I would be getting a lot more and better work from somebody who knew how to use proper tools. Maybe I'd accepts a pretty heavily pimped Vim, but that's a stretch.
As far as I'm aware, most places you learn programming does not teach proper tool usage, and does not teach how to write good unit tests. Both of those are sorely lacking here in Norway, and from what you guys have written about your education in various places, it's not stuff that's being taught there. Those two are essential skills, and if you don't know them, you can be as good as you want at understanding and writing in your language of choice and still not be able to write good software.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version