Apr 28

Well, I updated the ol’ résumé. In raw XHTML+CSS, naturally. Printed it to PDF. Now to see if I can get to sleep. My shoulders are tense and my stomach keeps knotting up.

What I need is a relaxing weekend. Maybe a large amount of driving across Texas will keep my mind off things.

Apr 28

Things are beginning to settle down. The house is gradually turning from a box storage warehouse into a home, and a semblance of normal life is returning. Finances are depleted, but that’s only to be expected.

Still, what better time for life to give me a swift kick in the nether regions, huh? So yes, I’ve just been told that it would be a good idea to update my résumé…

Apr 27

Trying to decide whether to make a day trip to Dallas on Saturday. I’ve always kinda wanted to go see Dealey Plaza and the grassy knoll, but I expect it’s something of a disappointment in real life.

Apr 27

Imagine: You’re a Republican party chairman at a taxpayer-funded ‘Town Hall’ meeting with the President. You notice that some of the people attending have a politically incorrect “No Blood For Oil” bumper sticker on their car. What do you do?

Answer: Since it’s an official event, you can’t legally have them thrown out–so you have someone pretend to be a member of the Secret Service and tell them to leave. Then, of course, you claim to know nothing about what just happened.

Apr 22
  • Many common tasks take an absurd amount of code. For example, try producing a date in RFC2822 format, in the local time zone. Isn’t Java supposed to be a good language for Internet programming?

  • What’s with the special types that aren’t objects, like int? I just want to have integers, and leave the compiler to determine the appropriate implementation. In the worst case, I don’t mind specifying how wide I want my integers in advance, but please, can we have them act like proper objects (i.e. everything else)?

    I mean, it’s not like anyone is going to be using Java for systems programming, and need access to raw machine words, especially since there are no unsigned integer types available. (Bytes are signed?!)

    In Java 1.5 they try to make it less ugly by having the compiler automatically wrap primitive types in object wrappers when necessary. Which is still ugly.

  • Why must arrays be unlike every other type? For instance, array objects use variable.size() to find out their upper bounds, but arrays use variable.length. They’re not like the other special types either, because they can’t be converted.

  • Clearly very little thought has been put into doing things right the first time. That makes for a horribly bloated and messy API. So we have arrays, Array objects, ArrayList objects, and Vector objects, all solving the same problem in subtly different and incompatible ways. Ditto Hashtable and HashMap.

  • No integer overflow detection. For a language designed to be safe that forces me to pick a size of integer in advance, that’s pretty stupid.

  • The class library is riddled with little inconsistencies that make it difficult to remember how to use everyday objects. For instance, “HashMap” is camel-cased, but “Hashtable” isn’t–and of course, fussy Java will complain if you capitalize even slightly differently.

  • No abstract local functions. I happen to find map operations very useful at times.

  • Some arguments are passed by value, some are passed by reference; it depends on their type.

  • Similarly, the types that would be passed by value are copied during assignments, the types passed by reference are not. Hence, assuming you remember something has been passed in by reference and want to copy it, you specifically have to clone() it to make a copy–and if it’s in an array, you have to clone the dimensions of the array manually.

  • Comparing pass-by-reference variables checks if they’re references to the same thing, rather than checking if they’re the same value. To check if they’re the same value, you have to remember that they’re ’special’ and that you have to use .equals() instead of ==. Except it doesn’t work on arrays. D’ohh!

  • Constructors have their own special unique syntax. The compiler spots immediately if I don’t use the special syntax, therefore it clearly knows that the method is the constructor anyway, therefore it’s just arbitrarily making me jump through hoops for it.

  • Importing packages doesn’t import dependencies. For instance, org.xml.sax.XMLReader is no use without org.xml.sax.helpers.XMLReaderFactory, so why make me import them separately?

  • There’s no way to break string literals across lines, so you have to concatenate them at run time.

  • Some of the documentation is really awful. I mean, does anyone understand RuleBasedCollator? Quote: “& Indicates that the next rule follows the position to where the reset text-argument would be sorted”. Is that even English?

    There’s also an unfortunate tendency for people to assume that JavaDoc is documentation. Often, it’s more like an adventure game, where you click around in a maze of twisty turny JavaDoc pages for hundreds of classes, hoping that at some point you’ll find some documentation that actually tells you how to perform some task you need to perform, rather than just telling you what lots of random methods do.

  • Startup times are abysmal.

  • Exceptions are a pain. The ability to throw and catch exceptions is a good thing in any language; the problem with Java is the insistence that every exception be explicitly dealt with or thrown up the chain.

    In J2EE code, for example, we have the SQLException. It either indicates a syntactic error in the SQL code, or that the connection to the database is broken. There’s really nothing the application can usefully do with SQLException except report an error and die; yet because of the explicit exception rules in Java, code ends up bloated with repeated catching and rethrowing of SQLExceptions.

    It’s not clear to me that forced exceptions do anything to make programmers deal with possible problems anyway; try running Azureus and watch how many stack traces it craps to the console. Good programmers don’t need to be force-fed exceptions, and bad programmers just catch and ignore the exceptions anyway.

    The other side of the problem: if you’re implementing an interface that doesn’t declare any exceptions, you have to eat any exceptions that occur, no matter how deadly.

    I’m not sure what the solution is, but with Java I get the feeling that the cure being tried is of marginal effectiveness, and possibly worse than the disease.

  • Generics were added too late. Now we’ve got a massive class library full of unnecessarily ugly APIs.

  • String and StringBuffer make straightforward string handling unnecessarily painful. You can split a string, but you can’t modify it. You can find a string within a StringBuffer, but only in case-sensitive fashion. You can’t search a StringBuffer for a regular expression; you have to convert it to a String first–but to modify what you find, you have to convert back to a StringBuffer again, or create a new String (and pay the cleanup costs).

    So in typical input parsing, you end up repeatedly converting between String and StringBuffer objects. Even assuming that’s what the compiler would have to do anyway, why should I be forced to do it all explicitly? And if “replace string” is only available for StringBuffer, how come “replace regexp” is available for String? The whole division between the two has long ceased to make any sense.

  • In Java, null is a primitive value. But, as mentioned above, primitives like ints aren’t objects, and so neither is null. Which, in turn, means you can’t use null for null objects (for example when making objects optional)–you need to clutter the API with more methods, create empty objects, or implement a null object class.

  • IO is ugly. To do the normal “buffered write to a file”, you have to create a FileWriter object, wrap it in a BufferedWriter object to add buffering, then wrap that in a PrintWriter object to get a stream you can print to. That is:

    PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(new File(filename))));

    And don’t forget to explicitly flush and close the PrintWriter, or you’ll lose data. So much for safety! Input is just as bad. Is it too much to ask that the 90% of cases (stream-based reading and writing of text) be optimized with some kind of 1-step BufferedPrintToFileFlushOnDispose class?

  • I find the use of “static” to indicate “class scope” unnecessarily confusing. To put it another way, I find it hard to remember that “final” means “static” (unchanging) and “static” means “class”…

    Of course, the reason why “static” is used for class methods is that Java doesn’t really have class methods; static methods are static in the sense that they’re really global functions that can’t be overridden and are shared between all objects of that class. Perhaps the word “shared” would have been less confusing?

  • The insistance on a separate file for each class fragments the source code and makes it harder to keep track of where things are–or alternately, encourages the “one huge class” antipattern. The insistence on making the directory structure match the package naming adds the annoyance of having to navigate in and out of directories multiple layers deep even for a trivial project.

