• Sole Purpose Of Visit (unregistered)

    Truth not found?

  • (nodebb)

    "It's very clear they didn't think about whether or not they should do this." Well, there's your problem. Really, it is clear they didn't think. That often leads to the kinds of code that gets featured on this site, including this batch.

  • MiserableOldGit (unregistered)
    So, updateGroup returns a string containing a boolean (at least, we hope it contains a boolean). updateExternalGroup returns an actual boolean. If both of these things are true, than we want to invoke GetActivityDataFromService.

    Given the use of the .ToLower modifier on fleetSuccess I'd suggest your optimism is misplaced and updateGroup returns a string containing one or more of [True, true, TrUe, True&True, FileNotFound, Etcetcetc].

    I was trying to work out if the coder had simply been trying make some abstraction to hide away shocking functions he had no control over, but given the state of this shocker there's probably no need to look elsewhere.

    I once worked with someone who did things like this. Someone else in the outfit thought it would help to send him on a course to learn regular expressions. Truly, some of the atrocities he created after that would make you want to dropkick a baby seal.

  • (nodebb)

    The updateGroup call launches nuclear warheads, therefore what type it returns (string) and whether it's limited to "true" or "false" is irrelevant - the world is basically over.

    There, I explained it.

  • Will (unregistered)

    Don't forget this line too: return Json(fleetSuccess, JsonRequestBehavior.AllowGet);

    So, that "true&&&true" (or some combination there of) is also included in the Json response? or something? <mind boggled>

  • Brian Boorman (google)

    +1 on the Jeff Goldblum comment !

  • my name is missing (unregistered)

    Some animals are more truthy that others.

  • Ulli (unregistered)

    The '&&&' operator is a type-safe AND, similar to the strict '===' compare operator.

  • jay (unregistered)

    Maybe they couldn't use a boolean because it returns not just "true", "True", and "false", but sometimes "MostlyTrue" or "ProbablyButImNotSure".

  • (nodebb) in reply to MiserableOldGit
    <quote> I once worked with someone who did things like this. Someone else in the outfit thought it would help to send him on a course to learn regular expressions. Truly, some of the atrocities he created after that would make you want to dropkick a baby seal. </quote>

    So someone actually thought it was a good idea to teach a pyromaniac how to make fuel-air explosives?????

    Don't get me wrong, regexes can be used for a lot of things where they are the right tool, but they should be used with care.....

  • I dunno LOL ¯\(°_o)/¯ (unregistered)
    enum wtfEnum {
        False,
        True,
        <s>FILE_NOT_FOUND</s> STRING_EMPTY
    };
    
  • MiserableOldGit (unregistered) in reply to Yazeran1

    I'd say RegEx was the right tool in this case, although sorting out the crummy inconsistent data feeds would have given better gains. Still I like RegExes, even if I am far from the worlds best with them, I always assume someone else will have to maintain my code later on and they may find them scary. Doesn't need a tutorial, but if you've, for instance, just munged together something to try and recognise and validate and format postal codes/zip codes where you can't make assumptions about what country they relate to ... well that would make my own eyes bleed coming back to it a few months later.

    But to torture your analogy, he took his nice new fuel-air bomb skills, completely failed to understand the actual point, and designed a rather dangerous heating system. We had some quite complicated RegEx expressions which were generally incorrect or incomplete for the subject matter, then stitched together and "corrected" with standard boolean stuff and stringification. The myriad attempts at date handling alone would keep this site going for a month.

Leave a comment on “The Truth and the Truth”

Log In or post as a guest

Replying to comment #:

« Return to Article