Moving Between Languages

My brain doesn’t want to return to a strongly typed, proscriptive language. For almost 4 years I wrote exclusively in C and C++. I got very used to explicitly declaring variable types, worrying about allocating memory, destroying pointers, and many things that other languages hide from you. Despite being a lot more investment in the beginning, it did help me learn what the computer is actually doing behind the scenes. But when I started exploring other languages, I started to see the simplicity that other new programmers may take for granted.

For the last year I have been trying out Ruby(which I love) and JavaScript(which I’m learning to love). Of course each of these languages come with their own oddities and shortcomings, but overall they both are a move towards abstracting away the initial hurdles new programmers face. Thinking about declaring an array, and having to actually know the size up front, never enters the picture. Worrying that you forgot to delete a pointer, or deallocate some memory, forget about it! I loved the speed and ease at which you could clip along creating whatever you want. But now, after a year of these awesome new languages, I am heading back to the other side.

This week, as part of my apprenticeship at 8th Light, I am finally diving into Java, which I have been meaning to do for a while now. I have been working on a few breakable toy projects to get familiar with the language. Switching from Ruby to Java feels like getting back on a bike after taking a few months off. I still know how things work, but it is taking me slightly longer to get where I am going. But as the saying goes, what doesn’t kill us makes us stronger. Please don’t kill me Java.

Java Hash

CoinValueMap = new LinkedHashMap<String, Integer>();
CoinValueMap.put("H", 50);
CoinValueMap.put("Q", 25);
CoinValueMap.put("D", 10);
CoinValueMap.put("N", 5);
CoinValueMap.put("P", 1);

Ruby Hash

CoinValueMap = {H: 50, Q: 25, D: 10, N: 5, P: 1}

Getting back on the bike.