Representative Line - jQuery Search n' Replace

  • Me 2012-08-09 08:50
    I Agree
  • Average joy 2012-08-09 09:01
    you done do somethin to that website with dem their code thingies that done broke somethin. i can't read dem dere previous articles this week and when i do click on this one today it brings me to a different one.

    i done think this no happen if you was runnin on the cloud
  • Some Jerk 2012-08-09 09:03
    SECOND!

    Just playing :p.

    Looks like they are introducing a new aspect of coding we never considered.

    There is client side... server side... and DEVELOPER SIDE. Vastly inefficient to put too much processing on the DEVELOPER SIDE... it makes more sense to spend the exact same amount of time on the DEVELOPER SIDE forcing the client side to perform the operation.
  • Some Jerk 2012-08-09 09:04
    CURSE YOU JOY!
  • Some Jerk 2012-08-09 09:05
    Average joy:
    you done do somethin to that website with dem their code thingies that done broke somethin. i can't read dem dere previous articles this week and when i do click on this one today it brings me to a different one.

    i done think this no happen if you was runnin on the cloud


    OWWW! My brain hurts!
  • Some Jerk 2012-08-09 09:09
    Uhhh... dude? You done commented out half of one post, through a second and half of the next.

    Welcome to the HALL OF SHAME! Now you have to WTF your own site!

    Editor:It's fixed now. And c'mon- it's hardly the first time we've screwed up the markup in an article.
  • Average Joe 2012-08-09 09:16
    Some Jerk:
    Uhhh... dude? You done commented out half of one post, through a second and half of the next.

    Welcome to the HALL OF SHAME! Now you have to WTF your own site!


    I done used the links on ta top of that dere artical and it brung me round to those other articals just dandy
  • Some Jerk 2012-08-09 09:20
    If programmers were perfect... this site would not be very interesting.
  • Mike D. 2012-08-09 09:24
    So this doesn't just fix the case of "page is UTF-8 but IE* or something rendered it with a Windows charset, we can't get a proper charset set in the DOCTYPE or html tag for some stupid reason (autogenerated?), and doing it in JS defers it until after the charset error caused the problem"?

    Or maybe it's there because the people who wrote the pages never clean up their act, the coder got sick of manually fixing it, and for some stupid reason they won't let him automate the fix on the back end?

    ... Nah.
  • snoofle 2012-08-09 09:25
    Some Jerk:
    If programmers were perfect... this site would not be very interesting.
    www.TheDailyTheyDidItRightAgain-HoHum.com

    ...indeed.
  • DCRoss 2012-08-09 09:40
    snoofle:
    Some Jerk:
    If programmers were perfect... this site would not be very interesting.
    www.TheDailyTheyDidItRightAgain-HoHum.com

    ...indeed.


    http://www.thedailynasaprogrammers.com/ perhaps?
  • Jeremy 2012-08-09 09:52
    Ahh if only we all lived in a perfect world. I've had to do something very similar to this since the CMS we used is locked down by the company that manages it. My agency only has access to a small piece of the content and sometimes you have to fix things outside your normal control.

    Might not be the case for this bit of code, but the developer may have had some restrictions we didn't know about.
  • Remy Porter 2012-08-09 09:59
    All WTFs started off as a good idea based on some constraint we don't know about. Nobody sits down and goes, "What's the worst possible way to solve this problem?" and then does that.
  • red ira 2012-08-09 10:08
    Remy Porter:
    All WTFs started off as a good idea based on some constraint we don't know about. Nobody sits down and goes, "What's the worst possible way to solve this problem?" and then does that.

    Agreed, but sometimes the constraint is the arrogance or lazyness of the programmer.
  • Anketam 2012-08-09 10:12
    I am surprised that snoofle's most recent saga of the senior release manager did not get deemed the best of the sidebar.
  • Eric 2012-08-09 10:17
    Unfortunately, no.
    http://mars.jpl.nasa.gov/msp98/news/mco990930.html
  • Gandor 2012-08-09 10:20
    How could someone spawn something like that?

    Maybe it`s easier to tell the non-technical person (which has access to FTP) to just insert this "magick thing" just before </head> letters on every page than to somehow change charset in text editor (where the sourcecode looks to be perfectly OK)...
  • Mike 2012-08-09 10:21
    Some Jerk:
    If programmers were perfect... this site would not be very interesting.


    Only if there was only one language to code in.

    TRWTF is <language>
  • Loren Pechtel 2012-08-09 10:25
    Remy Porter:
    All WTFs started off as a good idea based on some constraint we don't know about. Nobody sits down and goes, "What's the worst possible way to solve this problem?" and then does that.


    Yup. I strongly suspect this is to fix a stupidity that's being imposed from elsewhere.
  • Some Jerk 2012-08-09 10:36
    Remy Porter:
    All WTFs started off as a good idea based on some constraint we don't know about. Nobody sits down and goes, "What's the worst possible way to solve this problem?" and then does that.


    PROFOUND DISAGREEMENT: Contrary to popular belief, not all programmers are created equal. A part of the problem is the income and the potential to produce results while in a state of ignorance. Many feel that because what they are doing works, means they are smart enough that they need not learn anything new. Others choose to believe that if it is something they do not understand, then it is not worth knowing. Still more figure that if it isn't in one of the books they read in college, it is untested theory and they summarily reject it. I find very few programmers that can actually look at a problem and come up with an original solution.

    Therefore, I argue that most WTFs come from
    1. The learning process
    2. An oversight
    3. Temporary insanity
    4. Profound Ignorance
    5. Unwillingness to perform the necessary research
    6. Lack of Imagination

    I suspect the ones that typically make us laugh are the bottom 3.

    CAPTCHA: aptent - where threads go when they sleep
  • Some Jerk 2012-08-09 10:37
    Mike:
    Some Jerk:
    If programmers were perfect... this site would not be very interesting.


    Only if there was only one language to code in.

    TRWTF is <language>


    In truth, I find that old debate to be very tired.
  • Lockwood 2012-08-09 10:55
    Remy Porter:
    All WTFs started off as a good idea based on some constraint we don't know about. Nobody sits down and goes, "What's the worst possible way to solve this problem?" and then does that.


    What about that competition to make the most WTF calculator?
    Everypone sat down and tried to come up with the best worst solution.
  • Ronald 2012-08-09 11:16
    If they did a find-and-replace, they wouldn't be able to put "jQuery" on their resume.
    Doesn't that pretty much explain the whole "web 2.0" thing where you take perfectly functional HTML pages and rewrite them in JavaScript, just because, you know, you can, and rounded-fade corners are so much more important than actual content?
  • Mike 2012-08-09 11:16
    Some Jerk:

    In truth, I find that old debate to be very tired.


    Completely agree. Religious debates. I wish I had a pound for every language I had to code in through my career.

    (hmmm, actually I think I would want more than that)
  • Some Jerk 2012-08-09 11:25
    Mike:
    Some Jerk:

    In truth, I find that old debate to be very tired.


    Completely agree. Religious debates. I wish I had a pound for every language I had to code in through my career.

    (hmmm, actually I think I would want more than that)


    Not trying to gain weight here, currency... err... ahem, currently... weigh exactly how much I wish.

    Damned E-BIGGOTS!!!
  • Some Jerk 2012-08-09 11:27
    Ronald:
    If they did a find-and-replace, they wouldn't be able to put "jQuery" on their resume.
    Doesn't that pretty much explain the whole "web 2.0" thing where you take perfectly functional HTML pages and rewrite them in JavaScript, just because, you know, you can, and rounded-fade corners are so much more important than actual content?


    Don't lump the intent in with the result. The intent is to make online apps feel like windows apps, more or less. Unfortunately... every time a new gadget comes out... people have to sprinkle it all over their websites, whether it is useful or not.
  • corroded 2012-08-09 11:30
    Y u no &reg;?
  • abico 2012-08-09 11:46
    Average joy:
    you done do somethin to that website with dem their code thingies that done broke somethin. i can't read dem dere previous articles this week and when i do click on this one today it brings me to a different one.

    i done think this no happen if you was runnin on the cloud


    Oh, fuck you and your street talk. Got a headache trying to understand what the fuck you said, and I still don't know.
  • rohcQaH 2012-08-09 12:07
    TRWTF is having the browser re-parse all that HTML code even when no changes are required.

    var old = $(this).html(),
    new = old.replace('ClientName¬ÆClientService','ClientName®ClientService');
    if (old != new)
    $(this).html(new);

    There, probably reduced the speed penalty by half.
  • Greg 2012-08-09 12:15
    7. God complex (can do no wrong)
  • Some Jerk 2012-08-09 12:27
    Greg:
    7. God complex (can do no wrong)


    Humility is not particularly a common component among geeks. At least not until they have been locked within a single technology for too long and find themselves job hunting, only to discover that entirely new platforms, methodologies and frameworks have fully squashed the industrial demand for what we already know. I pitty some few of my friends who still only use/know classic ASP.

    Just a single word of advice to all my fellow devs out there... if you don't have a computer at home or aren't using it to try out all of the new IDEs, frameworks, libraries and technologies that follow your current technology... you may find that 10 years of experience doesn't count for much.
  • Ronald 2012-08-09 12:28
    Some Jerk:
    Ronald:
    If they did a find-and-replace, they wouldn't be able to put "jQuery" on their resume.
    Doesn't that pretty much explain the whole "web 2.0" thing where you take perfectly functional HTML pages and rewrite them in JavaScript, just because, you know, you can, and rounded-fade corners are so much more important than actual content?
    Don't lump the intent in with the result. The intent is to make online apps feel like windows apps, more or less. Unfortunately... every time a new gadget comes out... people have to sprinkle it all over their websites, whether it is useful or not.
    Lucky I'm not dictator; I'd impose severe penalties for this crap.
  • Some Jerk 2012-08-09 12:32
    ummm... what?

    CAPTCHA: opto - not quite optomised
  • dc 2012-08-09 13:02
    Mike:
    Some Jerk:

    In truth, I find that old debate to be very tired.


    Completely agree. Religious debates. I wish I had a pound for every language I had to code in through my career.

    (hmmm, actually I think I would want more than that)


    I don't know - a pound of gold sounds pretty good...
  • snoofle 2012-08-09 13:53
    Anketam:
    I am surprised that snoofle's most recent saga of the senior release manager did not get deemed the best of the sidebar.
    Not to hijack the thread, but you might be interested in an update...

    They hired a new senior release manager. He got the lay of the land, then went in and tactfully felt out his boss about making changes. The boss was, as before, resistant to sudden major changes, so the guy took a less forceful - incremental changes - approach. Now, changes are budgeted and on the schedule.
  • letatio 2012-08-09 14:39
    What if the HTML was maintained by some pointy-haired boss who knew nothing about encoding? The work request would have come in to fix all the copyright symbols once, and they would have done the find/replace method across the site. The pointy-haired boss would happily put in more and more content with his bad encoding, and more work requests would be generated. Since developers tend to want to minimize the number of work requests, and typically don't have the political clout to have a pointy-haired boss fixed, maybe they took the only sledge-hammer they had available to it.

    Just sayin.
  • Anketam 2012-08-09 15:33
    snoofle:
    Anketam:
    I am surprised that snoofle's most recent saga of the senior release manager did not get deemed the best of the sidebar.
    Not to hijack the thread, but you might be interested in an update...

    They hired a new senior release manager. He got the lay of the land, then went in and tactfully felt out his boss about making changes. The boss was, as before, resistant to sudden major changes, so the guy took a less forceful - incremental changes - approach. Now, changes are budgeted and on the schedule.
    The saga continues! Glad to hear an update on it, and sad to hear it is not another wtf.
  • Some Jerk 2012-08-09 15:47
    I think VB gets ragged on the most... and though I don't use it much anymore... I think I would if they let us make custom word operators similar to what they did with terms like AndAlso and such. I would use "this" instead of "Me" for one thing... simply because every time I am forced to use VB... I keep stumbling over that distinction.

    Since AndAlso is suddenly a good operator... I think I would add Aint (IsNot). Since Nothing means what it implies... we need something that references the ancillary something... I would use Shit. Instead of Return, I would use Git...

    The this reference could be empty in the event that you are inside of a shared method... so you could say

    if this Aint Shit then Git.
  • DCRoss 2012-08-09 15:48
    Eric:
    Unfortunately, no.
    http://mars.jpl.nasa.gov/msp98/news/mco990930.html

    1999/09/30.

    If NASA gives us a Daily WTF once every thirteen years, it would still be pretty dull.
  • McKenna 2012-08-09 16:11
    But what if the developer knew nothing about encoding?
    Maybe the source files showed the registered symbol just fine...
    Save the .html in UTF-8, browser defaults to ISO-8859-1, and there's your "UTF error"
    How do you fix the source code if the source code is already correct? Indeed, you start post-processing with javascript obviously.

    Using
    &reg;
    would be cheating of course.
  • NoneSuchName 2012-08-09 16:58
    while it isn't required per se, being a complete dipshit also helps.

  • Silverhill 2012-08-09 17:16
    DCRoss:
    If NASA gives us a Daily WTF once every thirteen years, it would still be pretty dull.
    But check out the "Mars Scorecard", at http://www.bio.aps.anl.gov/~dgore/fun/PSL/marsscorecard.html . (Unfortunately, the site hasn't been updated since 2007, but it's still a fun read.)
  • another jerk 2012-08-09 17:35
    sheeeesh! would you americans get with the metric system!
  • Murriken 2012-08-09 17:40
    another jerk:
    sheeeesh! would you americans get with the metric system!
    No.

    Don't ask why. We don't like questions.
  • big picture thinker 2012-08-09 17:55
    Some Jerk:
    Remy Porter:
    All WTFs started off as a good idea based on some constraint we don't know about. Nobody sits down and goes, "What's the worst possible way to solve this problem?" and then does that.


    PROFOUND DISAGREEMENT: Contrary to popular belief, not all programmers are created equal. A part of the problem is the income and the potential to produce results while in a state of ignorance. Many feel that because what they are doing works, means they are smart enough that they need not learn anything new. Others choose to believe that if it is something they do not understand, then it is not worth knowing. Still more figure that if it isn't in one of the books they read in college, it is untested theory and they summarily reject it. I find very few programmers that can actually look at a problem and come up with an original solution.

    Therefore, I argue that most WTFs come from
    1. The learning process
    2. An oversight
    3. Temporary insanity
    4. Profound Ignorance
    5. Unwillingness to perform the necessary research
    6. Lack of Imagination

    I suspect the ones that typically make us laugh are the bottom 3.

    CAPTCHA: aptent - where threads go when they sleep


    So how exactly do you profoundly disagree with the post you quoted? The 6 reasons you listed can easily be categorized as "some constraint". You say you disagree just because you like to have other people think you have an original idea, when in fact you are just parroting what Remy already stated, but in a less concise and more pompous manner.
  • Captcha: veniam 2012-08-09 18:38
    Remy Porter:
    All WTFs started off as a good idea based on some constraint we don't know about. Nobody sits down and goes, "What's the worst possible way to solve this problem?" and then does that.

    I'd say the cause of this WTF is someone who just didn't know you can do search-and-replace on multiple files, so he used the only solution that made sense.

    At least half of the WTFs in this site are simply people who didn't know there already was a simple way to do X, so they built their own 5000-line bug-ridden solution.
  • Jim 2012-08-09 18:43
    Some Jerk:
    Mike:
    Some Jerk:
    If programmers were perfect... this site would not be very interesting.


    Only if there was only one language to code in.

    TRWTF is <language>


    In truth, I find that old debate to be very tired.
    What you mean....I always use English. Can't really imagine translating Java to Italian....

    pachetto giuseppe.bloggs;

    importare java.util.Vector;

    classe Guidare publicco
    {
    publblica statico vuoto principale(Stringa [] argi)
    {
    Sistema.fuori.linea_di_stampa("Buongiorno a mondo");
    }
    }

    I ALWAYS program in English, no matter what technology I use....so I don't understand this talk of other languages
  • Giovani Ferrari 2012-08-09 18:46
    Jim:
    Some Jerk:
    Mike:
    Some Jerk:
    If programmers were perfect... this site would not be very interesting.


    Only if there was only one language to code in.

    TRWTF is <language>


    In truth, I find that old debate to be very tired.
    What you mean....I always use English. Can't really imagine translating Java to Italian....

    pachetto giuseppe.bloggs;

    importare giava.utilita.Vettore;

    classe Guidare publicco
    {
    publblica statico vuoto principale(Stringa [] argi)
    {
    Sistema.fuori.linea_di_stampa("Buongiorno a mondo");
    }
    }

    I ALWAYS program in English, no matter what technology I use....so I don't understand this talk of other languages
    FTFY
  • Milo 2012-08-09 18:52
    Some Jerk:
    I think VB gets ragged on the most... and though I don't use it much anymore... I think I would if they let us make custom word operators similar to what they did with terms like AndAlso and such. I would use "this" instead of "Me" for one thing... simply because every time I am forced to use VB... I keep stumbling over that distinction.

    Since AndAlso is suddenly a good operator... I think I would add Aint (IsNot). Since Nothing means what it implies... we need something that references the ancillary something... I would use Shit. Instead of Return, I would use Git...

    The this reference could be empty in the event that you are inside of a shared method... so you could say

    if this Aint Shit then Git.
    You raise an interesting ID....what if we could configure a language's keywords using an XML file? So everyone can program in a language that's fmailiar to them (assuming the syntax is the same, of course) and when you open it on your machine, it's in your language....so some "standard" symbols would be defined (just for the pedantic puritans) but you can override these (in your IDE) to be anything you wanted...and because the config is driven by a local file, Joe Blogs who like to use LolCats gets to read the program in lolCats, while Luke (who likes his Star Wars) can modify the same program in Yoda.....
  • Coyne 2012-08-09 19:13
    I suspect the whole problem can be summed up quite easily in two short sentences:

    "Grep? What's that?"
  • LoztInSpace 2012-08-09 19:22
    Milo:
    Some Jerk:
    I think VB gets ragged on the most... and though I don't use it much anymore... I think I would if they let us make custom word operators similar to what they did with terms like AndAlso and such. I would use "this" instead of "Me" for one thing... simply because every time I am forced to use VB... I keep stumbling over that distinction.

    Since AndAlso is suddenly a good operator... I think I would add Aint (IsNot). Since Nothing means what it implies... we need something that references the ancillary something... I would use Shit. Instead of Return, I would use Git...

    The this reference could be empty in the event that you are inside of a shared method... so you could say

    if this Aint Shit then Git.
    You raise an interesting ID....what if we could configure a language's keywords using an XML file? So everyone can program in a language that's fmailiar to them (assuming the syntax is the same, of course) and when you open it on your machine, it's in your language....so some "standard" symbols would be defined (just for the pedantic puritans) but you can override these (in your IDE) to be anything you wanted...and because the config is driven by a local file, Joe Blogs who like to use LolCats gets to read the program in lolCats, while Luke (who likes his Star Wars) can modify the same program in Yoda.....

    You may laugh.
    In my C days, I genuinely saw, in the wild, something like this:
    #DEFINE BEGIN {
    #DEFINE END }
    #define WHILE while
    #define WEND }
    #DEFINE FOR .... (can't actually remember this one but you get the idea)

    granted, not quite the same as your suggestion, but someone's attempt at making a language familiar to them.
  • Barf 4Eva 2012-08-09 19:23
    Some Jerk:
    Greg:
    7. God complex (can do no wrong)


    Humility is not particularly a common component among geeks. At least not until they have been locked within a single technology for too long and find themselves job hunting, only to discover that entirely new platforms, methodologies and frameworks have fully squashed the industrial demand for what we already know. I pitty some few of my friends who still only use/know classic ASP.

    Just a single word of advice to all my fellow devs out there... if you don't have a computer at home or aren't using it to try out all of the new IDEs, frameworks, libraries and technologies that follow your current technology... you may find that 10 years of experience doesn't count for much.


    It's good to learn outside of work. But if you are constantly investing your time outside of work towards all the new IDEs, frameworks, libraries amd technologies that follow your current tech?

    Have a fun life outside of work, I guess...
  • Barf 4Eva 2012-08-09 19:24
    Barf 4Eva:
    Some Jerk:
    Greg:
    7. God complex (can do no wrong)


    Humility is not particularly a common component among geeks. At least not until they have been locked within a single technology for too long and find themselves job hunting, only to discover that entirely new platforms, methodologies and frameworks have fully squashed the industrial demand for what we already know. I pitty some few of my friends who still only use/know classic ASP.

    Just a single word of advice to all my fellow devs out there... if you don't have a computer at home or aren't using it to try out all of the new IDEs, frameworks, libraries and technologies that follow your current technology... you may find that 10 years of experience doesn't count for much.


    It's good to learn outside of work. But if you are constantly investing your time outside of work towards all the new IDEs, frameworks, libraries amd technologies that follow your current tech?

    Have a fun life outside of work, I guess...


    Let me emphasize CONSTANTLY. I believe in learning new tech, however I see that some devs do it at the expense of a social life.
  • Some Jerk 2012-08-09 20:04
    Barf 4Eva:
    Barf 4Eva:
    Some Jerk:
    Greg:
    7. God complex (can do no wrong)


    Humility is not particularly a common component among geeks. At least not until they have been locked within a single technology for too long and find themselves job hunting, only to discover that entirely new platforms, methodologies and frameworks have fully squashed the industrial demand for what we already know. I pitty some few of my friends who still only use/know classic ASP.

    Just a single word of advice to all my fellow devs out there... if you don't have a computer at home or aren't using it to try out all of the new IDEs, frameworks, libraries and technologies that follow your current technology... you may find that 10 years of experience doesn't count for much.


    It's good to learn outside of work. But if you are constantly investing your time outside of work towards all the new IDEs, frameworks, libraries amd technologies that follow your current tech?

    Have a fun life outside of work, I guess...


    Let me emphasize CONSTANTLY. I believe in learning new tech, however I see that some devs do it at the expense of a social life.


    I do understand the concern. My suggestion is to spend at least 1 weekend each month using something new. Find a challege that interests you and try to employ a new method of accomplishment.

    The problems we solve as software engineers are not particularly variant. We handle incoming information, a transformation, a serialization, a deserialization, a transformation, and presentation. Over time, regardless of what frameworks are developed to deal with these various stages or to simplify how we represent our intentions, the pattern doesn't tend to change much. All that really changes is how we represent that pattern.

    The problem is (however), those who review our experience won't understand that the change over from web forms to MVC is virtually trivial to an experienced developer. They won't see the term MVC on your resume and will assume that you cannot do the job... dispite the fact that you can probebly do it better than 99% of those who do have MVC experience. It took me a weekend to learn everything new about MVC... and that stood between me and getting a job.

    CAPTCHA: damnum - if they don't respect your experience, then damnum
  • dynedain 2012-08-09 21:15
    Original author here...

    Nope, the person responsible for this script clearly had write access to the entire HTML structure of the site.
  • dynedain 2012-08-09 21:16
    Jeremy:
    Ahh if only we all lived in a perfect world. I've had to do something very similar to this since the CMS we used is locked down by the company that manages it. My agency only has access to a small piece of the content and sometimes you have to fix things outside your normal control.

    Might not be the case for this bit of code, but the developer may have had some restrictions we didn't know about.


    Original author here...

    Nope, the person responsible for this script clearly had write access to the entire HTML structure of the site. No CMS or other content inheritance procedures involved.
  • dynedain 2012-08-09 21:18
    Gandor:
    How could someone spawn something like that?

    Maybe it`s easier to tell the non-technical person (which has access to FTP) to just insert this "magick thing" just before </head> letters on every page than to somehow change charset in text editor (where the sourcecode looks to be perfectly OK)...


    Nope. This one-liner was added to the existing global site scripts. The same person/team who wrote this was responsible for maintaining the HTML files as well.
  • dynedain 2012-08-09 21:22
    McKenna:
    But what if the developer knew nothing about encoding?
    Maybe the source files showed the registered symbol just fine...
    Save the .html in UTF-8, browser defaults to ISO-8859-1, and there's your "UTF error"
    How do you fix the source code if the source code is already correct? Indeed, you start post-processing with javascript obviously.

    Using
    &reg;
    would be cheating of course.


    The article isn't displaying the HTML formatting. In the replacer, the original code sets <sup>&reg;</sup>

    So whoever wrote this script new about HTML-encoding to begin with.
  • QJo 2012-08-10 04:03
    Some Jerk:
    Remy Porter:
    All WTFs started off as a good idea based on some constraint we don't know about. Nobody sits down and goes, "What's the worst possible way to solve this problem?" and then does that.


    PROFOUND DISAGREEMENT: Contrary to popular belief, not all programmers are created equal. A part of the problem is the income and the potential to produce results while in a state of ignorance. Many feel that because what they are doing works, means they are smart enough that they need not learn anything new. Others choose to believe that if it is something they do not understand, then it is not worth knowing. Still more figure that if it isn't in one of the books they read in college, it is untested theory and they summarily reject it. I find very few programmers that can actually look at a problem and come up with an original solution.

    Therefore, I argue that most WTFs come from
    1. The learning process
    2. An oversight
    3. Temporary insanity
    4. Profound Ignorance
    5. Unwillingness to perform the necessary research
    6. Lack of Imagination

    I suspect the ones that typically make us laugh are the bottom 3.

    CAPTCHA: aptent - where threads go when they sleep


    Don't forget fear. Fear of the colossal learning curve ahead. Fear of the boss finding out that you're not Mr. Perfect Superprogrammer, and that you need guidance every now and then. Fear that doing research on whether there are "techniques for doing this stuff" makes you look unproductive.

    Not a good space to be in, but one all too common nowadays.
  • Cbuttius 2012-08-10 04:57
    The first step when mastering a new programming language is just getting the code to work.

    You write something in the new language and it works and it feels like an achievement.

    I find that nowadays, even most new programming exercises involve integrating something with a 3rd party library rather than writing raw code, and too many jobs look for the most expert programmer to come and join a big team where you join other programmers who all have pretty much the same skills as yourself, i.e. you all program in the same language, that there is minimal code to write, that you spend far more time waiting around for requirements or code reviews than you actually spend writing code, that you often sit in a big open-plan office where everyone outside of your immediate team ignores you like you don't exist, and of course you see loads of potential improvements but everybody is far too scared to make them, which often leads to very little code actually getting written.

    Far too often you have to justify every code change, and sometimes they make out that they pay you per line of code because they'd rather you sit spending the day on TheDailyWTF than changing code because of the "cost".

    We should, if we haven't already, have a discussion here on why we think there is so much WTF-ery in software engineering.
  • Coward 2012-08-10 06:41
    Cbuttius:
    The first step when mastering a new programming language is just getting the code to work.

    You write something in the new language and it works and it feels like an achievement.

    I find that nowadays, even most new programming exercises involve integrating something with a 3rd party library rather than writing raw code, and too many jobs look for the most expert programmer to come and join a big team where you join other programmers who all have pretty much the same skills as yourself, i.e. you all program in the same language, that there is minimal code to write, that you spend far more time waiting around for requirements or code reviews than you actually spend writing code, that you often sit in a big open-plan office where everyone outside of your immediate team ignores you like you don't exist, and of course you see loads of potential improvements but everybody is far too scared to make them, which often leads to very little code actually getting written.

    Far too often you have to justify every code change, and sometimes they make out that they pay you per line of code because they'd rather you sit spending the day on TheDailyWTF than changing code because of the "cost".

    We should, if we haven't already, have a discussion here on why we think there is so much WTF-ery in software engineering.

    +1
  • Some Jerk 2012-08-10 07:22
    QJo:
    Some Jerk:
    Remy Porter:
    All WTFs started off as a good idea based on some constraint we don't know about. Nobody sits down and goes, "What's the worst possible way to solve this problem?" and then does that.


    PROFOUND DISAGREEMENT: Contrary to popular belief, not all programmers are created equal. A part of the problem is the income and the potential to produce results while in a state of ignorance. Many feel that because what they are doing works, means they are smart enough that they need not learn anything new. Others choose to believe that if it is something they do not understand, then it is not worth knowing. Still more figure that if it isn't in one of the books they read in college, it is untested theory and they summarily reject it. I find very few programmers that can actually look at a problem and come up with an original solution.

    Therefore, I argue that most WTFs come from
    1. The learning process
    2. An oversight
    3. Temporary insanity
    4. Profound Ignorance
    5. Unwillingness to perform the necessary research
    6. Lack of Imagination

    I suspect the ones that typically make us laugh are the bottom 3.

    CAPTCHA: aptent - where threads go when they sleep


    Don't forget fear. Fear of the colossal learning curve ahead. Fear of the boss finding out that you're not Mr. Perfect Superprogrammer, and that you need guidance every now and then. Fear that doing research on whether there are "techniques for doing this stuff" makes you look unproductive.

    Not a good space to be in, but one all too common nowadays.

    yes... there are always plenty of executive orders that simply ooze wtf all over a project... but the majority of them originate from the developers. On the other hand... many companies want to pay as little as possible for their developers and don't want to spend money improving their skills... so I suppose that if any of them cheap developers suddenly radiated competance they might find the HR office and the big white box.
  • omnichad 2012-08-10 09:45
    I've actually had to do something similar. I maintain an online web service where most of the ASP (yes, classic ASP) code is generated by a third-party program. Modifying that code just gets it overwritten. I have to add the code where it lets me.

    I have to use jQuery to modify the DOM, re-arrange elements, conditionally hide elements, and yes - even change static text on the page.

    Actually, this application has some even worse sins such as dynamically generated form field names. So to modify a text field, I have to search by the text in the "label" tag, look at its "for" attribute, and then find the element with that ID. Without jQuery, I would have pulled my hair out long ago. With, it's actually not too bad.
  • scooby509 2012-08-10 17:14
    snoofle:
    Some Jerk:
    If programmers were perfect... this site would not be very interesting.
    www.TheDailyTheyDidItRightAgain-HoHum.com

    ...indeed.


    You'd still get the same comments trying to fix the code and making it worse.
  • Some Jerk 2012-08-11 10:58
    scooby509:
    snoofle:
    Some Jerk:
    If programmers were perfect... this site would not be very interesting.
    www.TheDailyTheyDidItRightAgain-HoHum.com

    ...indeed.


    You'd still get the same comments trying to fix the code and making it worse.


    And I suppose there would still be plenty of E-Biggots... though I don't find myself laughing at such comments.
  • Daniel Beardsmore 2012-08-11 19:13
    Milo:
    You raise an interesting ID....what if we could configure a language's keywords using an XML file? So everyone can program in a language that's fmailiar to them (assuming the syntax is the same, of course) and when you open it on your machine, it's in your language...


    I don't know the specific details, but essentially that's what Apple did with the Open Scripting Architecture. It didn't take off.
  • Derek 2012-08-12 23:03
    I'd add ...

    8. Self promotion

    I'm sure you guys have experience code from those devs who are hell bent on telling everyone they are doing things wrong and that everyone should be following them and their favourite/latest Shiny New Thing. Only to then ... usually after a lot of time ... get hold of some code and find out that these dev's abilities lag far behind their mouths.
  • Herr Otto Flick 2012-08-13 06:50
    Some Jerk:
    Greg:
    7. God complex (can do no wrong)


    Humility is not particularly a common component among geeks. At least not until they have been locked within a single technology for too long and find themselves job hunting, only to discover that entirely new platforms, methodologies and frameworks have fully squashed the industrial demand for what we already know. I pitty some few of my friends who still only use/know classic ASP.

    Just a single word of advice to all my fellow devs out there... if you don't have a computer at home or aren't using it to try out all of the new IDEs, frameworks, libraries and technologies that follow your current technology... you may find that 10 years of experience doesn't count for much.


    HALLO! This is the real world calling! In actuality, (looks around programming teams) most professional programmers are not geeks. Very few of us are geeks (I am). We spend our days transposing business requirements into designs, designs into software and software into systems. Only very few geeks are required for this process. Very few 'super cool' modern techniques are required.

    Only occasionally are geeks required. The geek will say "Hey, this arbitrary offline processing is shit, we should be using RabbitMQ, do this, this and that", and suddenly everyone will be using modern technology.

    To suggest that all the non-geeks do what the geeks do all night - research new tech - is nonsense, and is merely a reinforcement argument designed to boost the geek's ego - "I do this, everyone else doesn't, therefore they are worse".
  • frits 2012-08-13 08:48
    Some Jerk:
    Remy Porter:
    All WTFs started off as a good idea based on some constraint we don't know about. Nobody sits down and goes, "What's the worst possible way to solve this problem?" and then does that.


    PROFOUND DISAGREEMENT: Contrary to popular belief, not all programmers are created equal. A part of the problem is the income and the potential to produce results while in a state of ignorance. Many feel that because what they are doing works, means they are smart enough that they need not learn anything new. Others choose to believe that if it is something they do not understand, then it is not worth knowing. Still more figure that if it isn't in one of the books they read in college, it is untested theory and they summarily reject it. I find very few programmers that can actually look at a problem and come up with an original solution.

    Therefore, I argue that most WTFs come from
    1. The learning process
    2. An oversight
    3. Temporary insanity
    4. Profound Ignorance
    5. Unwillingness to perform the necessary research
    6. Lack of Imagination

    I suspect the ones that typically make us laugh are the bottom 3.

    CAPTCHA: aptent - where threads go when they sleep

    I think many WTFs could be prevented by more of #6. It's not lack of imagination that gets most into trouble, but an application of imaginitive thinking to already-solved problems.
  • Chris Randle 2012-09-04 11:15
    I think that he means GBP or the £. Not lb.
  • Wally 2013-03-06 13:03
    dc:
    Mike:
    Some Jerk:

    In truth, I find that old debate to be very tired.


    Completely agree. Religious debates. I wish I had a pound for every language I had to code in through my career.

    (hmmm, actually I think I would want more than that)


    I don't know - a pound of gold sounds pretty good...


    8. Misunderstanding units of measure: Arriane 5 rocket failure, Mars probe miss, and "a pound" == "a pound of gold"