About teaching/learning C++

Pages: 123
what is interesting, is that (again according to Stroustrup) there is a fear that the language may collapse to 2 or more branches in the future. that is programmers and language may gloriously split like the church in 1054. (ie. 2 or more separate but similar C++ languages)
That's been the case for decades already. The language is so large that different people know and/or use different subsets of it. Consider how different code looks for someone who doesn't use std::unique_ptr and RAII compared to that of someone who does.
I consider myself lucky picking up C++ first. Other languages feel intuitive, and learning them feels like I'm cheating almost when doing normally complex tasks needs fewer lines of code.

I've been using unique_ptr whenever I personally use pointers, but for coding assignments I assume the professor wants us to have full control over our memory.

Though, if I had been learning C++ from my college classes, I'm fairly certain THAT would have been a horrible experience. When learning as my first language at my own pace and with thorough details, it was pretty amazing.
A lot of the perceived problems with C++ as a first language is likely HOW it is taught. Most of the instruction is, to be nice about it, horrible. It is taught very poorly.
That's been the case for decades already.

Yes... on top of dialects (modern c++ but not using 100% of all 'new' features, eg I won't use auto very much), you have microsoft's xor heavy version, early 90s version (still in use, see 10000 posts on turbo C++), modern version, and then you could start talking about children and grandchildren languages that basically took the guts of C++ and made a new language from it (dozens!).
zapshe wrote
Though, if I had been learning C++ from my college classes, I'm fairly certain THAT would have been a horrible experience. When learning as my first language at my own pace and with thorough details, it was pretty amazing.

I second that, C++ is my first language too and I learned it myself first by reading a book written in my local language and later by using online resources, it took time but it was easy.

because C++ standard was still 98 then, I guess that is the reason why I learned old idioms and practices.
also tried out several libraries, liked none, and that made me learn low level language and various idioms by writing my own implementations.

I'm not professional programmer, and C++ is my only language, I'm not even thinking about learning other languages because that time is better spent on learning more of C++, because learning curve is great, and there are many useful libraries, like game engines which are big enough to learn more and more.

however when I see what kind of homework people are being assigned just by looking at their assignments it must be pretty boring and horrible experience.

I think, anyone seriously willing to invest time in C++ is already smart enough just by making that decision to learn it all by itself.

Last edited on
@lastchance
haha, good one! according to this we are all true haxors here ;)
The tag on myth 5 -- Myth 5: “C++ is for large, complicated, programs only” -- in the "Five Popular Myths about C++, Part 3" is a bit of interesting commentary on how C++ is taught.

https://isocpp.org/blog/2014/12/myths-3

6.2 Hello, World!

C++ is a compiled language designed with the primary aim of delivering good, maintainable code where performance and reliability matters (e.g., infrastructure [10]). It is not meant to directly compete with interpreted or minimally-compiled “scripting” languages for really tiny programs. Indeed, such languages (e.g. JavaScript) – and others (e.g., Java) – are often implemented in C++. However, there are many useful C++ programs that are just a few dozen or a few hundred lines long.

The C++ library writers could help here. Instead of (just) focusing on the clever and advanced parts of a library, provide easy-to-try “Hello, World” examples. Have a trivial-to-install minimal version of the library and have a max-one-page “Hello, World!” example of what the library can do. We are all novices at some time or other. Incidentally, my version of “Hello, World!” for C++ is:

1
2
3
4
5
6
#include <iostream>

int main()
{
   std::cout << "Hello, World\n";
}


I find longer and more complicated versions less than amusing when used to illustrate ISO C++ and its standard library.

So schools and universities seem to be intent on teaching outdated C++, and C++ library writers wander off into the nit-picking minutiae of technical jargon.

Oh, if only there was some middle ground.

Incidentally, that "Hello World" example above is what I'd use to teach someone new to C++ as the first program they create.
Last edited on
Topic archived. No new replies allowed.
Pages: 123