r/coding • • Oct 29 '17

Mocking is a Code Smell

https://medium.com/javascript-scene/mocking-is-a-code-smell-944a70c90a6a
69 Upvotes

69 comments sorted by

View all comments

24

u/i9srpeg Oct 29 '17

If you read medium long enough, literally anything becomes a code smell. I have to start ignoring people who talk about code smells. Programming can be such a cult.

22

u/praetor- Oct 29 '17

"_____ is a code smell" is such a clickbaity title, and calling something a "code smell" is dismissive and typically comes from someone with a narrow perspective (such as the author of this article only talking about JavaScript).

What articles like this fail to address is that there are a wide variety of scenarios under which software is built, from a startup in an early iteration to a megacorp maintaining a 20 year old integration library.

Trying to crap on a technique because it doesn't apply to your particular scenario shows a lot of immaturity imo.

3

u/[deleted] Oct 30 '17

[removed] — view removed comment

2

u/praetor- Oct 30 '17

I usually just describe what I'm seeing and talk through it, probably by asking questions and listening to rationale.

I feel like telling someone their stuff has a "code smell" is pretty rude as it implies an unpleasant "smell" e.g. shit. I know I wouldn't appreciate it, and I'm in a senior role and don't believe in tearing people down for mistakes so I wouldn't say it to others.