Sort and Stream

I’ve started a (not-so) technical blog, and will be posting any relevant (not-so) technical articles over there. (For the times I have no poetry. Or petals). If any readers are into coding, please hop on over and give me a follow!

Sort and Stream

Thanks, and happy week ahead 🙂

Learning Java Through Poetry

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:

FullSizeRender

And another one:

FullSizeRender(1)

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?

https://dailypost.wordpress.com/dp_prompt/daily-prompt-2/

Tears of Joy and Strife

In response to The Daily Post’s writing prompt: “An Extreme Tale.”

It was the best of times
It was the worst of times
Thinking of these lines
First thoughts in my mind –

I hate it, I love it
When web services do not work
It can bring me to my knees
Why oh why oh please!

Troubleshoot and analyze
Sleep a luxury, no time to eat
Life comes to a halt
Because I have code that doesn’t run!

Managers, deadlines, clients
Breathing down my neck
We have a plan, don’t you know
Yeah I know, and I have code that doesn’t run!

What to do, what to do?
Calm down, breathe, make some tea
I have no time to sleep
Until finally

Sweet finally
After days and nights
Tears and strife
A few changes here and there

And we have success!
Oh sweet code, alive
I have a result!
Tears of joy, fall to my knees

Highs and lows
Moods and swings
Roller coaster work
Roller coaster life