Skip to content

case “String” : still FAIL

You know, just because Java is going to gain a switch statement that works on java.util.String still doesn’t make it right. It’s still a code smell for an OO design fail. Although the diamond syntax and lambdas are way overdue (see article).

Java is not the new COBOL | Craig Tataryn’s .plan:

A switch statement that I’ll actually use
Yes, finally my Java brethren we have a switch statement that actually works on Strings!

switch (lang) {
   case "Java" :
      out.println("I like frameworks!");
      break;
   case "Ruby" :
      out.println("I like Pabst Blue Ribbon!");
      break;
   case "PHP" :
      out.println("I like WordPress!");
      break;
}

My God this has been a long time coming.