• TInkerghost (unregistered) in reply to KattMan
    KattMan:
    bramster:
    At 10 bucks/hour, you get the title "Senior Developer".

    At 20 bucks/hour, you're only a "programmer".

    Do you want the raise, or do you want the title?

    At 5 bucks/hour you work in a dimly lit bar with wenches dressed in pirate clothes.

    How bad do you want the money?

    How good looking are the wenches?

  • secretagentman (unregistered) in reply to balls
    balls:
    Yeah, WTF.

    Lesson: don't ever take risks and don't try to learn anything new.

    If people didn't try to reinvent the wheel, we'd still be stuck using bubble sort :)

    Hey, bubble sort has 2 big things going for it: 1) it's easy to write and 2) it works.

  • (cs) in reply to Dan
    Dan:
    I'm sorry, but I just don't believe that even the most junior programmer can possibly get to the stage of demo-ing code without realising that it doesn't work. And not in the way of 'has a few bugs that need looking at' doesn't work, or even 'has a major bug that makes it spaz out' doesn't work, but in the way of 'doesn't do anything' doesn't work.

    TRWTF is that he tried to show it off before he checked whether it worked.

    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."

  • (cs) in reply to mimimo
    mimimo:
    I saw this one before. Here we go: http://reddevnews.com/devscope/article.aspx?editorialsid=919.

    Are we stealing stories now?

    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.

  • NXavier (unregistered)

    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...

  • dsevil (unregistered)

    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.

  • Jon (unregistered) in reply to Zylon

    I actually prefer not having to trawl through 800 "fists" and "Captcha: retard" to read the 2 or 3 posts worth reading...

  • (cs) in reply to Stupidumb
    Stupidumb:
    As for what the Featured Comments system is for, it's: A System for Featuring Comments. They probably should have thought of a better name like "Nitro Word Displayer".

    No. No. No....

    HyperWord Displayer

  • Ken B (unregistered) in reply to If you have to explain it...
    If you have to explain it...:
    Oh come on, who here at one time or another hasn't gotten 1000 lines into writing some brillant idea only to realize that there's another way to do it in only 30 LOC?
    Write it in APL. That way, it'll only take 1 line.
  • sf (unregistered) in reply to brazzy
    brazzy:
    sf:
    Perhaps another WTF is that the empty implementation he had STILL took 200ms to run.
    Not really. Interpreted language, remember? As startup time for an interpreter and loading all the necessary libraries, 200ms is impressively short.
    If that's the case (i.e. counting interpreter setup time, etc.) then it wasn't a very good comparison to the C implementation. Different WTF.
  • (cs) in reply to Zylon

    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.

  • (cs) in reply to Ken B
    Ken B:
    If you have to explain it...:
    Oh come on, who here at one time or another hasn't gotten 1000 lines into writing some brillant idea only to realize that there's another way to do it in only 30 LOC?
    Write it in APL. That way, it'll only take 1 line.

    That's easy enough in C, too:

    tr -d '\n' file.c > oneliner.c

    Just don't use '//' comments.

  • (cs) in reply to TInkerghost
    TInkerghost:
    How good looking are the wenches?

    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

  • (cs) in reply to Grovesy
    Grovesy:
    blatant ripoff:
    I've come to notice a trend on TDWTF...
    1. An article, or "comic", gets posted.
    2. People write bad things in the comments, complaining about the article or "comic".
    3. The impression is given that people are not happy with the article or "comic".

    My solution...

    1. Don't post any articles or "comics".
    2. No bad things are written.
    3. Everyone is "happy".

    Brillant.

    Another solution.

    Main Flow: 1.) An article, or "comic", is posted. 2.) People like articles and/or comics 3.) They read the article / comic

    Alternate Flow, Occurs instead of step 2 1.) People don't like articles and / or comics 2.) They move on and read something else

    Everyone is happy!

    I see no underpants. Or, indeed, cake. I question your conclusion.

    Addendum (2008-02-19 21:07):

    KattMan:
    4. ... 5. PROFIT!
    Oops, sorry, beat me to it... (By quite a long way.)
  • Ajk (unregistered)

    So pleeeeasse tell more about the game story! It sounded potentially more fun than the submitted article.

  • (cs) in reply to brazzy
    brazzy:
    sf:
    Perhaps another WTF is that the empty implementation he had STILL took 200ms to run.
    Not really. Interpreted language, remember? As startup time for an interpreter and loading all the necessary libraries, 200ms is impressively short.
    Oh dear.

    (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.

  • stdio.h (unregistered) in reply to A Nonny Mouse
    A Nonny Mouse:
    blatant ripoff:
    I've come to notice a trend on TDWTF...

    ...snip...

    I think this article is a fine example of Perls before the (s)whine.

    fixed.

  • Jb (unregistered)

    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?

  • notme (unregistered)

    The tale of the wannabe game programmers sure brought back memories...

    Aah, good times.

  • boh (unregistered) in reply to OJ
    OJ:
    Pyro:
    If you'd like to optimize something written by someone who knows what he's doing in C you'd have to rewrite it in assembler, no less.

    Actually, where I work, a system written in Assembler was replaced with one written in C. The one written in C was considerably faster, even with lot of features that is not used in that product.

    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.

  • (cs)

    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?

  • (cs) in reply to If you have to explain it...
    If you have to explain it...:
    Oh come on, who here at one time or another hasn't gotten 1000 lines into writing some brillant idea only to realize that there's another way to do it in only 30 LOC?

    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.

  • (cs) in reply to DeLos
    DeLos:
    The lesson as usual. Don't re-invent the wheel.

    You know, unless it really needs to be done.

    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.

  • (cs) in reply to notme
    notme:
    The tale of the wannabe game programmers sure brought back memories...

    Aah, good times.

    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.

  • (cs) in reply to Pete
    Pete:
    More on the FFVII tangent than the actual article, but this reminds me of the time my brother decided to code one of those "Choose your own adventure" books.

    For whatever reason, he decided the most important part of the project was getting the book into the PC (this was early 80's, before cheap scanners and OCR), so he diligently started typing it out. All my questions of "How are you going to handle the fights?" and "How will you handle the inventory?" etc. fell on deaf ears. Needless to say, by the time he was done he'd lost all interest in actually making a game.

    I guess that's why he's a financial manager and earns twice my salary now.

    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.

  • (cs) in reply to secretagentman
    secretagentman:
    Hey, bubble sort has 2 big things going for it: 1) it's easy to write and 2) it works.
    It has other things too: It doesn't require any additional memory. It's cache friendly, always going forward through the dataset.
  • dkf (unregistered) in reply to secretagentman
    secretagentman:
    Hey, bubble sort has 2 big things going for it: 1) it's easy to write and 2) it works.
    On the other hand, it's slow and your language will have access to a library with a better sort (libc has qsort(), Java has java.util.Arrays.sort(), etc.)

    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...

  • Yazeran (unregistered) in reply to DOA
    DOA:
    notme:
    The tale of the wannabe game programmers sure brought back memories...

    Aah, good times.

    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.

    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.

  • T6r (unregistered)

    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 ;-)

  • Vadi (unregistered)

    Yay for open-source stuff?

  • Ornedan (unregistered) in reply to secretagentman
    secretagentman:
    balls:
    Yeah, WTF.

    Lesson: don't ever take risks and don't try to learn anything new.

    If people didn't try to reinvent the wheel, we'd still be stuck using bubble sort :)

    Hey, bubble sort has 2 big things going for it: 1) it's easy to write and 2) it works.

    2) applies to every sorting algorithm ever proven correct. 1) applies to many of those, including several O(n log n) sorts. I really don't get why anyone would ever advocate using bubble sort. If you ever need to implement a sort yourself, you might as well use the best algorithm available. And frankly, if you can't correctly implement a sort more complex than bubble, your code shouldn't be used for anything important anyway.

  • A Gould (unregistered) in reply to SomeCoder
    SomeCoder:
    While I generally agree with the comments here about this not being a WTF, the REAL WTF in my opinion is the fact that people like Stephen get hired and are lauded as geniuses while people who are actually talented get passed over.

    Seen it happen more than once.

    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?)

  • Armchair Dissident (unregistered) in reply to DZ-Jay
    DZ-Jay:
    If you have to explain it...:
    Oh come on, who here at one time or another hasn't gotten 1000 lines into writing some brillant idea only to realize that there's another way to do it in only 30 LOC?

    OK, I'll bite: I haven't.

    ...

    The mark of a great tradesman is not only skill, but understanding his tools and knowing how to use them.

    -dZ.

    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.

  • Armchair Dissident (unregistered) in reply to Ornedan
    Ornedan:
    I really don't get why anyone would ever advocate using bubble sort.

    Really? You can't imagine any circumstance whatsoever where the bubble-sort is the most appropriate algorithm? Think harder.

    If you ever need to implement a sort yourself, you might as well use the best algorithm available.

    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"!

  • (cs) in reply to Armchair Dissident
    Armchair Dissident:
    Ornedan:
    I really don't get why anyone would ever advocate using bubble sort.

    Really? You can't imagine any circumstance whatsoever where the bubble-sort is the most appropriate algorithm? Think harder.

    If you ever need to implement a sort yourself, you might as well use the best algorithm available.

    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"!

    Most problems since the 1950s do not normally involve sorting a set of n where n < 20. If I tried hard, I could imagine a hugely parallel system that could partition sub-sorts at that level and then recursively resort them using bubble-sort.

    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?

  • Myria (unregistered) in reply to realmerlyn

    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.

  • (cs)

    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.

  • :-X (unregistered)

    "HyperParser? 0.2 seconds...doing absolutely nothing. By that standard, his code was efficient,..."

    0.2 seconds to do nothing!? That's not efficient!

  • chyrus (unregistered)

    I wanted to hear about the failed videogame.

  • JS (unregistered) in reply to realmerlyn

    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.

  • (cs) in reply to JS
    JS:
    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.

    "I'm sorry, I don't like what God did with that rib I gave him. I think I'm gonna build myself a real woman."

    Yup, that's smart.

  • Joao Pedro Francese (unregistered) in reply to Pete
    Pete:
    More on the FFVII tangent than the actual article, but this reminds me of the time my brother decided to code one of those "Choose your own adventure" books.

    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...

  • hobbit (unregistered) in reply to Jb

    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.

Leave a comment on “Perls of Wisdom”

Log In or post as a guest

Replying to comment #:

« Return to Article