
Ask HN: Learning C++ or Python - pydox
I am noob to programming. I don&#x27;t know much about computer science, or say nothing. What should I learn C++ or Python, and why?
======
kotrunga
I guess it depends on what you want to do, and what your goals are.

\- Are you going into a school, and want to do CS, and both of those languages
are in the curriculum? \- Do you want to do game development for a specific
platform? \- etc...

If you want to learn about computer science, what it's all about, see if you
like it, I would say Python over C++. As others have mentioned, it's
definitely a more gentle introduction than C++ for a beginner. However, I
would definitely recommend trying to learn/build/do something that you're
interested in, especially if you're testing the "waters" of CS. Python is
pretty cool, because there's so much you can do with it. Anything from game
design to full stack dev- python can do it. Not that C++ can't do those things
either, but it will be a much simpler start using Python.

However... if you know you want to program for the rest of your career, and
you want to settle in for the long haul, then I would do as twobyfour
recommended. I would start with either Python, or C (not C++). C will help you
learn the underlying concepts of CS and how stuff works, so when you are using
different data types in Python, you actually know what the heck is going on.

In the end, it depends on what you want to do. Whatever you decide, stick to
it. Have a goal- like, I'll read through this Python book. Or, I'll make a
breakout clone. Or something like that- once you complete the goal, decide if
you want to pick another. It's all too easy to start and stop, not get
anything really completed, and have an incomplete understanding. Check this
out: [http://norvig.com/21-days.html](http://norvig.com/21-days.html)

And most of all, have fun. Don't do it if you'll be miserable. Programming
should be an adventure; especially when you're learning. (hint: you're always
learning)

------
twobyfour
Python in order to understand the core concepts of programming, because it's
easy to pick up.

C (not C++) to understand the underlying principles of how software runs - the
stuff a modern language like Python abstracts away (memory allocation,
pointers, strings as arrays, etc.) C is a much simpler language than C++ -
easier to master and with fewer distractions from the fundamentals that one
would choose such a language in order to learn.

C++ used to be a superset of C, but my understanding is that it no longer
strictly is. However, you'll likely find C++ easier to understand once you
have a solid grasp of the low-level programming principles C will teach you.

------
auxym
I think the important question here is, why do you want to learn? That will
have a great effect on the answer.

As others have said though, if you have never-ever programmed, python will be
a gentle an introduction as they come.

------
shortoncash
You can learn C++ if you want, but don't get frustrated if you don't
understand everything. Baby steps. You will be refining your knowledge for
years.

------
slap_shot
Python. The most important part of leaning to program is to start building
things. You can build your first thing in an afternoon with Python.

------
sasa_buklijas
Python [http://buklijas.info/blog/2017/02/01/automate-the-boring-
stu...](http://buklijas.info/blog/2017/02/01/automate-the-boring-stuff-with-
python-book-review/)

------
Davidbrcz
Definitively Python for a learning programming. C++ is a huge language, full
of traps and pitfalls. It is an expert friendly language.

------
IpV8
Python. Then you can make snake puns whenever you can't come up with good
variable names.

------
azimsai
Python

------
crash_bucket
C++ and Python are the two languages I am most experienced with because they
were both a part of my undergrad CS curriculum. Full disclosure, I actually
prefer programming in C++. I like compiled languages and strongly-typed
languages. But forget that I said that. For your first programming language, I
would hands-down recommend learning Python.

Python was the first programming language I learned and it was also the
language that was used to introduce me to a lot of key ideas in programming.
It is much easier to understand than most programming languages for an
inexperienced person. What's more is that Python is also widely used in a
variety of academic and industry applications and no one will scoff at a cool
Python project. I have used it in everything from building failure-tolerant
distributed file systems to working in natural language processing.

Bonus Unsolicited advice- Don't worry too much about which language you should
learn after Python for now. Once you have gotten your programming basics down
with Python, then I would revisit which languages and/or libraries are worth
pursuing next based on what areas of CS you're finding yourself interested in.
The skills and tools worth mastering are whichever ones allow you to work on
projects that you're excited about. If you happen to be more excited about
making money than anything else, then simply look up what languages are very
popular with companies that are hiring. Not my style, but if it's yours then
so be it.

Good Luck! Have fun!

