On Sat, 19 Jun 2021, 09:55 Dave Jordan wrote:
As soon as I wrap my head around all these other new C++ concepts I will go back and add appropriate access specifiers.
For now there is little chance i will misapply my own functions/methods and i need to follow KISS.
Indeed, it sounds like a lot of the issue here is really just to do with the syntax of C/C++ and what constitutes "normal" practice in that syntax.
If it's unfamiliar to you, then anything can be tricky...
That said, most of the ALGOL style languages have broadly the same concept of scope and encapsulation and it's certainly the case that restricting the scope of elements usually prevents more problems than it causes, so it's generally a good idea to do that from the outset (and not try to shoehorn it in later!)
In terms of how that is done, fltk is pretty much like any simple C++ code, so general C++ examples are usually relevant.
We tend to show our samples packed into a single file for simplicity; the implicit assumption is that folk picking up fltk already know C++, of course, and will understand how to extend from there.
But if C++ is unfamiliar, then our examples are probably not the best teaching resource available for idiomatic C++ coding!
--
Ian
From my Fairphone FP3