But by the same token, a proper discussion of std:: cout will include namespaces, the overloading of the << operator, what << means when it's not overloaded, whatever the fuck std:: cout is in the first place (a global object??), how std:: endl flushes the buffer...
I just mean understanding it semantically, as like
A << B
puts B into A and it just kind of "works", whereas
printf("my number %g", B)
has stumbling blocks like whoops! B was actually typed as an int and now there's a garbage value in the console why's that happen? With a type safe function like the stream operator the student probably won't encounter any of the rough edges early on, so they won't even think to ask any of these questions they're unprepared for.
I'm looking forward to std:: print in C++23, which should make everybody happy.
Yeah that is definitely a huge improvement. Would be cool if C++ eventually got C# style string interpolation literals e.g.
$"Array value at {i} = {myArray[i]}"
. C# has actually come up with a kind of
esoteric api that allows interpolated string literals to avoid heap allocations, I expect C++ could work out something similar as well.
If I was designing a programming course it'd just be head first into using Python to analyze real world data sets. How many people diagnosed with type 2 diabetes require a below-the-knee amputation? Of those, what's the mean time between diagnosis and amputation? Does the patient's age at the time of diagnosis influence this? etc.
Sure, but you have to actually be able to use python before that's even possible. Yes, once you've learned a language you'll probably have enough of a foundation that you can just go straight into more practical applications in another language, but unfortunately you do need the boring principles first.
I'm of the mindset that if you give people real problems to solve they're going to be much more interested and they'll accidentally learn to program along the way.
In a similar vein though, I think unity can be pretty good as a practical learning tool. Very visual, wysiwyg, interactive. Helps keep the learner engaged. That said, they really should have a grasp on C# fundamentals (or other programming experience) before they touch unity. I've seen a lot of unity noobs get into weird cargo cult practices because they don't actually really know how the language works.
EDIT;
If only there were some way for the computer to tell you you did something wrong.
Well aware, but that only serves highlight the issue of the non-type safe api. It's something you have to think about in C, it's something that just works in C++. Again, not saying the api isn't perfectly usable, just that it's obtuse for beginners.