• (cs) in reply to Milo
    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 (unregistered) in reply to Some Jerk
    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 (unregistered) in reply to 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.

  • Some Jerk (unregistered) in reply to Barf 4Eva
    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

  • (cs) in reply to Mike D.

    Original author here...

    Nope, the person responsible for this script clearly had write access to the entire HTML structure of the site.

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

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

  • (cs) in reply to McKenna
    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

    ®
    would be cheating of course.

    The article isn't displaying the HTML formatting. In the replacer, the original code sets ®

    So whoever wrote this script new about HTML-encoding to begin with.

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

  • (cs)

    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 (unregistered) in reply to Cbuttius
    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 (unregistered) in reply to QJo
    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.

  • (cs)

    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.

  • (cs) in reply to snoofle
    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 (unregistered) in reply to scooby509
    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.

  • (cs) in reply to Milo
    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 (unregistered) in reply to Some Jerk

    I'd add ...

    1. 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 (unregistered) in reply to Some Jerk
    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".

  • (cs) in reply to Some Jerk
    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 (unregistered) in reply to dc

    I think that he means GBP or the £. Not lb.

  • Wally (unregistered) in reply to dc
    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...

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

Leave a comment on “Representative Line - jQuery Search n' Replace”

Log In or post as a guest

Replying to comment #:

« Return to Article