11
Awlex
3y

Me rejecting working code in a code review, because it smells

Comments
  • 3
    i hate the word smells when used for code.
  • 1
    @molaram still. Just call it inefficient, unmaintainable, hard to read. Actually nvm, _I_ will.
  • 1
    @bananaerror For some reason I enjoy your suffering
  • 1
    @bananaerror Inefficiency is not a code smell though. Code smells are non-causal indicators of bad code. For example, branching based on a subclass check isn't inherently bad, but it indicates that your responsibilities aren't spread optimally.
  • 2
    @Awlex at least my miserable life is bringing joy to someone, and I don't say that sarcastically.

    @homo-lorens I agree that's not necessarily inefficiency, but I'd personally go out of my way to avoid "code smell." I'd call your example a potential cause for concern in the future, maybe "not the cleanest of code". They both most certainly are a mouthful, but I'm willing to go that far. I'm weird, I know.
  • 1
    @homo-lorens
    * O(8n) when you could do it in 2n or ideally don't calculate averages in code when you could let the database do it
    * whole functions copied and only a variable changed
    * repeated use of of the process, written slightly different each time
    * ignored naming conventions
    * function that should only return a boolean can also return an (unhandled) error
    * unhandled not so edgy cases
    * no tests

    I think I've said enough. I couldn't come up with a better description than smelling code, 'bad code' would undermining it. That feature is not on a strict timeline or something, so I can use this to drill some good practices into that developer 🥳
  • 1
    @Awlex All of those except the time complexity are code smells by my interpretation of the word, however our industry is much too young not to dispute the meaning of all but the most fundamental terms.
  • 1
    @Awlex Also, my condolences. That's gonna be a pain to fix.
  • 1
    @homo-lorens I should be sorry if anything. I feel like pushing a dog's face into the their shit until they learn to do better
Add Comment