Justin James
2 min readMar 7, 2022

--

For this specific example, or others like it, I suppose this has some advantages, though I'll classify them in the bucket of "personal opinion". I personally don't find declarative code like this more readable, and I often find it less maintainable (if someone ever needs to make this more complex it will need to get re-written as if/else, or perhaps a switch, or something else). Less experienced developers tend think in an imperative fashion, and while you may call this in one of your other comments an education problem (we can have that discussion separately), that does not make the problem go away (and no, we aren't going to suddenly be able to hire only rockstar A+ 10x junior developers 100% of the time in most dev orgs). I personally feel that fancy (and often, "elegant") code is bad code because less experienced developers struggle to read, troubleshoot, and maintain it... but note the use of the word "feel" here, that's my personal opinion and I certainly won't present it as an immutable law of physics.

I agree with other commenters that this is not a "code smell". This isn't anything like a "code smell". It's code you don't personally agree with, but it's no "canary in the coal mine", I'm not going to audit this developer's code and inspect for other issues on the basis of this, or think that the project was architected wrong and might need a major refactor to not be garbage.

Feel free to point me to your other 90+ articles, I'll point you to my 7+ years experience of professional, paid writing on the topic of software development... (really, citing how many articles you've written... which may well be filled with more info as dubious as this article... as proof that you are an expert to be heeded is a tautology and really not cool either... note how arrogant it sounded for me to brag about how many years I wrote? that's what you are sounding like in some of your comments here... if you want to build an audience, telling your readers "I'm right because I write a lot" is NOT going to lead to success).

J.Ja

--

--

Justin James
Justin James

Written by Justin James

OutSystems MVP & longtime technical writer

Responses (2)