Magic pronouns considered harmful



  • Got this finding during code review:

    I don't particularly like the fact that there's this '1' here - I suggest adding FIRST_SMOD_NUMBER := 1 under NONEXISTENT_SMOD_NUMBER in testing_constants module.

    Seriously? Does he really think it's more clear to say "SMOD #{FIRST_SMOD}" than simply "SMOD #1"? undefined


  • kills Dumbledore

    What if you change to 0 based indices later? Simply change FIRST_SMOD_NUMBER to 0 and you're done



  • Changing it would probably expose 4326 bugs in our software - 26 in our project, 300 in platform software, and 4000 in the layer above us. No one would ever dare to do this.


  • kills Dumbledore

    Yeah, but it could have been 27 in your project



  • Bugs aren't bugs until they're triggered.


  • SockDev

    I am so glad I don't work with you


  • area_deu

    Well, some projects are so thoroughly belgium‌ed that such an attitude is very much understandable.



  • FRIST_SMOD_NUMBER 😇



  • @RaceProUK said:

    I am so glad I don't work with you

    If you spent three weeks on fixing code and tests after "one simple change" because one use case triggers two hundred others, you wouldn't fix bugs in currently impossible scenarios too. In a more sane project, I would be more inclined to write bulletproof code even in situations that don't make sense given the current functionality.


  • SockDev

    I never said anything about fixing bugs.

    If you're not going to read my posts properly, don't reply to them.



  • What do you do with bugs other than fix them?

    (breaking response chain because I'm not sure if @RaceProUK would agree with me about what he wrote in his post)


  • SockDev

    Most people are able to use the correct gendered pronouns with me; it's not like my profile hides which are the correct ones.

    And what I was objecting to was your attitude that bugs are only bugs when they're triggered. Why? Because a bug is a bug, whether you can trigger it or not.



  • One isn't a magic number. Three is a magic number. Says so right in the damn song.



    • what language is that?
    • if you've already got NONEXISTENT_ NUMBER (presumably := 0?) might as well have FIRST_ NUMBER, just for consistency
    • what's a SMOD?


  • @RaceProUK said:

    Most people are able to use the correct gendered pronouns with me; it's not like my profile hides which are the correct ones.

    Give the genetic algorithm few hundred more cycles and I'll get it eventually.

    @RaceProUK said:

    And what I was objecting to was your attitude that bugs are only bugs when they're triggered. Why? Because a bug is a bug, whether you can trigger it or not.

    If I do a null dereference in dead code, is it really necessary to fix it ASAP? Same with bugs triggered only when synchronizing time against one of two active NTP servers while 2 of 3 DSP units fail in the same instant. Since you can't have two NTP servers, there's no point in spending effort to fix it, in the grand scheme of things (especially since you have 142 real bugs to fix).


  • SockDev

    @Gaska said:

    If I do a null dereference in dead code, is it really necessary to fix it ASAP?

    If it's dead code, why is it still there? Get rid of it already!
    @Gaska said:
    Same with bugs triggered only when synchronizing time against one of two active NTP servers while 2 of 3 DSP units fail in the same instant.

    And again, reading stuff I haven't written; I haven't said a damn thing about when to fix bugs.



  • @Buddy said:

    what language is that?

    TTCN.

    @Buddy said:

    if you've already got NONEXISTENT_ NUMBER (presumably := 0?) might as well have FIRST_ NUMBER, just for consistency

    NONEXISTENT_NUMBER makes sense because it indicates that it's supposed to be non-existent, which you can't infer from the number alone. However, you can infer that SMOD #1 is the first one just fine.

    Side note - it's not 0, it's 15. But it doesn't matter since neither exists.

    @Buddy said:

    what's a SMOD?

    System Module.



  • @RaceProUK said:

    If it's dead code, why is it still there? Get rid of it already!

    It was an example. A hypothetical situation. But since you've shown multiple times already you're unable to think in abstract terms, here's a more real-life example - what about non-dead code, but an execution path that will never happen?

    @RaceProUK said:

    And again, reading stuff I haven't written; I haven't said a damn thing about when to fix bugs.

    But you said they should be fixed, which implies that "when" is not equal to "never".


  • SockDev

    @Gaska said:

    what about non-dead code, but an execution path that will never happen?

    Unreachable code is practically no different to dead code; get rid of it.
    @Gaska said:
    But you said they should be fixed, which implies that "when" is not equal to "never".

    Exactly.



  • I see.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.