C++ inline vs. method

Robin2:
It's impossible to stay away from such an exciting debate ...

I agree, although perhaps to the chagrin of some who have no doubt had this debate many time over. (Sorry.)

Robin2:
I don't use GOTO but I reckon there is no great harm in using it within a function. I suspect it got its bad name because (back in the old BASIC days) it was used all over the place - probably because there were no functions (I can't remember).

There were subroutines in BASIC -- at least some of flavors I used. I don't know enough of the history to recall whether they've always existed, or if that was an extension (perhaps proprietary) along the way. I do remember not all BASIC was perfectly compatible. The days I spent in QBasic and VB, I lacked the perspective of much else, although I've programmed a TRS-80, a C-64, and an Apple IIe as well. I couldn't tell you anything now about the difference or similarities. At that age, I only knew so much. I seem to remember at least Apple programs had a ton of gotos, and required line numbers (?), so subs may not have been an option there.

Robin2:
At the same time I think it is best to discourage it (just as it is good to discourage the use of interrupts by beginners) because of the risk of finding all the code for a project in loop() with no other functions and GOTOs jumping all over the place.

That is the closest I can find to a reasonable argument against goto, and I find myself willing to stand behind those who do in a particular thread. I can't help but feel we do a disservice to those learning by preventing them from making mistakes though. Everyone needs to write bad code to appreciate how good code differs, and why it matters. Everyone needs to burn out an LED and an output pin to realize why resistors matter.

So, my theory is -- don't hide the tools that can be misused. Advocate for awareness instead. But at least I do understand this point. Thanks for taking the time to chime in. :slight_smile: