且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python for C ++开发人员

更新时间:2022-10-17 23:36:44

I从来没有真正理解语言X的语言Y开发人员的方法。当我去寻找学习语言X,我想学习如何以语言X程序员的方式编程,而不是语言Y程序员做的方式。我想学习我所学习的语言特有的特征,习语等。我想能够利用使语言特别的东西,并利用这些知识来扩展我的思维方式和解决问题。我不认为我会从另一种语言的上下文中构建的教程中获得相同的见解。如果你可以学习你的第一语言没有针对你已经知道的东西的教程,你应该能够以同样的方式获取第二种语言(在我的经验,更多的语言,你知道更容易学习新的语言)。



据说,我会建议 Python教程作为使用Python和深入Python 作为一个更完整的介绍,也是可行的,好的,快速,简单的方式免费此处。我也同意其他人所说的关于标准库的代码作为一个好的例子和设计实践的源代码,标准的python库很干净,容易阅读。


I'm a long time C++/Java developer trying to get into Python and am looking for the stereotypical "Python for C++ Developers" article, but coming up blank. I've seen these sort of things for C#, Java, etc, and they're incredibly useful for getting up to speed on language features and noteworthy differences. Anyone have any references?

As a secondary bonus question, what open source Python program would you suggest looking at for clean design, commenting, and use of the language as a point of reference for study?

Thanks in advance.

I never really understood the "Language X for Language Y developers" approach. When I go looking to learn Language X I want to learn how to program in it the way that Language X programmers do, not the way Language Y programmers do. I want to learn the features, idioms, etc. that are unique to the language that I am learning. I want to be able to take advantage of the things that make the language special and use that knowledge to expand my ways of thinking and solving problems. I don't think I would get the same sort of insights from a tutorial that was framed in the context of another language. If you can learn your first language without a tutorial geared towards something you already know you should be able to pick up a second language the same way (and in my experience, the more languages you know the easier it is to learn new ones).

With that said, I would recommend The Python Tutorial as a good, quick, and easy way to get going with Python and Dive Into Python as a more complete introduction, also available for free here. I would also agree with what others have said regarding looking at the code for the standard libraries as a source of good examples and design practices, the standard python libraries are pretty clean and easy to read.