Meanwhile, in other programming languages

Java: (new URL("http://foo.com")).equals(new URL("http://bar.foo.com")) returns true if they both resolve to the same IP. Not only does that plainly suck, the effects are that a) equality of two URL objects - two names, as it were - is dependent on whether or not you are connected to the Internet, and b) checking an object’s intrinsic identity and comparing it against another’s requires DNS server access. I have no words.

C#: Extensions are like Objective-C categories but different. This is funny because I thought categories would never come to C#. The ‘non-hacking’ use of categories has always been to split up a class definition into several distinct modules, and this was introduced more rigidly in C# 2.0 with partial, which is only allowed for the class within the same namespace in the same assembly (generated binary or general project grouping).

Comments [+]

  1. In Java’s defense, they provide both the URI class, which is intended as a purely syntactic structure, and the URL class, which is fundamentally for both syntax and network operations. Offering both types of objects seems reasonable enough.

    By david glasser · 2007.01.31 23:25

  2. Even if the URL class is for network operations, foo.com does not equal bar.foo.com! When it comes to network operations, I find it reasonable that a URL does only equal another URL if the same bits will be sent over the wire.

    (Of course, what bits do get sent over the wire are highly dependent on the application, but it proves that the problem is hard, not that the solution that the URL class provides is at all good.)

    By Jesper · 2007.02.01 12:56

Leave a comment

Your e-mail address is never shown. If you type a line break in the comment, it will show up as a line break (naturally). The following HTML is allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(required)

(required)


Please note: Your comment will not show up at once. Unless you're spamming or being abusive, you have nothing to worry about. (Read the full policy.)