- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
Hey, bubble sort has 2 big things going for it: 1) it's easy to write and 2) it works.
Admin
Many programmers are afflicted with an irrationally overinflated sense of their ability to write bug-free code and their ability to see bugs in their own code. "Sure, I tested it" means "I ran it once, with optimal input, and it didn't barf on my shoes."
Admin
Um, have you looked at the stories, they both my the same author.
TDWTF regularly reposts stories from there too, normally there's a disclaimer saying this though.
Admin
Err, okay...
Now, what about the game? Did the two guys meet up and develop a game? Was one guy named Brad McQuaid?
I'm missing a ref somewhere...
Admin
FYI, one would hope the guy has eventually discovered HTML::Parser's ignore_elements(), ignore_tags(), and report_tags() methods. These methods lower overhead by reducing the number of callbacks HTML::Parser has to make.
Admin
I actually prefer not having to trawl through 800 "fists" and "Captcha: retard" to read the 2 or 3 posts worth reading...
Admin
No. No. No....
HyperWord Displayer
Admin
Admin
Admin
Hmmm, I do like the featured comments. When I don't have much time to read the whole of the forum, it gives me some of the joy and none of the pain I get when reading the whole forum thread.
Admin
That's easy enough in C, too:
tr -d '\n' file.c > oneliner.c
Just don't use '//' comments.
Admin
I'm not an expert in pirate talk, but I think /wench/ is an adjective used to describe a fetching lass, and /hag/ is used for the ugly ones.
edit: closed UBB tag
Admin
Addendum (2008-02-19 21:07):
Oops, sorry, beat me to it... (By quite a long way.)Admin
So pleeeeasse tell more about the game story! It sounded potentially more fun than the submitted article.
Admin
(1) mod-perl. (2) if at first, you don't get under 200ms ... (3) a combination of C and Perl is not untypical for telecoms companies. This is, perhaps unfortunately, a marketing decision, because it "just looks good" when you're selling big fat tubes to people who want to see a Web front end. It's crap, but it works for the first generation of hardware (200 users to a box). It's still crap, but it works for the second generation of hardware (2000 users to a box).
It's still crap for the third generation of hardware .. and I think you can guess the number I'm going to come up with, here.
Unfortunately, you are now stuck with it.
Luckily, the C/Perl interface (assuming you use that goddamn awful XS stuff) is blazingly fast.
It does, however, slow down a bit when you deal with yer actual Perl, and HTTP templating, and database access, and what-not.
Admin
Admin
I see a few micro wtfs like a ludite hiring a tech guy ("damn hippies!!!" - Cartman) and a guy who wastes paid time to try theoretical expiriments, but no true WTF.
Learing practical wisdom that can't be taught in class is essential to real world experience as an innexperienced programmer. As a second year professional, I've learned more than I could imagine from experience and am gratefull that my bosses understand my missteps and grant me the chance to learn from them
Reinventing the wheel is also not so bad in the right cases. I've spent time reimplementing everything I can think of from regex tokenizers based on automota theory to parser generators to software based scan-line conversion renderers even though there are better options available. I consider it both fun and a learning experience but don't waste my employer's time with these endevours.
In all I think that this is less of a traditional "WTF" but ripe ground for exploration. More content is always better as long as we can learn from it. Coding Horror has often been criticized for failing to deliver WTF style comedy but I vigorously defend Coding Horror because I feel better informed by reading it. Truly WTF worthy real life stories are finite so why not supplement them with additional content from which we can learn?
Admin
The tale of the wannabe game programmers sure brought back memories...
Aah, good times.
Admin
I think Pyro left out a part of the sentence. As I learned it, it is more like "You have to rewrite it in assembler, and you have to be smarter than the hundreds of code optimization specialists that have been working on the compiler for the last 3 decades", or something to that effect.
Admin
Lazy programmers are good programmers; if you are too lazy to re-invent the wheel, you'll scout around and steal someone else's version. If you are too lazy to do testing over and again, you'll automate it. If the users are asking for something flashy but pointless, you'll push back on the scope. These are all laudable, no?
Admin
OK, I'll bite: I haven't.
Regardless of what most think, some of us actually read forums, subscribe to mailing lists, communicate with other experienced colleagues, and actually do some homework before starting to code.
The mark of a great tradesman is not only skill, but understanding his tools and knowing how to use them.
-dZ.
Admin
The long version goes like this: If you're trying to make a car, a home-made stone wheel isn't going to cut it, and there are millions of perfectly good wheels you could buy. If, on the other hand, you're making an F1 car, the only pre-made wheels you can buy will melt at the speeds you need to run. You need to make your own ("reinvent it" if you will). Of course, you have to have the skills and know-how (or can find someone who does), or it will all end in disaster.
Admin
Yup, reminds me of the game (and I use that term loosely) I built in BASIC in 6th grade. All was going well until I noticed that I was copy-pasting code. Hang on I thought to myself, there has got to be a way to use the same code in several places. I needed functions even thought at the time I hadn't even heard of the concept. In the end I had to make do with GOTO statements. Ended up with some godawful spagghetti code of course, but dammit, it worked.
Admin
I tried that in the 90s with the first "Fighting Fantasy" book. In QBASIC. I started with the inventory and fighting stuff, put in the first section, the "intro", which had more than a screen's worth of text, and the pages the first choices led to. I gave up early on because all the first choices led to really wordy bits, and I didn't have the attention span for that much typing. But I had a functional game working in fairly short order, even though you could only play it for a couple of choices before it ended.
I now write xbox360 games.
Admin
Admin
If you're writing a sort, you're either a) doing something very fancy, or b) doing something very stupid. Round here, we know exactly which is more likely...
Admin
Ah the memories of QBASIC on an 8086 with 640k ram...
I must admit that I also did some horrible spaghetti code when i did my own version of PacMan etc..
But I did learn something, especially to appreciate the concept of functions accepting arguments and returning values with the internal function variables invisible to the rest..... Damn i missed that at that time although i didn't know it existed (was 12 Years old)
Yazeran
Plan: To go to Mars one day with a hammer.
Admin
The WTF here is probably that someone saw a need to parse HTML in the first place. That usually means some bad decision has already been made further up the pipeline ;-)
Admin
Yay for open-source stuff?
Admin
Admin
It's just Peter's Law in action - if he's good at minor projects, we'll promote him to big projects (without any support or training). I find it's worse when you pass management's understanding (since everything they don't understand must be simple, yes?)
Admin
...
Then you are not a good tradesman.
A good tradesman - as opposed to a well-read tradesman - has done it, and noticed it and regretted it.
A good tradesman has also read the available material until the cows came home, communicated with colleagues and done their homework. But the difference between a good tradesman and the mediocre tradesman is that the good tradesman has also made cock-ups that he's both learnt from and that other tradesmen ask him about. A good tradesman may occasionally write about those mistakes so that other tradesman can learn from him. A good tradesman may write to mailing lists so other tradesmen can read about the mistakes that good tradesmen make.
But, most importantly, a good tradesman does not think that he has never made elementary mistakes.
You have simply shown that you are a well-read tradesman. Not that you are a good one.
Admin
Really? You can't imagine any circumstance whatsoever where the bubble-sort is the most appropriate algorithm? Think harder.
Which is what? Can you name the one Sort Algorithm To Rule Them All? I sincerely hope you do not really think that there is such a thing as "the best algorithm available"!
Admin
Even assuming the need to do so, and the resources available, I think it's reasonable to use short-hand like "the best algorithm available."
In an infinitessimaly small sub-set of cases, that would be bubble-sort. It's a bit of a shame that Ornedan didn't add "given the requirements."
Happy now?
Admin
Speaking of Final Fantasy 7, the PC version has some nice gems. For example, it closes its registry key handles twice for good measure. Also, Eidos encoded the movies with the wrong codec, and modern Windows systems sometimes play them upside down as a result. (Microsoft had to add an appcompat fix for that one.)
Then there's a nice uninitialized pointer in .data that works on Win9x because there happens to be memory at a fixed offset from 0 - and there isn't in NT.
Admin
As both the article submitter and fool/programmer subject of said article, I wanted to add a couple quick things.
First, that luddite founder is my brother :) So of course he has an inordinately high opinion of me. But the original product was a work-for-hire -- he was a manager for a company, I came on under him to develop the product for his division, and later we got the company to sign the rights back to the two of us (they were not a software company and had no interest in becoming one) and spun that off into a startup company. It's not like those stories of hiring "senior programmers" off the street who can't even handle basic interview questions -- we had a track record together, along with a proven product.
Second, this story is from about 10 years ago, less than 2 years after forming the spinoff company and about 4 years after starting overall development. I did eventually earn that "Senior Programmer" title.
Last, the main loop didn't have "no code" in it. What it did have was a bunch of early loop exits, and one of the first ones had a typo that caused it to always return true. So it was regex matching but not actually doing anything inside the match loop. Of course, I'm still a complete retard for never actually looking at the output. But that's what happens when you're young and more excited about showing off your improvements.
The product doesn't parse HTML anymore. At this point, I honestly can't even remember why we were doing it. Probably an end-user request, something we took on a lot of in those days. At that stage of a startup, you don't get too selective about those things -- if a customer says, "we want feature X, here's a check for $100K, bend over", you respond "how far". Dealing with second-system effect is better than having no system and no job.
Admin
"HyperParser? 0.2 seconds...doing absolutely nothing. By that standard, his code was efficient,..."
0.2 seconds to do nothing!? That's not efficient!
Admin
I wanted to hear about the failed videogame.
Admin
Actually, I know a guy who wrote his own HTML parser, because he didn't like the existing ones, as well as many other things. And he actually got better performance, because he is very smart and also excellent programmer (he also wrote some code for the Linux kernel and was a PCI subsystem maintainer).
The project he used it in is at http://www.ucw.cz/holmes/.
So, in exceptional cases such as this, people are not foolish to use their own stuff.
Admin
Yup, that's smart.
Admin
Heh, I tried to code that kind of book too. I got halfway through until I got bored, but I did get battling and inventory-keeping done. Needless to say, it still looked awful and not fun to be played at all...
Admin
Maybe sometime in your future, after your extensive two years of experience, you'll some day get to work on something cool and not the derivitive shit it sounds like you've had to spend your work hours doing.
The good news is that it's fun and you'll get paid nicely.
The bad news is that you'll probably find yourself rather constantly "wasting paid time to try theoretical expiriments." :)
Good for you for taking personal time to do that in the mean time.