I've found that whenever somebody uses the phrase "code smell", their opinions on coding can be safely ignored.

@tsturm that's a hot take😄
use of the term "code smell" can be opinionated, but it's not necessarily illegitimate. there are definitely things you see in code that aren't necessarily wrong in local context, but typically indicate patterns that are less efficient than if you refactor this or that. if you're experienced you get an intuition for those things before you can exactly name what's wrong, which is what I call a "smell"

@2ck I'd say that nearly every project will have weird/inefficient/unusual solutions after it interacts with reality for a while.

Software Engineers will always attempt to create a perfect temple of code, which will then be partially torn down and rebuilt by changing requirements and covered in graffiti by irreverent users.

It's worth refactoring serious issues, but I'm against flat-out decreeing that certain solutions are without merit. Sometimes, if it works, it works.

Follow

@tsturm yeah...I guess we're talking about different things? if I'm looking at something funky and say so, it's the opening to a conversation on whether we can develop something better. no decrees. sometimes the result is we stay with what we've got, but with a better understanding of why we've got it. sometimes we make plans to reorganize so we can do things we couldn't before (or stop doing things we don't like).
For instance, on a project I was working on, we kept re-implementing this logic to pass events and data up and down UI component hierarchies, creating a lot of boilerplate in the process. There was a "right way" to do that within the framework we had, but what we really would have benefited from was two-way data binding a la React or Vue. The "smell" in this case was the hinky boilerplate code.

@2ck I understand where you are coming from. Been there before myself, where I had not been able to identify the root cause of my problems and I just kept on re-implementing the exact same solution which at the end... never really looked right. At all.

I'm not sure I had ever seen "code smell" being used for those kinds of things.

My strong reaction to that term comes from the lately repeated use in various blog posts where code constructs are being dismissed flat-out as "code smell", but it's coming off as grandstanding.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.