Archive for March 2003

 
 

Faster Map

Interesting. Judy is an implementation of a map that’s way faster than hash tables, red-black trees or any other popular map implementation. A quick overview of where it gets its speed can be found here.

[Via the most excellent sweetcode.]

BeOS

I’ve been hearing for the last few years how BeOS has an amazingly responsive GUI because of the way it is written. You almost never wait for the GUI to respond like you do under Windows or OS X.

That seemed too good to be true; something was obviously missing from the picture. Finally, after reading this article on OS News I understood the BeOS thing: it’s not fast, it simply has a largely asynchronous API. This provides a good GUI experience but is a pain in the ass to program.

At least with traditional programming languages. But say you used a language based on the join calculus like the Polyphonic C#… Hm…

Photoshop fun

What if the US Loses? Hilarious.

Business

Business 2.0, 101 Dumbest Moments in Business, #11:

In December, German real estate tycoon Rolf Eden, 72, announces that he is willing to pay €125,000 to any woman who can kill him through sexual intercourse, saying he plans to fly interested women to his home in Berlin for a trial run. “I don’t care why they make love to me,” Eden says, “as long as I have my fun.”

C# Warnings

The thing that sucks about the C# compiler built into VS .NET is that it doesn’t let me disable warnings in specific sections of the code.

Here’s a typical case: I have an interface that declares an event:

interface SomeInterface {
    event SomeType EventName;
    ...
}

Then I have a class that implements that interface, but never fires that specific event:

class SomeClass : SomeInterface {
    public event SomeType EventName;
    ...
}

The compiler always complains that the variable EventName is unused, and I have no way to turn that off. I have accumulated a number of these and now checking compilation results is a pain instead of being a simple case of checking whether there is “0 errors, 0 warnings”.

VB.NET Bugs

Kevin Wilson has a rather nice collection of VB.NET problems and bugs here.

Dynamic Typing

I’m a big fan of static typing. In any programming language with generics, static typing generally does not take away any of the flexibility yet it provides one with the ability to catch many errors at compile time.

However, languages with dynamic typing only can be more productive when types depend on the outside environment.

Take database access as an example. To read a field from a record in a dynamically typed language, one would execute:

r = getRecord ();
s = r.name;

In a statically typed language this would be written as:

Record r = getRecord ();
String s = (String)r.GetField ("name");

Using the type Record in a statically typed language is a pain in the ass because the compiler does not know either the names or the types of the fields, so not only do you have to specify field names as uncheckable strings but also you must supply the types through casts which can also be wrong. Static typing in this case gives you an additional headache without any of the benefits.

In the case of databases, however, the problem can be solved by creating tools that extract types from the database schema and build specialized records. This works nicely most of the time but you still have to do the casts when doing dynamic queries.

The situation is even worse when parsing XML DOMs. In reality most XML schemas are created only after most of the code is written. No schema, no tools. So while a programmer using a dynamically typed language may have the pleasure of writing:

node = tree.msft
pe = node.price / node.earnings

the poor soul using a statically typed language will have to type:

XmlNode node = tree.GetNode ("msft");
double pe = node.GetNode ("price).GetValueAsDouble () / node.GetNode ("earnings").GetValueAsDouble ();

A stark difference indeed.

Linux

Linux is not yet ready for the desktop, but I’m pretty sure that in a couple of years it will be good enough to satisfy most users. As someone who develops mostly desktop commercial off-the-shelf (COTS) apps, I have conflicting emotions about this.

On one hand I love the fact that there is going to be competition in the x86 desktop OS arena, and I love the fact that Linux will, by being $100 cheaper than Windows, lower the total cost of owning my software.

On the other hand, the Linux community is not used to paying for software. Commercial software under Linux sells poorly even when there is no comparable free software. This gives me the jitters. Of course the markets will correct this in the long run, but I don’t want to not program for ten or fifteen years until the collective madness passes.

Ouch (2)

IIS 6.0 has kernel mode processes. This is beyond stupid. It’s idiotic.

Now when IIS crashes, your whole machine will BSOD. When someone finds an exploit, it will run in kernel mode instead of as a user with least required privileges.

MS will try to convince us that things are not that bad, but I remember the blue screens I’ve had when they moved GDI into the kernel in 4.0.

Ouch

Assemblies that mix managed and unmanaged code can deadlock on startup. I’ve added this problem to the .NET Bug Registry.