• (cs) in reply to PiisAWheeL
    PiisAWheeL:
    Whats so hard about true, false, and file_not_found?
    Indeed. Either you get it, or you don't.

    Or you lost the file.

  • Serious validation programmer (unregistered)

    That's the way I would have done it.

  • jverd (unregistered) in reply to Matt Westwood
    Matt Westwood:
    +9:
    I wonder how many non-programmers take programmer job positions. Okay, an infinite fuel supply for TDWTF :)

    At my last place, plenty. There was a teaching agency down the road that used to retrain broken-down old middle-managers into the fine art of FORTRAN programming, which they'd then conveyor-belt through our personnel department into our code-cutting boiler-house. Most never lasted that long - it was just a confidence-booster to get them back into the workforce - but the most useless of the lot stayed with us for considerably longer than they ought to have done.

    As you say, an infinite fuel for TDWTF.

    Nowadays we just call that "outsourcing".

  • just me (unregistered) in reply to PiisAWheeL
    PiisAWheeL:
    The difference between a syntax error and a logic error is that the code still runs with a logic error, so you can commit it without anybody noticing. You can still come back and fix it later (read: never).

    STFY

  • Guru (unregistered) in reply to PiisAWheeL
    PiisAWheeL:
    The difference between a syntax error and a logic error is typically logic errors are a lot harder to track down. You spend 3 days in the debugger (estimate based on the sample of code provided) following your code to find out why "kitties" isn't a valid filename because you spelled "true" as "treu" in your string and it failed the compare check.

    Real programmers don't use debugger. They use logging. This kind of error can be fixed in 1 hour at most.

  • agtrier (unregistered)

    Booleans store their information in just a single bit - and thanks to Tron we all know how unreliable these bits can be!

    A string like "true" uses four bytes (!) for the same information, that's 32 x as reliable (40 x in case of "false"!) - and I'm not even taking the trailing nullbyte into account!

    ag.

    PS: next week, I'll show you how much more reliable it is to fill up a dat streamer tape with zeros rather than simply assigning a "null" value. Redundance rulez!

  • Paul Bunyan (unregistered) in reply to Guru
    Guru:
    PiisAWheeL:
    The difference between a syntax error and a logic error is typically logic errors are a lot harder to track down. You spend 3 days in the debugger (estimate based on the sample of code provided) following your code to find out why "kitties" isn't a valid filename because you spelled "true" as "treu" in your string and it failed the compare check.

    Real programmers don't use debugger. They use logging. This kind of error can be fixed in 1 hour at most.

    I had no idea there was a need for my services in this field. Tell me, do most tech companies have stables where I can lodge my big blue ox?

  • (cs) in reply to Guru
    Guru:
    PiisAWheeL:
    The difference between a syntax error and a logic error is typically logic errors are a lot harder to track down. You spend 3 days in the debugger (estimate based on the sample of code provided) following your code to find out why "kitties" isn't a valid filename because you spelled "true" as "treu" in your string and it failed the compare check.

    Real programmers don't use debugger. They use logging. This kind of error can be fixed in 1 hour at most.

    No real programer use load runer test tools.

  • Michael (unregistered)

    Boolicorn: n. mythical beast, keeper of all true and false statements, avoid at all cost.

  • Jay (unregistered)

    The next time I see a function that returns the strings "true" and "false" rather than a boolean, I think just for fun I'm going to change one of the tests to

    if (returnValue.equals("True"))
    

    or

    if (returnValue.equals("ture"))
    

    Then let the original author see if he can find the problem.

  • Jay (unregistered) in reply to Paul Bunyan
    Paul Bunyan:
    Guru:
    PiisAWheeL:
    The difference between a syntax error and a logic error is typically logic errors are a lot harder to track down. You spend 3 days in the debugger (estimate based on the sample of code provided) following your code to find out why "kitties" isn't a valid filename because you spelled "true" as "treu" in your string and it failed the compare check.

    Real programmers don't use debugger. They use logging. This kind of error can be fixed in 1 hour at most.

    I had no idea there was a need for my services in this field. Tell me, do most tech companies have stables where I can lodge my big blue ox?

    Certainly. Java programmers always need an 0X to indicate that a number is hexadecimal.

  • (cs) in reply to Jay
    Jay:
    Paul Bunyan:
    Guru:
    PiisAWheeL:
    The difference between a syntax error and a logic error is typically logic errors are a lot harder to track down. You spend 3 days in the debugger (estimate based on the sample of code provided) following your code to find out why "kitties" isn't a valid filename because you spelled "true" as "treu" in your string and it failed the compare check.

    Real programmers don't use debugger. They use logging. This kind of error can be fixed in 1 hour at most.

    I had no idea there was a need for my services in this field. Tell me, do most tech companies have stables where I can lodge my big blue ox?

    Certainly. Java programmers always need an 0X to indicate that a number is hexadecimal.

    Are you suggesting this convention originated at IBM?

  • (cs) in reply to agtrier
    agtrier:
    Booleans store their information in just a single bit - and thanks to Tron we all know how unreliable these bits can be!
    Take that back! How dare you slander the faithful Bit, who loyally served first Clu and then Flynn until the CGI budget ran out ungrateful sod left it trapped in the wreckage of a crashed recognizer!
  • (cs) in reply to Guru
    Guru:
    PiisAWheeL:
    The difference between a syntax error and a logic error is typically logic errors are a lot harder to track down. You spend 3 days in the debugger (estimate based on the sample of code provided) following your code to find out why "kitties" isn't a valid filename because you spelled "true" as "treu" in your string and it failed the compare check.

    Real programmers don't use debugger. They use logging. This kind of error can be fixed in 1 hour at most.

    1. You missed the point. If you use boolean, your shitty code would throw a syntax error on compile. You would get a line number and would be able to fix your shitty code immediatelly... = lessShittyCode;

    2. Real programmers use ALL the tools available to them. I have found many bugs via debugging a lot quicker than a log file and I have found may bugs quickly using a log file. It depends on what you're doing and which language you're working with and weather or not you have code on a remote server.

    Its like preparing for the zombie apocalypse and when it finally hits deciding, "I'll just leave the hand grenades behind, I don't see how they could be useful."

  • Jeff Grigg (unregistered)

    "Hey! You missed a few!!! Here's a more complete list: http://unicode.org/charts/ "

    Most of "[^0-9a-zA-Z]", for are just missing from his function! And I'm sure that they wouldn't want Klingon characters! >;->

  • Adam Fletcher (unregistered)

    I get the sense you are a sensitive programmer who needs to harden up... F*ck me you can overreact..

  • Adam Fletcher (unregistered)

    PiisAWheeL s where it is at... Check, double check, triple check....

  • João Neves (unregistered) in reply to PoPSiCLe

    Yes, there was. Only after I added it, unfortunately...

  • Emm (unregistered) in reply to mjk340

    By chance, do you work for the US Congress?

  • someone (unregistered) in reply to Enterprisey Guy
    Enterprisey Guy:
    Cishuman:
    One could take screen captures of all non-allowed character symbols, store their paths in a XML file, then validate the string by taking each character, printing it in an image file, and then check if it is bitwise equivalent to any of these images.

    That sounds slow, difficult to implement, and prone to error.

    What tipped you off, the XML part?

Leave a comment on “Serious String Validation”

Log In or post as a guest

Replying to comment #:

« Return to Article