random WTF
Mood: amused
Posted on 2007-12-05 17:50:00
Tags: programming links
Words: 51

I don't usually post stuff like this, but this is possibly the best programming WTF ever. Add() reallocates memory each time (although I guess maybe the C# Array class does the doubling thing for you?), and Remove()...ow, my eyes! O(n^2) FTW.

The explanation at the end, of course, seals the deal.


3 comments

Comment from djedi:
2007-12-06T09:46:14+00:00

omg.

Comment from brittongregory:
2007-12-06T13:13:07+00:00

See, I was almost sympathetic with James -- it's a pretty naive class, but I tend to be naive until I know I need to work on performance -- until the explanation. Then I lost hope. ;)

Comment from othersider:
2007-12-09T07:25:30+00:00

Wow. I am at a loss for words. Where do you even begin with this guy?

This backup was done by LJBackup.