The last time I've really coded in Java without learning a concurrent language was ICS 111. Since then I've renounced Java, as alternate dynamic languages I've learned in such classes as 215 and 313 was a lot more appealing to me. Diving back into Java on the first day of 314 was a challenge (though, it was akin to riding a bike, you never really forget it).
Asking to go back to Eclipse was another blast from the past after switching over to Emacs in the past year. The first problem being that in Emacs I use viper-mode, a plugin that emulates the keybindings for vi. To get writing the code, I had to dig into the settings to switch to emacs keybindings, which was a little more familiar to me. Factoring this into the equation I produced the following code in about 10 minutes:
I decided to omit the curly brackets from the code because of code I read in 211 (and from Java In A Nutshell). Learning Python in 215, I liked how compact it looked and so decide to make similar if statements. I also have a bad habit of not documenting my code, as seen here. Having not really produced code for anyone but myself and the TA grading it, I often try to make code the most compact without really explaining what I'm doing. While I could look back at code I wrote, I wouldn't be surprised if a third-party wouldn't be able to understand it. Even if this is a trivial program, a few lines shows one's proficiency and understanding in writing good code.
No comments:
Post a Comment