My idea is simple: I think we should start writing articles that promote the use of C++'s features and library: iterators, containers, algorithms, lambda functions, and so on. To promote a cleaner "C++ style" over a mixed C/C++ style.
This might be a bit radical, but shooting down what college professors normally teach in a very explicit manner could also open some eyes. The eyes that I speak of are those of the professors and course designers. There are many bad examples available from online course notes from various universities, and I think it might do well to put a few under the knife and expose the problems.
Don't worry about the return type, 'size_t' -- you can think of it as 'int'.
Sorry, but size_t is actually a typedef for volatile uint64_t***** const. I changed it. Seriously though, this is the very reason that many beginners are so utterly clueless.
This strlen function is described on p. 233 (and p. 652). Don't worry about the return type, 'size_t' -- you can think of it as 'int'.
If you read that as anything more than "Don't worry about the return type, 'size_t', it will be explained later. For now just think of it as an integer." then that is your problem. Sometimes you need to gloss over some things without taking mass detours to explain things that are not relevant quite yet.
And the C v C++ style is BS as well. You really shouldn't avoid a paradigm of the language just because you think Object Orientation is the mutts nuts.
STL can mean: (1) C++ standard library; (2) the library Stepanov designed; (3) the parts of [1] based on [2]; (4) specific vendor implementations of [1], [2], or [3]; (5) the underlying principles of [2]; (6) The parts of [1] only in C++03. So the term is highly ambiguous, and must be used with extreme caution. If you meant [1] and insist on abbreviating, "stdlib" is a far better choice.
And the C v C++ style is BS as well. You really shouldn't avoid a paradigm of the language just because you think Object Orientation is the mutts nuts.
If you're gonna teach a C++ class, teach a C++ class. You don't have to teach OOP, but teach the language. Don't teach the C subset of the language. When I took a C++ class, the only C++ feature we touched for the first ~6 weeks was iostream (probably because it's easier). Everything else was method-less structs, C-style strings, raw pointers, raw arrays, etc.
I would much rather learn from a college professor than a beginner from an online forum.
What was the point of this? Nobody said "hey let's just have beginners on a random forum teach C++ classes".
But C is part of, and I would argue fundamental to, C++.
And should be taught in a C class. You don't go into a calculus class and spend the whole time learning algebra because it's fundamental to it. You learn that in an algebra class.
@ResidentBiscuit
Makes sense to me to do it that way. After all, the OOP part of C++ sits atop the procedural part that it inherited from C. You don't build a house roof-first. Also, you can't have OOP without procedural code, the methods are basically just procedures. OOP is an extension to procedural programming, and you can't build an extension without something to extend.
@Chrisname, refer to my last post. I'm not saying you shouldn't understand the basics of C first. I'm just saying don't teach a C++ class and only actually teach C.
Oddly, when someone asks "should I learn C before C++" people tend to say no and occasionally add that it might teach wrong practices. How do you feel about that?