| Sam ( @ 2008-04-08 21:23:00 |
| Current mood: | |
| Current music: | Coheed & Cambria - God Send Conspirator |
| Entry tags: | class, programming |
Cancer of the Semicolon
The following is only relevant to the programmers on my friends list, probably...
So, did you know that Java has syntactic sugar for iterating over a collection? So you can write this:
for (SomeType item: stuff) {
// code here
}Instead of:for (Iterator<SomeType> iter = stuff.iterator(); iterator.hasNext();) {
SomeType item = iter.next()
// code here
}I didn't until recently. When did that happen? Was that not around when I was first learning Java?Despite that, I'm feeling more competent Java-wise lately. I feel that I finally understand the JNI (how to use it, anyways). I even got a C++ API for the multitouch hardware I'm using to play nicely with some Java code.