Things I really like about Java

  • Unicode everywhere, no special effort required.
  • It’s pretty much portable between Linux and OS X, without having to worry about contortions like autoconf.

I don’t include automatic memory management in the list, because that ought to be a given for any modern programming language.

I should also point out that for all its faults, Java is still better than C++.

Apr 21

Someone with a new Nikon digital SLR took a bunch of photos of the Space Shuttle as it rolled out to the launch pad from the Vehicle Assembly Building.

Sheesh, that thing looks skanky, the right side looks like a model that someone’s spilt coffee on. Now I understand what they mean by “ageing shuttle fleet”. I’m not sure I’d want to fly in it.

There are more photos posted at keyhole.com, but what really jolted me awake there was the photo showing the Shuttle from space (third on that page). If that’s what civilian satellites can do, the NSA can probably spot whether your shoelaces are untied.

Apr 20

I got my desk today. I’m starting to hate ready-to-assemble furniture, but really, who can afford any other kind? Plus, my desk is from Anthro, who are the Rolls-Royce of RTA.

I think the first time I saw an Anthro desk was in MacWorld Expo Boston back in 1997. It was a split-surface desk, with the Mac on the back surface, slightly higher than the front keyboard and mouse area. The guy demonstrating the desk pulled a small lever under the front surface, and lifted it higher with one hand. He started to show me the tilt control too, but I was already convinced.

