TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Learning C++ or Python

5 点作者 pydox超过 7 年前
I am noob to programming. I don't know much about computer science, or say nothing. What should I learn C++ or Python, and why?

10 条评论

kotrunga超过 7 年前
I guess it depends on what you want to do, and what your goals are.<p>- 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...<p>If you want to learn about computer science, what it&#x27;s all about, see if you like it, I would say Python over C++. As others have mentioned, it&#x27;s definitely a more gentle introduction than C++ for a beginner. However, I would definitely recommend trying to learn&#x2F;build&#x2F;do something that you&#x27;re interested in, especially if you&#x27;re testing the &quot;waters&quot; of CS. Python is pretty cool, because there&#x27;s so much you can do with it. Anything from game design to full stack dev- python can do it. Not that C++ can&#x27;t do those things either, but it will be a much simpler start using Python.<p>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.<p>In the end, it depends on what you want to do. Whatever you decide, stick to it. Have a goal- like, I&#x27;ll read through this Python book. Or, I&#x27;ll make a breakout clone. Or something like that- once you complete the goal, decide if you want to pick another. It&#x27;s all too easy to start and stop, not get anything really completed, and have an incomplete understanding. Check this out: <a href="http:&#x2F;&#x2F;norvig.com&#x2F;21-days.html" rel="nofollow">http:&#x2F;&#x2F;norvig.com&#x2F;21-days.html</a><p>And most of all, have fun. Don&#x27;t do it if you&#x27;ll be miserable. Programming should be an adventure; especially when you&#x27;re learning. (hint: you&#x27;re always learning)
twobyfour超过 7 年前
Python in order to understand the core concepts of programming, because it&#x27;s easy to pick up.<p>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.<p>C++ used to be a superset of C, but my understanding is that it no longer strictly is. However, you&#x27;ll likely find C++ easier to understand once you have a solid grasp of the low-level programming principles C will teach you.
auxym超过 7 年前
I think the important question here is, why do you want to learn? That will have a great effect on the answer.<p>As others have said though, if you have never-ever programmed, python will be a gentle an introduction as they come.
shortoncash超过 7 年前
You can learn C++ if you want, but don&#x27;t get frustrated if you don&#x27;t understand everything. Baby steps. You will be refining your knowledge for years.
slap_shot超过 7 年前
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超过 7 年前
Python <a href="http:&#x2F;&#x2F;buklijas.info&#x2F;blog&#x2F;2017&#x2F;02&#x2F;01&#x2F;automate-the-boring-stuff-with-python-book-review&#x2F;" rel="nofollow">http:&#x2F;&#x2F;buklijas.info&#x2F;blog&#x2F;2017&#x2F;02&#x2F;01&#x2F;automate-the-boring-stu...</a>
Davidbrcz超过 7 年前
Definitively Python for a learning programming. C++ is a huge language, full of traps and pitfalls. It is an expert friendly language.
IpV8超过 7 年前
Python. Then you can make snake puns whenever you can&#x27;t come up with good variable names.
azimsai超过 7 年前
Python
crash_bucket超过 7 年前
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.<p>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&#x27;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.<p>Bonus Unsolicited advice- Don&#x27;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&#x2F;or libraries are worth pursuing next based on what areas of CS you&#x27;re finding yourself interested in. The skills and tools worth mastering are whichever ones allow you to work on projects that you&#x27;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&#x27;s yours then so be it.<p>Good Luck! Have fun!