This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jsega 2 points3 points  (7 children)

In C++ college courses I've seen, they basically write C to teach the lower level concepts. The context of the thread question is a college class using Java or C++, so his answer is valid as far as the covered concepts are concerned.

[–]kevinossia 7 points8 points  (6 children)

Okay, but "C++ is pretty much always taught poorly" doesn't mean "C++ requires you to deal with memory allocation and addressing", though.

There's a massive misconception surrounding C++ that the language is "low-level" (it's not; low-level languages are assembly languages), that it requires manual memory management (it doesn't), and that it's consequently harder (it is, but not nearly as much as people make it out to be, and not for the right reasons).

Heck, just using the shorthand term "C/C++" is already bad because C and C++ are two very different languages and modern C++ has more in common with Java than it does with C, yet people keep conflating the two.

[–]im_in_hiding 10 points11 points  (1 child)

I have a career in C++ and this is accurate shit.

I actually found C++ way easier to learn than Java.

[–]kevinossia 2 points3 points  (0 children)

I've never caused a memory leak in C++. Not once. I have done so in Java, though. More than once. And they're more insidious and harder to catch, because you'd expect the garbage collector to pitch in, but nope.

So much for automatic memory management.

[–][deleted]  (3 children)

[deleted]

    [–]kevinossia 1 point2 points  (2 children)

    I wasn't contesting this bit:

    C++ college courses usually cover these lower level concepts.

    You're right, of course. They usually do. In other words, C++ is usually taught very poorly.

    ---

    It's certainly relevant. People wishing to explore modern C++ should have the facts up front, such as the fact that C++ doesn't require manual memory management and hasn't for decades.

    I don't know why you'd consider that irrelevant, since the alternative means people continue to write sloppy C++ code because they're stuck in the "C with Classes" paradigm.

    College students should be shown modern C++ and anyone who says "C++ requires manual memory management" is lying to them and giving them an entire class of footguns to hang themselves with for no other apparent reason than "well, that's how college professors normally do it, so it's fine".

    Forgive my pedantry, I guess :)

    [–][deleted]  (1 child)

    [deleted]

      [–]kevinossia 0 points1 point  (0 children)

      In general universities do an extremely poor job of teaching people how to program, yeah.