C++ teaching methods

Hello. I started learning C++ programming outside school as an extra a few weeks ago. My teacher tells me that I should use arrays instead of vectors, even if it's 1000x more convenient to use vectors, because that's what the learning program demands. Also she tells me not to use shortcuts like pow() or std::sort, but write my own algorithms instead. Is this the way to program and learn? In my eyes you should write as little code as possible instead of reinventing the wheel, work smart, not hard. What do you think?
Last edited on
It's a little like learning to ride a horse. Horse riding was the primary form of land transportation for centuries. One should know how to ride a horse, care for it, shoe it, etc. It's great exercise, teaches you how to appreciate and work with animals, etc. etc. etc. Horse riding is an absolutely essential part of humanity.

On the other hand, if you have an automobile.....

On a more serious note, I think that when starting out, students can use all the help they can get. Heck, I think BASIC is a good way to get people used to the basic ideas of programming without burying them in esoteric details.

If you continue programming then I suggest that it would be helpful to implement some of these algorithms for yourself. That way you will have a good sense of what they do and what their limitations are.
closed account (E0p9LyTq)
Bjarne Stroustrup's "Programming: Principles and Practice Using C++ (2nd Edition)" teaches vectors in Chapter 4 (4.6) long before he teaches using vectors and C-style arrays (chapter 18).

He teaches graphics and GUI design beginning in Chapter 12!

That should give you a good idea which should be used in modern C++ programs, vectors or C-style arrays.

It seems the person (or persons) who created the curriculum don't have an understanding of what post-C++11 tools are available, they likely don't have a clue what the standards are even with C++03.
Is it even worth to continue learning there then? If what I get is knowledge about the language as it was in the last millennium, there are better ways I could be spending my time. I would still want to continue learning C++ though. What is the best way to do so by yourself? The internet or maybe books? If so, what books would you recommend?
use your keyboard and code , when you get a crash , fix it. (you will)

there are most complex data structure than continuous ones.

there is several sorting , you might have to write one.

you might have to write pow using recusion.

writing little code does not equals better. Believe me that 1 million instructions is nothing for the cpu.

little code does not means little assembly. Try a simple function using const char* , look at the assembly , then simply add #include <iostream> , and use cout , then look again in the assembly . You should get thousands of instructions.. I am not saying it slows down , but ...
closed account (E0p9LyTq)
DDomjosa wrote:
Is it even worth to continue learning there then?

Formal instruction has a place when learning C++, as well as independent learning from books and websites.

Hard to ask a book or website for clarification when you don't understand something.

I've spent years learning C++ on my own, from books and websites. I haven't had a day of classroom instruction. And still I don't know more than a bit of the basics. I am constantly learning something when the C++ experts here post a bit of source, even on simple concepts.

The core C++ language derived from C didn't change with C++11, IMO most of the change happened with the C++ libraries.
Last edited on
Topic archived. No new replies allowed.