Funny

September 10th, 2004

I try not to link to everything that comes through the Oddly Enough feed, but this was just too funny to resist. Have Sex Until The Cows Come Home

Source: Reuters.

Time Tracking Tools

September 10th, 2004

We’ve acquired a new engineering manager at work so at long last we’re starting to put in place some of the things we’ve always said “we should do that” about for a long time but never actually gotten around to doing. One of those things is establishing how accurate our estimates are by actually tracking the time taken to complete the task. Other metrics may be useful later, but for now we just want to track time taken since time is our most limited resource.

The trouble is, I don’t know of any really good time tracking tools. Here’s the rough requirements:

  • Must keep track of time taken on multiple jobs, some or all of which may be in progress at the same time.
  • Must have some way of mapping the job back to it’s original assigned ID (probably a bugzilla number but could be a netsuite number, scarab issue or who knows what - we haven’t sorted out how to track tasks well yet).
  • Preferably runs on OS X and Windows, OS X only is okay, Windows only is bearable, Solaris only is usable but not ideal - anything else only isn’t any use at all.
  • Preferably provides a very simple way to start and stop the timer for a task. I get interrupted a lot during the day so it would be good to be able to “hit the pause button” with a simple keystroke, ideally without having to bring the app to the foreground first.
  • Needs to export to a format that can be manipulated. XML would be great, CSV is also good, funky proprietary text based thing that I’ve got to parse is okay, funky proprietary binary based thing is no good.

I’m thinking this is probably something I’ll wind up writing myself so that it works just the way I want so having the source code available would probably be a benefit as well. That way I can tweak instead of write from scratch.

So, any suggestions? What do other people use to track development metrics?

String Interning (Redux)

September 10th, 2004

A long time ago I made some comments about String interning and Anton Tagunov made some interesting comments. It turns out he was very much right and that I was smoking something…. There are definitely still times when string interning will improve performance, even in multithreaded situations (XML parsing turns out to be one) but my comments on threading and synchronization should probably be ignored unless you’ve got the mythical hardware I had in mind when talking about it.

Essentially, to achieve what I was talking about you need to be able to add a map entry (not create the entry, just add it) as an atomic operation. You would have to be able to replace the existing map with a new one as an atomic operation as well (don’t add the new entry until the expanded map is in place), however with multi cpu systems, such assignments are likely to wind up in a single processors cache and not be available to other processors. You’d need the ability to tell the processor to put this straight into RAM (reads could still come from cache but the main memory version would have to be checked in a synchronized block before creating a new entry).

In Java it is definitely not possible to tell the CPU to put just one variable directly into main memory and I haven’t found any reference to this algorithm even theoretically working on any common computer system.

Shame, it seems like such a good way to do it…. Good sounding design trumps working design right?

On Ampersands And Standards

September 10th, 2004

Byron commented on ampersand redux:

Yes, an ampersand is valid as part of an attribute value (as represented in an HTML document) where that ampersand is part of an entity reference. An ampersand that is not part of an entity reference is not valid in an attribute value, in an HTML document.

Serialization has nothing to do with it, since an HTML document is not the serialization of a DOM tree, although it can be viewed as such. I did not mean to say anything about serializing attribute values, I meant to say that an attribute value in an HTML document cannot legally have an ampersand that is not part of an entity reference.

If your document does have such an ampersand, it will not validate. It might work in current browsers, but down the road it might not. Don’t do it. If a browser gets it wrong, file a bug against the browser or avoid ampersands entirely, don’t force every other author of HTML parsers to work around your markup’s faults.

I still disagree with the first part - ampersands are perfectly valid in HTML comments but when serialized they must be escaped as entities. It is critical to consider entities as equivalent to the character they represent, otherwise é wouldn’t be the same as é which is clearly ludicrous. Regardless, the point is entirely academic so I’ll leave it at that.

The last part however is crazy. If a browser has a bug and you need to support that browser, you should do whatever it takes to make your application work with that browser - standards be damned. It is in no way acceptable for a software developer to skip requirements just because it would mean conflicting with a standard. If adhering to the standard was also a requirement then the higher priority requirement should wind up being implemented and the other one revised to not be in conflict.

If you can get the browser vendor to fix the issue and you consider it acceptable to make all your clients upgrade to the fixed version then by all means follow the standard - otherwise through it out. Standards are designed to enhance interoperability, if they reduce interoperability in areas that are important to your project they are completely worthless and should be ignored.

The comment about forcing every other HTML parser to work around the markup problems is a red herring as well - HTML parsers already have to deal with that kind of thing and that’s not going to change. XML parsers on the other hand do not have to handle invalid mark up and most don’t which is precisely why I pointed out that you should always escape ampersands correctly in XHTML despite the fact that most if not all browsers will get it right either way.

Software development is about achieving the project’s requirements. It’s not about politics, it’s not about standards and it’s not about making yourself feel good. If you can meet your requirements and do any of that, then great, but the requirements are the only thing that have to be achieved and they override anything else. That said, any of those things could be made a requirement of the project, but it’s quite rare that they would actually be requirements let alone high priority ones.