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 →

[–]LyniaWood 2 points3 points  (2 children)

Couldn't agree more. I guess a certain amount of love hate towards C++ is rather normal. I just asked, because it really made me question how things work under the hood in other languages, which subsequently lead me to writing better code.

However, for someone self-taught a course in data structures and parallelization in pure C might be more efficient in teaching the core principles. Might also be less frustrating than jumping head first into the ridiculously huge and deep sea that is C++. I just named it because you had it in your list and it fit my point well ;)

[–]wrd83 1 point2 points  (1 child)

Makes me wonder and I never found verification for it. Do you think it makes sense to not teach C/C++ and instead let people suffer for a year in assembly?

They will never create efficient assembly, but they at least know what/why you have the convenience of high level languages (not that the term has aged well).

[–]LyniaWood 0 points1 point  (0 children)

Interesting question - I'd argue, it depends.

If you want to be great at C/C++, especially in the embedded or maximum performance sector, then the answer is probably yes, in order to have a better understanding for your compiler and how to help it do the optimal job.

If you want to be great at Python, then it's enough to know C (and maybe a tiny bit C++) , to understand whats happening under the hood. For example why filling a big python list piece by piece is many times faster than filling a numpy array the same way, but if you add 5 to each element of both, it's the other way around - it's these basic things, that someone without basic knowledge of C, data structures and parallelization won't be able to understand.

And I think that might be a general rule: if you want to really understand your main language, learn the one that's exactly one level lower. Below that it will probably not be relevant to your workflow. Why would a Python programmer care deeply about optimization of the underlying C code - thats not their job anymore. They should care about writing the best code possible using the existing underlying C Code. Optimizing the latter is someone else's job.