3 ms·
I just can't get over how much I dislike the word 'smell' in this context. I do know it is canon, unfortunately. It makes me want to stop and do something else
by Lutger 4y ago
I just can't get over how much I dislike the word 'smell' in this context. I do know it is canon, unfortunately.
It makes me want to stop and do something else, something more pleasant. It evokes a nasty image of shovelling shit, where I want to think of what I am doing as polishing a raw gem.
Furthermore, to me it seems kind of disrectful to numerous code authors of such 'smells'. Maybe they didn't know better, maybe it used to be 'clean' but they were in a hurry to fix something. Maybe they made a different trade off. Labeling what they did as 'smelly' seems impolite and unnecessarily judgemental.
Objectively, it also narrows the perspective: something that smells is harmful, stale or poisonous. It affects disgust and moves us away from it. Food that smells has gone 'bad', which implies it is not good (anymore). So to fix a smell, is to move from bad to good, which is a very binary change. It's either good or bad.
But I think with code this not always the case, and even when some code is clearly better, seeing improvements as more appropriate or efficient tradeoff is almost always much more helpful.
- Veen 4y agoIt annoys me too for similar reasons, but I think it's a lost cause for the moment. For reasons that escape me, most in the industry don't have a similar reaction.
- whalesalad 4y agoSmells can be good too, like freshly cut cedar wood or rain on asphalt. It is interesting that you first go to the terrible stinky smells of shoveling shit and that it sparks such a visceral response. Of course in this scenario, we are referring to less desirable smells, but you really took it to the next level! What word would you use instead?
- notreallyserio 4y agoAssuming the code works but is not ideal I'd just call it not ideal or inefficient or something similar.
- dgb23 4y ago> Labeling what they did as 'smelly' seems impolite and unnecessarily judgemental. I and my colleague follow a simple rule: Be mean to the code but friendly to the person. People make mistakes, are in a hurry, don't know any better, sure. But that doesn't make the code any less smelly, buggy, crappy or hard to work with. It's much more productive and even fun to just call it what it is. But this only works in an environment where people are comfortable with each other, take responsibility and want to pragmatically improve and write better code.
- deleted 4y ago[deleted]
- Calamitous 4y agoI think “smell” was not intended as a value judgement, but as a way to emphasize that there’s probably something wrong nearby, even though it’s hard to articulate.
- lucasvegi 4y agoExactly! Generally speaking, code smells are also context-sensitive structures. This means that a smell will not always represent pain in a specific project. It is just a possibility that must be analyzed in each context. It is a warning, not a judgment. We are interested in knowing Elixir's community opinion about these code smells. Collaborations can be made via GitHub issues (https://github.com/lucasvegi/Elixir-Code-Smells/issues https://github.com/lucasvegi/Elixir-Code-Smells/issues) or Pull Requests in our repo!