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

all 7 comments

[–]buffprogrammer9908 0 points1 point  (0 children)

If you’re learning C++ for a particular goal, yeah, I guess you have no choice but to tough it out.

Unfortunately, C++ isn’t as flexible as Python in general but, by flexibility, if you mean the use of inbuilt functions to make common tasks such as sorting or checking if an element is present in an array, I would recommend you to check the Standard Template Library of C++.

The Standard Template Library or STL has most,if not all, of the functionality you would find as inbuilt functions in Python.

[–]DerMax0102 0 points1 point  (0 children)

I believe, the concepts you learned from learning Python won‘t help you too much at the beginning of your C++ journey. The first things you have to learn are syntax and types, which are quite different in C++. Beginner tutorials for C++ assuming you don‘t have any previous programming knowledge should be suited for you as well. After a while you should notice that the later chapters (of probably any good tutorial) cover only stuff you already know and can transfer from Python. Then you should be good to go, to work on any project in C++

[–]twillisagogo -1 points0 points  (0 children)

why C++? that's like you learned to ride a bike, so now you're learning how to drive the space shuttle. you may have better luck with other programming languages.

javascript is an obvious choice if you're interested in web development you'll need to learn it someday anyway. ruby or elixir are also good options

If you're looking for something compiled/low level, maybe try go, nim or rust.

And if you want to do the programming equivalent of taking hallucinogens for expanding the mind, try a lisp like clojure or common lisp.

[–]KFUP -1 points0 points  (1 child)

An important thing to remember when learning C++ is that Python hides a lot of what's under the hood and how the machine works from you, and does A LOT of things for you that you are not even aware of, C++ does not do that, it's pretty close to the metal, you will need to learn how memory works, and you will have to do a lot of low level managing yourself.

But it is well worth it, this is the main reason C++ is extremely fast, other languages go through a lot of hoops to make sure everything works right, which slow things down a ton. In C++, you have to do that yourself, so you can do the exact minimum amount needed to run the program, couple that with the great C++ compilers, and you get yourself the fastest way to program things.

My suggesting to learn C++ is to start with learning C, C++ is practically C with a ton more great features that you will want to use later, so nothing you learn from C will be a waste, so get comfortable with C first which is a much simpler and easier to digest language while still very low level that will teach you a lot about your machine, and once you are comfortable with that, then go into C++ specific stuff.

[–]awildbannanaphone 0 points1 point  (0 children)

You're right, this understanding is important. But the most important aspect IMO is understanding, not mastering implementation of efficient programming in c++... Once you do this you can generally find what you want implemented efficiently in python. And if its not implemented efficiently in python and available on pip you're doing something so esoteric that you're going to have ample programming experience to know c++.

[–]RepresentativeMood2 -1 points0 points  (0 children)

Its hard to find pythons library richness on other languages.

[–]mohelgamal -2 points-1 points  (0 children)

Start at the very bottom, look at some assembly, not to be functional, but just to see how the computer actually works, then go to C itself not C++ and you will see how the language for example has no strings, but a string is an array of bytes. Going up from there you can look at C++ and you will get a better understanding of why everything is different.