M257 - Putting Java to work

I read Unit 1 of M257 last week, but didn’t have the chance to do the practical exercises for it until today, so I’m counting today as my official return to the land of Java. I’m very happy to be studying a Java-based course again, particularly since it allows several things that were either not valid in C++ or just not MT262 “course style”, e.g:

  • Declaring and initialising a variable on a single line.
  • Using the ++ operator.
  • Using lower-case letters for the start of variable identifiers.

I haven’t done any Java coding since June, when M255 finished, but it seems to be coming back to me fairly quickly. NetBeans is very nice to work with, which makes getting back into the swing of things a lot easier. I’m especially enjoying the autocompletion menus and the “live parsing” feature that underlines errors like a spellchecker would, since they help me to avoid silly typos. I’m not sure whether I like the automatically-generated end braces yet, but I’ll probably get used to them. Hopefully it won’t render me incapable of remembering to close my own braces!

Once I’d finished the practical exercises for the first unit, I made a start on Unit 2. Most of the material is similar to that covered in my previous Java course, but there were a few interesting bits and pieces that I don’t remember appearing in M255:

  • Escape sequences – I think we used '\n' in M255, but we didn’t cover Unicode character literals.
  • Casting from int to char – I might be wrong on this, but I think this idea appeared in M263 but not M255.
  • Writing float values using e to denote scientific notation, e.g. writing 1.234 × 105 as 1.234e5.

So I’m pretty happy with M257 so far. I do miss the Frogs and HoverFrogs from M255, but the Robots, SpeedRobots and MagicRobots from M257 are very cute in their own right! Like this little dude:

Putting Java to work