…is that it takes so long to type things! I’ve always thought Hungarian Notation was a foolish thing for classes and interfaces (e.g. CRotationMatrix and IAffineTransformation), but now I’ve decided why.

  • Anyone who uses a code-completing IDE should be able to type in any class or interface name and get at least a hint about it’s type. This is particularly relevant to Java, which appears to be a “tools-required language” by design with its verbose but easy-to-parse style.
  • Anyone who uses a “man’s man” editor like vim/emacs/editplus should at least have access to some basic text-searching utilities. Something like `grep 'class TheClassName' path/to/repo -R` or (in PHP-land) surfing to http://php.net/functionname is typically sufficient.
  • Most code I’ve come across in dynamically-typed languages like PHP or Python doesn’t require a distinction between “implementing an interface” and “extending an implementation”. I know PHP allows the abstract class keyword, and I can’t really say that I like it.

So who really wants to see the C or I in front of their class/interface name? I dunno, but it’s not me. I don’t buy the argument of “it makes code more self-evident/documenting”, because jumping to a definition and seeing

interface AffineTransformation ...
class RotationMatrix ...

is just as readable (moreso I think because of the conciseness) as

interface IAffineTransformation ...
class CRotationMatrix ...

I think I would shoot myself in the face if I had to program with CRotationMatrixAffineTransformation.

Module Names

Module names are another gotcha that I don’t like. Now, I’m not a regular Java programmer, so tell me if there’s some awesome reason that I’m overlooking.

I’m currently working on some Lucene and Nutch code. They are (respectively) defined in modules org.apache.lucene and org.apache.nutch, and when I play in an 80-character-wide ssh account, the pathnames tend to wrap around my screen unless I start symlinking everything.

It’s all nice and great to know that my particular version of Lucene came from org.apache and not com.ibm, but I think I’d much rather just use the module lucene without organizational domains getting involved.

  • If a codebase is transferred between organizations, they eather have to deal with the headache of renaming everything and breaking backwards-compatibility, or keeping names as-is and just knowing that the “current controlling organization” is wrong. What if I downloaded something from Apache’s website that still referenced com.ibm modules (maybe originally developed by IBM and then donated). The license is in a big JavaDoc at the top of every page, I don’t need to see it referenced everytime I need to import a module.
  • it adds unnecessary levels. Am I really worried about multiple groups creating lucene modules and having to deal with both of them? Not really, because of the concept of trademarks. If I create a software product called Vista, you can bet Microsoft will have something to say about it. It doesn’t matter if I’m com.wordpress.tombarta.vista (which is bad anyways, because I could change hosts anytime) or just vista. If I use the same name as some other product, people will be confused, and organizational namespaces won’t do a hoot about that.

Ok, I’ve bashed Java enough tonight. I really should find more languages to dislike, or more good things about the Java language. I don’t necessarily want Java to change… I just want other things to replace it. Like some ultra-sweet combination of Python and C++.

Edit: I’ve tagged this in Usability because I certainly consider a programming language to be a user interface the same way I consider a software developer to be a digital content creator.