简体   繁体   English

在学习Python之前学习C / C ++值得吗?

[英]Is it worth learning C/C++ before learning Python?

I want to learn python, but I feel I should learn C or C++ to get a solid base to build on. 我想学习python,但我觉得我应该学习C或C ++以获得可靠的基础。 I already know some C/C++ as well as other programming languages, which does help. 我已经知道一些C / C ++以及其他编程语言,这确实有帮助。 So, should I master C/C++ first? 那么,我应该先掌握C / C ++吗?

In my opinion it's better to start learning Python. 在我看来,最好开始学习Python。

I found it easier to learn then C or C++. 我发现学习C或C ++比较容易。 It has libraries to do virtually anything you might need, and can do essentially anything. 它拥有可以执行任何您可能需要的任何操作的库,并且可以执行任何操作。

The only reason to use a more difficult language like C/C++ is if you need the performance or are writing code for an embedded system. 使用更难的语言(如C / C ++)的唯一原因是,如果您需要性能或正在为嵌入式系统编写代码。 They are not, however, what you should be learning initially. 但是,它们不是你最初应该学习的东西。

C# is a fine language, but nothing beats Python for ease of use. C#是一种很好的语言,但是为了易于使用,没有什么能胜过Python。

The scope of Python is quite broad, here are some examples: Python的范围非常广泛,以下是一些示例:

  • Create a website (Django, etc.) 创建一个网站(Django等)
  • Create scripts to do tasks ranging from image manipulation to server maintenance 创建脚本以执行从图像处理到服务器维护的任务
  • Create GUIs (Tkinter, etc.) 创建GUI(Tkinter等)
  • Create games (pygame) 制作游戏(pygame)
  • Scientific computing (SciPy) 科学计算(SciPy)

Python can interact directly with arbitrary C code, meaning anything which can be done in C, can be done in Python with a little work. Python可以直接与任意C代码交互,这意味着可以在C中完成的任何事情都可以通过一些工作在Python中完成。 Python is popular enough that an interface has been created for virtually everything already. Python很受欢迎,已经为几乎所有东西创建了一个界面。

For a better look at what can be done with python out of the box, take a look at the standard library which comes with python: http://docs.python.org/library/ 为了更好地了解python可以使用的方法,请查看python附带的标准库: http//docs.python.org/library/

In short, if it can be done with a computer, and doesn't require the speed of C/C++, it can be done with Python. 简而言之,如果它可以用计算机完成,并且不需要C / C ++的速度,那么可以用Python完成。

I would say it depends on what you want to achieve (cheesy answer...) 我会说这取决于你想要达到的目标(俗气的答案......)

The truth is, learning language is a long process. 事实是,学​​习语言是一个漫长的过程。 If you plan on learning a language as a step toward learning another language, you're probably wasting your time. 如果你打算学习一门语言作为学习另一种语言的一步,你可能会浪费你的时间。

It takes a good year to be proficient with C++, and that is with basic knowledge of algorithms and object concepts. 精通C ++需要一年的好时光,那就是算法和对象概念的基础知识。 And I only mean proficient, meaning you can get things done, but certainly not expert or anything. 我只是意味着精通,意味着你可以完成任务,但肯定不是专家或任何事情。

So the real question is, do you want to spend a year learning C++ before beginning to learn Python ? 所以真正的问题是,你想在开始学习Python之前花一年时间学习C ++吗?

If the ultimate goal is to program in Python... it doesn't seem worth it. 如果最终的目标是用Python编程......它似乎不值得。

Real mastery of a language takes time and lots of practice .. its analogous to learning a natural language like French . 对语言的真正掌握需要时间和大量的练习......它类似于学习像法语这样的自然语言。 you have to do a lot of practice in it. 你必须做很多练习。 but then different languages teach you different programming methodologies. 但随后不同的语言会教你不同的编程方法。
python and c++ are all object oriented languages so you will be learning the same programming methodology The order in which you learn languages doesn't really matter but starting from a lower abstraction to higher one makes understanding some things easier.. python和c ++都是面向对象的语言,因此您将学习相同的编程方法学习语言的顺序并不重要,但从较低的抽象开始到较高的抽象,可以使理解某些事情变得更容易。

在我看来,你应该在尝试学习C或C ++之前学习Python,因为你会更好地理解核心概念,C ++比Python要低,所以你需要做更多的命令来做你能做的事情。 python中的一行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM