Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@molaram still. Just call it inefficient, unmaintainable, hard to read. Actually nvm, _I_ will.
-
@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.
-
@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. -
Awlex177453y@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 🥳 -
@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.
-
Awlex177453y@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
Me rejecting working code in a code review, because it smells
joke/meme