Self-documenting interfaces and having nice tools.
I used to prefer dynamic languages (specifically Python, Common Lisp, and Ruby) over Java for my spare-time coding projects. That's changed recently and I've come to realize it's because of generics and the smart for-loop in Java 5.
Since Generics arrived in Java, my code has a much cleaner feel to it. Imagine a class for generating Atom feeds. Instead of the Python code:
class Feed:
[...]
def get_entries():
return entries
In Java, the method signature would tell me everything
interface Feed {
Iterable<Entry> getEntries();
}
Now I know immediately that what I will be getting can be shoved through a smart for-loop and the entries worked over like so:
for (Entry e: getEntries()) {
doSomething(e);
}
I had a good idea that the Python code would return a List (because I can see the return statement) but I'd have to run my tests to be sure it worked. With Java 5, I have a better chance at build self-documenting interfaces. I really like that.
I should probably also admit that IntelliJ IDEA has completely changed how I program in Java. I used to code with the following steps:
- make changes
- compile and wait forever.
- read compiler errors
- fix
- make changes
- look at the sidebar for red
- see red, go directly to the error
- fix
Same amount of steps but because of incremental compilation it's a small fraction of the former time and I never leave my editor.
I'm sure I'll write some gushing blog posts about IDEA and Java 5 in a few weeks. Papa's got a new bag.
(Sorry, that's the last time I'll call myself "Papa")

![[Atom Enabled]](http://saladwithsteve.com/valid-atom.png)
5 Comments:
As far as the IDE goes, that's how I feel about Eclipse too. It's not as good as having an REPL in some ways (although Eclipse kind-of has that as well), but that sort of instant feedback, combined with comprehesive context info so you don't have to thumb through the API all the time, are really useful.
11:23 AM
Yeah.. having an incremental compiler seems like it would make a big difference for me. The "wait for ever while it compiles" step seems to burn a LOT of time over a few weeks of hard development.
I've wanted an incremental compiler plugin for Emacs for a while but the problem is that jikes can't load up new files so you have to restart it.
It also had a bug where it wouldn't work on Linux (but I'm on OSX now).
Even if I did get incremental compilation working I still wouldn't have reliable code completion. I worked on a jde-autocomplete package a few years ago but maintaining it turned out to be a pain.
The emacs semantic-db package looks like it might work but Emacs still lacks the GUI primitives to do autocomplete. You can't popup a dialog box at the current (point) which kind of breaks the whole concept.
The main problem is that the Emacs developer are SOOOOOOO old school that thhey haven't even SEEN modern IDEs so they don't realize why you'd need these features.
It's really a pathetic situation really. Emacs is so reliable an d rock solid when compared to other IDEs. The whole reason I switched to Emacs in the first place is that it just plain worked. Having been tested for 20 years make it easy to get rock solid.
That said my Emacs on OSX is still buggy as hell...
I tried Eclipse last week and was less than impressed. Talk about a UI built by engineers!
I'll have to give IDEA a try though..
2:58 PM
This... this is crazy talk.
9:07 AM
Michael: Eclipse is pretty good, I use it for C++ with the CDT. I like how people are building lots of neat tools on top of Eclipse but I would hate having to write XML config files for plugins, though. Maybe they can get rid of that with Java annotations?
12:52 PM
Have you looked at any of the Interfaces implementations for Python?
8:00 AM
Post a Comment
Links to this post:
Create a Link
<< Home