• (nodebb)

    When the only tool you have is a hammer ... everything gets damaged.

  • (nodebb)

    Slightly disappointed. When I saw this

    When this person started, the team had some regular jobs which ran in the mornings.

    I was expecting that at some time shortly after this person started, the team no longer had any regular jobs that ran in the mornings.

  • (nodebb)

    Or the way that, after our main while loop, which we'll come back to, we compare boolean variables against boolean literals.

    And that he does not do it consistently!

  • (nodebb)

    I waited 3 minutes to post this

  • (nodebb) in reply to ESkIiHccraVBD

    Y'all are gonna hate me, but I always test boolean variables as "if (okay)" and "if (okay == false)". Sometimes the exclamation point is hard to see, but at least I'm consistent.

  • Acronym (unregistered) in reply to dpm

    I'll do one better. In TS I convert to boolean by using Boolean(test) not !!test. For the same reason, the double exclamation marks is hard to see and may be confused with a single excalamation mark

  • (nodebb) in reply to Acronym

    Have you considered a career as a lawyer instead?

  • (nodebb) in reply to dpm

    In Python, the exclamation mark is a not and hard_to_see != False

  • A Human (unregistered) in reply to dpm

    I am going to hate you, because it can be written clearer as if okay and if !okay.

  • (nodebb)

    My first thought looking at this code was that given there are three boolean variables, and different logic to run based on different combinations of values, it may improve readability in this case to say "if (bool1 = true and bool2 = true and bool3 = false) {} else if (bool1 = false and bool2 = true and bool3 = true). {}..." etc. That way you can see at a glance which specific combination is being treated by each block of code. But then I saw the "if not hub_1_ready and not hub_2_ready and job_ran_later == False:" and can only shake my head and walk away.

  • (nodebb) in reply to A Human

    I am going to hate you, because it can be written clearer as if okay and if !okay.

    Not in every programming language.

Leave a comment on “Three Minutes”

Log In or post as a guest

Replying to comment #694050:

« Return to Article