Representative Line



  • While peer-reviewing a system of another team, I discovered a whole bunch of variable names consisting of a single letter followed by a single digit. While useless to the casual observer, it turns out that they are actually well known short hand names for a variety of things in this particular line of business. As such, the developers just used variables that match the nomenclature. No big deal.

    Then they went and did something like this (I used only 3 variables for brevity; there were 9):

      boolean i1 = <complex expression that always evaluates to true>;
    boolean l1 = <complex expression that always evaluates to false>;
    if (i1||!!!l1||!!i1) { /* stuff */ }

    The expression always evaluates to true, and is totally unnecessary.

    Why? Because they were feeling gamy during one late night debugging session, and then just decided to leave it that way because everyone knew what it meant.




  • Does that really mean not-not-not l1 and not-not i1?



  • @mott555 said:

    Does that really mean: not-not-not l1 OR not-not i1?

    sadly, yes


  •  At least they realize they're being weird, instead of thinking they're clever or truly ignorant of their wtf.



  •  You have to expect this sort of thing in an environment where

    function(argument)

    and

    function((argument))

    can give two completely different results.



  • @da Doctah said:

     You have to expect this sort of thing in an environment where

    function(argument)

    and

    function((argument))

    can give two completely different results.

     

    wha?

    What environment is this? How do you know it's snoofle's environment? Why do you mention this even though it's not related to the OP?

    SO MANY QUESTIONS.

     



  • @da Doctah said:

     You have to expect this sort of thing in an environment where

    function(argument)

    and

    function((argument))

    can give two completely different results.

    Not sure where you're going with this or what assumptions you're using; we have a Java environment, so f(a) and f((a)) are the same.

     



  • @dhromed said:

    What environment is this?

    VB6 (or VBS or VBA). If you put a parameter into individual parentheses, it gets passed by value (i. e. changing the parameter's value will not have side effects on the value of the caller's "argument" variable). You can also write stuff like argument+0 or argument&"", depending on the type of the variable, to achieve the same result.

    Or go the sane route and declare the parameter in the function declaration ByVal, or just do not change the value of parameters :)



  • @da Doctah said:

     You have to expect this sort of thing in an environment where

    function(argument)

    and

    function((argument))

    can give two completely different results.

     

    Are you a Perl programmer on parole or something?



  • @dhromed said:

    What environment is this?
    Maybe it's Pythong.



  • @Zecc said:

    @dhromed said:

    What environment is this?
    Maybe it's Pythong.

     

    Nope, in Python f(a) and f((a)) are the same thing... Altough f((a,)) is a different beast.

     



  • @Mcoder said:

    @Zecc said:

    @dhromed said:

    What environment is this?
    Maybe it's Pythong.

     

    Nope, in Python f(a) and f((a)) are the same thing... Altough f((a,)) is a different beast.

     

    Yes, but f(a, b) is different than f((a, b)). And both are valid Pythong syntax.



  • @Mcoder said:

    Nope, in Python f(a) and f((a)) are the same thing... Altough f((a,)) is a different beast.
    Yes, but I was talking about Pythong.

    And btw, in Lua f((expr)) is different from f(expr) if expr is a function call which returns multiple values. In the first case f is called with only the first value.



  • @snoofle said:

    While peer-reviewing a system of another team, I discovered a whole bunch of variable names consisting of a single letter followed by a single digit. While useless to the casual observer, it turns out that they are actually well known short hand names for a variety of things in this particular line of business. As such, the developers just used variables that match the nomenclature. No big deal.

    Finance Industry + variable names consisting of a single letter followed by a single digit = Excel?

     



  • @mihi said:

    @dhromed said:

    What environment is this?

    VB6 (or VBS or VBA). If you put a parameter into individual parentheses, it gets passed by value (i. e. changing the parameter's value will not have side effects on the value of the caller's "argument" variable). You can also write stuff like argument+0 or argument&"", depending on the type of the variable, to achieve the same result.

    Or go the sane route and declare the parameter in the function declaration ByVal, or just do not change the value of parameters :)

    Hey, if your shop is doing one thing in Java, another thing in VB, still another in Perl, and a bunch of legacy stuff in RPG for all I know, the relevant environment is "IT".


  •  as I recall, in lisp and other functional languages (f a) calls f with a as the parameter, and (f (a)) calls a and passes its result to f (though that's more akin to f(a) vs. f(a()) in more sane languages, or you could take the difference between (f a) and ((f a)) which is akin to f(a) vs. f(a)())



  • @Ben L. said:

    Yes, but f(a, b) is different than f((a, b)). And both are valid Pythong syntax.

    I don't know python, but that seams reasonable if

    (1, 2, ..., n)
    is the notation for a tuple (because that is kinda standard).

    With only so many special characters (which are sensible to use at least) you're bound to get these sorts of small syntax awkwardnesses sometimes.



  • @TGV said:

    Are you a Perl programmer on parole or something?
    They let them off early these days? For what? Surely not good behaviour? At least the Soviets got that one nailed: nobody would use Perl there, unless they wanted a state-sponsored move to Siberia.

     



  • @dtech said:

    tuple
     

    I've always wondered if it's pronounced topple or toople.


  • ♿ (Parody)

    @dhromed said:

    @dtech said:
    tuple

    I've always wondered if it's pronounced topple or toople.

    I've always said it like "tuh-ple."


  • Discourse touched me in a no-no place

    @dhromed said:

    @dtech said:

    tuple
     

    I've always wondered if it's pronounced topple or toople.

    Either is apparently ok.

    IPA: /tuːpəl/, /tʌpəl/
    ("too-pal", "tu-pal"[short 'u'] for those who can't read IPA, like me.)


  • @boomzilla said:

    I've always said it like "tuh-ple."
     

    "Two-pul" or "tew-pull" in my case.



  • @dhromed said:

    @dtech said:

    tuple
     

    I've always wondered if it's pronounced topple or toople.

    I say "tuh-ple", but only because I think saying "too-ple" makes you sound like a twat. I've always though "too-ple" was the "official pronunciation, because everyone I know says "too-ple". And they sound like twats doing it.


  • ♿ (Parody)

    @Someone You Know said:

    I say "tuh-ple", but only because I think saying "too-ple" makes you sound like a twat. I've always though "too-ple" was the "official pronunciation, because everyone I know says "too-ple". And they sound like twats doing it.

    I'm not so much bothered by that pronunciation, but I guess I always figured it should be said the same way that bit is pronounced in words like quintuple, which I've never heard pronounced with the "too" sound, at least by anyone with an American accent. I figure foreigners say stuff weirdly to begin with, so they don't really count.



  • @boomzilla said:

    I always figured it should be said the same way that bit is pronounced in words like quintuple
     

    This is sensible.

    Unfortunately, it's language.



  • @boomzilla said:

    @Someone You Know said:
    I say "tuh-ple", but only because I think saying "too-ple" makes you sound like a twat. I've always though "too-ple" was the "official pronunciation, because everyone I know says "too-ple". And they sound like twats doing it.

    I'm not so much bothered by that pronunciation, but I guess I always figured it should be said the same way that bit is pronounced in words like quintuple, which I've never heard pronounced with the "too" sound, at least by anyone with an American accent. I figure foreigners say stuff weirdly to begin with, so they don't really count.

    You've never heard of tripoolets or twoons?



  • Obviously it's pronounced tuhp-LAY.



  • @MiffTheFox said:

    Obviously it's pronounced tuhp-LAY.

    WOULD YOU LIKE TUPLE A GAME?



  • @Someone You Know said:

    @MiffTheFox said:

    Obviously it's pronounced tuhp-LAY.

    WOULD YOU LIKE TUPLE A GAME?

     

    I only tuple tyrants and dictators.

     



  • @dhromed said:

    @Someone You Know said:

    @MiffTheFox said:

    Obviously it's pronounced tuhp-LAY.

    WOULD YOU LIKE TUPLE A GAME?

     

    I only tuple tyrants and dictators.

     

    Here there lies a tupled god,

    His fall was not a small one.

    We but built his purple dildo,

    A narrow and a tall one.


  • Considered Harmful

    @Someone You Know said:

    Here there lies a tupled god,

    His fall was not a small one.

    We but built his purple dildo,

    A narrow and a tall one.

    +1 Frank Herbert

    -∞ what you did there



  • @Someone You Know said:

    a tupled god
     

    Then I became a polytheist



  • @dhromed said:

    @Someone You Know said:

    a tupled god
     

    Then I became a polytheist

    BURN PAGAN BURN



  • @Someone You Know said:

    @dhromed said:
    @Someone You Know said:
    a tupled god
    Then I became a polytheist

    BURN PAGAN BURN

    If it's a 3-tuple singular god, then it's actually not pagan at all!



  •  It's infinity gods of a higher cardinality.


Log in to reply