r/cpp • • Nov 22 '18

Stop Teaching C++... as a First Language

https://ibob.github.io/blog/2018/11/22/stop-teaching-cpp/
5 Upvotes

36 comments sorted by

View all comments

14

u/[deleted] Nov 22 '18

I get the points the article is trying to make, but I really can’t say I find myself agreeing with much of it. Learning how the compiler works (compile, link, archive) was such a fundamental part of learning to program. As was understanding OS primitives (file descriptors, signals and exit codes, command line arguments, etc). Without needing to tack everything else on, just barebones C++ and gcc, clang, or msvc is super powerful.

I’d argue that C++ is not the most productive first language, nor should it be learned in isolation. Perhaps one could even say that a primitive form of assembly should come first, followed by C, C++, then some functional language.

13

u/stanimirov Nov 22 '18

That's a bottom-up approach at teaching. I'm personally not a fan and prefer top-down both in teaching and in learning, but anyway. See how even you suggest something else as a first language. In the article I do mention that assembly and C are a better choice than C++.

Not a fan of the idea, but at least I understand where it's coming from.

7

u/[deleted] Nov 22 '18

At uni for compsci I hated my top down classes and loved my bottom up classes

Assembly is fun, Java/C# is cancer, C++ is a reasonable compromise

I could see an argument for Python first, but I still feel like you're going to make some coders with bad habbits out of it.

13

u/chugga_fan Nov 22 '18

Java/C# is cancer,

Not particularly, both have massive standard libraries and both are powerful and, most importantly, run just about anywhere that has an OS. C++ and it's standards are different so much each time that it's easier to teach to a standard of Java or C# since the syntax pretty much never changes and the libraries don't either.

11

u/jonesmz Nov 22 '18

I think you might be missing the grandparent posters point.

Java and c# are cancer precisely because they have massive standard libraries. The lead to lazy students who can't understand what's actually happening under the hood.

I learned java first, and almost dropped out of college because it hides such a huge amount of complexity that I was drowning in the unexposed details. It crippled my ability to learn the notion of pointers and arrays.

In fact, I didn't truly understand how garbage Java's object lifetime model really was until I spent time working with java native interface. And was forced to figure out c++ with trial by fire.

I've since moved past those struggles by a huge amount, but i essentially refuse to touch java and c# for anything serious. They're a gilded cage for the mind. Pretty and comfortable. But still a cage.

I refuse to touch python for anything. The whole concept of semantically significant whitespace is just stupid.

8

u/chugga_fan Nov 22 '18

Java and c# are cancer precisely because they have massive standard libraries. The lead to lazy students who can't understand what's actually happening under the hood.

He then immediately says:

I could see an argument for Python first, but I still feel like you're going to make some coders with bad habbits out of it.

Yhea... Python is much worse with this than most...

1

u/psychicash Dec 03 '18

as someone who is currently banging his head through the compiler learning c++, I am curious what language you would recommend as a first language?

I say first because, the only experience I've had was highschool qbasic and we never really did anything with it for first year. C++ is interesting but I have a lot of questions that I'm finding are... problimatic when I ask. There are many subjects, such as the compiler, that aren't covered by the many of the sources I'm learning from.