After reading so many informative posts this morning (strokes, Sudoku, knitting, computer animation, shorthand, and many more), I thought I’d write my own. I’ll start with a poem:
Roses are red
Violets are blue
Java is awesome
And so are you!
I learnt Java through Kathy Sierra’s Head First Java:
The reason why I loved it so much was because of the poetry scattered throughout:
And another one:
Of course, I never realized this at the time. They were mere snippets of the book that really resonated with me (Wow, look at all this poetry, it is so cool, awesomeness). I would write all my own verses to match the ones I’d read.
So here’s a quick tutorial on a first Java program.
The following steps are how to get started with coding.
Install Java on any computer. And then follow the steps:
1. Create and save MyFirstApp.java (included below). For beginner purposes this can be done in a notepad and not an IDE. In fact, we never had the luxury of IDEs when I studied “so long ago”. In the days before Google.
2. Compile to create a class file (MyFirstApp.class) (google it if you need details)
javac MyFirstApp.java
3. Run the app from the console
And here is how a sample .java file looks like:
public class MyFirstApp {
public static void main(String[] args) {
System.out.println(“I Rule!”);
System.out.println(“The World”);
}
}
It’s been suggested I never go into teaching, so I’ll write poetry instead:
Roses are red
Violets are blue
I love coding
How about you?


