Else Before If

Amazing what you can do with templates.
https://www.fluentcpp.com/2020/04/24/else-before-if/
I disagree with the premise.

Don’t get me wrong, I’m all for RLM when it makes a language more readable.

But the author of that article adds a lot of boilerplate just to rearrange some code that he admits in the introduction is a clearly understood pattern, and the result is less than clean, IMNSHO.

Thanks for sharing, though!
I agree, the original was much easier to understand.
What does RLM stand for?

The first thing that comes up on google is Red Letter Media with the Mr Plinkett movie reviews, which are great:
https://www.youtube.com/watch?v=FxKtZmQgxrI&list=PL5919C8DE6F720A2D
Relocatable Logic Module?

https://acronyms.thefreedictionary.com/RLM
I'm glad I am not the only person who finds the idea more than a bit of overkill.

Lots of "look what we can do!" code ideas should be seen as "what NOT to do."
Radical Language Modification*

(Coined, AFAIK, by Richard Suchenwirth over at the Tcler’s Wiki. So yeah, sorry, it’s a term used when discussing code that uses certain special features of Tcl.)
Heh, not listed on that acronym page I linked.

Maybe as part of the FAQ here is listing acronyms like RLM. :)
Lots of "look what we can do!" code ideas should be seen as "what NOT to do."

I am guilty of this. Sometimes you just play with stuff to play with it. As long as no one is recommending doing it in real code, its entertaining and even has some capacity to help understand by digging into how things really work.
I am as "guilty" as you, jonnin. I certainly wouldn't show most of my "experiments" to the world, especially as "this is the 'One True Way' to code."
Experimentation is fun though, but yeah there are certain things to avoid. Fun should be kept in the fun box, not work box.
There is nothing wrong with mixing your “fun” and “work” boxes.

There is something wrong with abusing the language to break common idioms, though.
For me programming is entirely in the fun box. Fun and learning box.

Work.....that's a four letter word. *ICK!*
There is nothing wrong with mixing your “fun” and “work” boxes.


Hmmm, now that I think of it, yes; there is no problem mixing them.
Though, I'm sure that me spending almost a month learning WIN32 API definitely counts more as a "fun" thing, because:

A) Modern developers making C++ GUIs are certainly not going to use outdated, obselete tools from 300 million years ago, and

B) Spending a month making a program with ~7200 lines of code is probably considered too slow for a work environment.

Topic archived. No new replies allowed.