The desk surfaces are extra-thick particleboard with the an industrial-grade wipe-clean coating. The legs are wide steel tubes, and the other metal parts are laser-cut steel. The carts move on rubber-wheeled castors, so as not to scratch the floor–no corner-cutting here. Their primary market seems to be the world of big business, where things like radiology workstations and industrial benches are expected to be able to stand up to years of abuse. The Anthro people like to demonstrate the strength of the furniture by having three people stand on a small computer cart without breaking it. Everything is made in Oregon, shipped in recyclable brown cardboard with all the necessary tools, and has a lifetime warranty. There’s just one snag: it’s kinda expensive.

I know that in business $800 for a desk is not a big deal, but it’s still about 4× what I’m used to paying. That’s for the smallest Adjusta cart; to be fair, the entry level cart without the fancy height adjust lever comes in at $300. But I really wanted that lever.

And then, a miracle happened. I’d been watching the special offers at the Anthro web site for a few weeks, when they announced an April Fool’s Day Special: 35% off almost anything.

So I’m writing this to say: if you’ve always lusted after a really ergonomic desk, go order an Anthro now before the prices go back up on the 30th.

Then when your credit card has recovered, you can order the extras–like the CPU rack and the industrial-grade coffee cup holder.

Apr 20

I have just discovered the following nugget:

  1. Go to Google Maps
  2. Search for A smirking chimp in Washington DC
  3. Marvel at Google’s search technology.

Another good one is to search for Communists in Boston.

You read it here first.

Apr 19

Bruce Schneier is launching a new symbol to represent concern for the rights of the individual. Spread the meme.

Apr 13

The NYT has coined the term “man date” for when two heterosexual men nervously spend time together without the excuse of business or sports. It all sounds rather like something from King of the Hill:

Depending on the activity and on the two men involved, an undercurrent of homoeroticism that may be present determines what feels comfortable or not on a man date, as Mr. Speiser and Mr. Putman discovered in their squeamishness at the Modern.

[...]

The concern about being perceived as gay is one of the major complications of socializing one on one, many straight men acknowledge. That is what Mr. Speiser, now a graduate student at the University of Virginia, recalled about another man date he set up at a highly praised Italian restaurant in a strip mall in Charlottesville. It seemed a comfortable choice to meet his roommate, Thomas Kim, a lawyer, but no sooner had they walked in than they were confronted by cello music, amber lights, white tablecloths and a wine list.

The two exchanged a look. “It was funny,” Mr. Speiser said. “We just knew we couldn’t do it.” Within minutes they were eating fried chicken at a “down and dirty” place down the road.

Mr. Kim, 28, who is now married, was flustered in part because he saw someone he knew at the Italian restaurant. “I was kind of worried that word might get out,” he said. “This is weird, and now there is a witness maybe.”

The article also talks about how a man can never pay for another man’s meal. Has anyone experienced this bizarre response outside the USA? It hasn’t been part of my experience…