Monthly Archives: January 2011

Java NIO: Must remember to avoid using SelectionKey.attachment

Must remember than SelectionKey.attachment is evil and should never be used to store anything that has a handle on a buffer.

Posted in Uncategorized | Leave a comment

Scala: More differences from Java

Method declarations use the def keyword and follow’s Scalas syntax rules of putting the type after the symbol for argument variables. In our send method below, the statements within look a lot like Java code with some minor differences: On … Continue reading

Posted in Uncategorized | Leave a comment

Scala: Declaring classes

Scala classes are public by default. It Java, to define a class with a field, you need to define the field an argument in the constructor for that field and an assignment from the argument to the field to initialise … Continue reading

Posted in Uncategorized | Leave a comment

Scala: Rewriting from Java

I’ve taken the ROX NIO tutorial code, fixed it up a bit, translated it to Scala and uploaded both the Scala and Java to https://offsync.googlecode.com/svn/tags/rox-nio-tutorial-source I’ll be looking at some of the differences between the Scala and Java code.

Posted in Uncategorized | Leave a comment

Very useful Java NIO resource

I highly recommend the ROX Java NIO Tutorial for learning about Java NIO. Java NIO made no sense to me whatsoever until I read this page.

Posted in Uncategorized | Leave a comment

Scala: Declaring variables and methods

The first thing that hit me in my first encounter in Scala is the different syntax for the declaration of variables. In Scala it is defined in one of two ways: The first line defines an immutable value (i.e. constant … Continue reading

Posted in scala, software development | Leave a comment

Scala: A journey

I’m a Java, C# C++ programmer by trade and having worked on software projects involving those languages throughout my 10 year career. ¬†Yet I have on many occasions struggled with dealing with the complexities in code written in those languages … Continue reading

Posted in scala, software development | Leave a comment