Posts tagged programming language
Case insensitive Map key – code smell
Sep 23rd
Here’s the bug that had me working today (a Sukot holiday):
_myMap.put(key.toLowerCase())
...
_myMap.get(key) // without lower casing the key.
At first you might think of this as a common human error, but I claim that it’s no less of a code smell:
Why trust yourself to always remember to lower/upper case all of the interactions with the map? What about trusting others?
So, instead of using a HashMap, use an Apache CaseInsensitiveMap that nicely and safely encapsulates this key’s case concern.
P.S.
I would expect CaseInsensitiveMap to become a part of the Java SDK.
IBM’s PLDE seminar 2010 – Review
Apr 14th
I spent today at the IBM Programming Languages and Development Environments Seminar 2010, that took place at the beautiful Haifa Research lab mount Carmel campus. Things worth mentioning:
Gilad Bracha, father of Java Generics and auto-boxing, spent 60 minutes repenting Sun’s Java 1.0 early design mistakes, such as allowing primitives and static members into the language. IMHO the lecture itself was so-so. Gilad pointed out Java’s soft spots, but didn’t bother presenting the crowd what he views as the alternatives. What he did suggest was to check out his new baby programing language Newspeak (something for the purists I guess).
Perhaps some of Java’s charm at the early days was its simplicity and low learning curve, I’m not sure that a semantically perfect Java (could there by anything like this?) using nested classes instead of static members would have enjoyed the same mojo.
In one additional interesting lecture, Kathy Barabash, talked about how data structures with a sequential references object graph (say a LinkedList) do not allow traditional concurrent GC Tracing algorithms to scale on many-core (i.e., massive multi-core) platforms.
What good is your new 1,024 cores Intel processor if the desktop widget nuclear explosion simulation flickers because it can only scale on 400 of the available cores, right?
Google is pregnant again – Noop
Oct 5th
After the zillion new dynamic languages that had flooded the earth
(groovy, ruby, …), Google is concocting Noop; a new type-safe language to join Java, Scala, and the rest.
The new language sets out to excel in testability, dependency injection, and readable code (see the proposed features). More interesting than whether Noop will gain a crowd of enthusiasts, is the language’s dynamic and lucid development process; made available through Google code (Sun’s JSRs, are also transparent but here it’s a whole new language).
What do you think?


Via e-mail