码迷,mamicode.com
首页 > 编程语言 > 详细

How to become a proficient Python programmer - 如何成为Python高手

时间:2015-04-01 09:30:46      阅读:319      评论:0      收藏:0      [点我收藏+]

标签:python   函数式编程   编码   测试   性能   

http://blog.csdn.net/pipisorry/article/details/44801859

How to become a proficient(熟练的) Python programmer如何成为Python高手

Spoiler: This post is primarily gonna be an excerpt(摘录) of my bookmarks collection. That’s because more intelligent men than me have already written great articles on the topic of how to become a great Python programmer.

I will focus on four primary topics: Functional programming, performance, testing and code guidelines. When those four aspectsmerge(合并) in one programmer, he or she will gaingreatness(伟大) no matter what.

Functional programming函数式编程

Writing code in an imperative(必要的) style has become the defacto(事实上的) standard. Imperative programs consist of statements that describe change of state. While this might sometimes be a performant way of coding, it sometimes isn’t (for example for sake of complexity(复杂)) – also, it probably is not the mostintuitive(直觉的) way when compared withdeclarative(宣言的) programming.

If you don’t know what I’m talking about, that’s great. Here are some starter articles to get your mind running. Butbeware(当心), it’s a little like the red pill
– once you tasted functional programming, you don’t want to go back.

Performance性能

There’s so much talk going on about how inefficient(无效率的) these ‘scripting languages’ (Python, Ruby, …) are, that it’s easy to forget that very often it’s the algorithm chosen by the programmer that leads to horrible runtime behaviour.

Those articles are a great place to get a feel for the ins and outs of Python’s runtime behaviour, so you can get your high performing application writting in a language that isconcise(简明的) and fun to write. And if your manager asks about Python’s performance, don’t forget to mention that the second largest search engine in the world is run by Python – namely Youtube(see Python quotes).

Testing测试

Testing is probably one the most misjudged topics in computer science these days. Some programmers really got it andemphasize(强调) TDD(test driven development) and it’s successor BDD(behaviour driven development) whereever possible. Others simply don’t feel it yet and think it’s a waste of time. Well, I’m gonna be that guy and tell you: If you haven’t started out on TDD/BDD yet, you have missed out greatly!

It’s not about introducing a technology to replace that release management automaton(自动机) in your company that mindlessly clicks through the application once in a while, it is about giving you a tool to deeply understand your own problem domain – to reallyconquer(战胜),manipulate(操纵) and twist it the way you want and need it to be. If you haven’t yet, give it a shot. These articles will give you someimpulses(冲动):

Code guidelines编码规范

Not all code is created equal. Some can be read and changed by any great programmer out there. But some can only be read and only sometimes changed by the original author – and that maybe only a couple of hours after he or she wrote it. Why is that? Because of missing test coverage (see above) and the lack of proper usage of coding guidelines.

These articles establish an absolute minimum to adhere(坚持) to. When you follow these, you will write more consise and beautiful code. As a side effect it will be more readable andadaptable(适合的) by you or anyone else.

from:http://blog.csdn.net/pipisorry/article/details/44801859

ref:http://blog.dispatched.ch/2011/06/12/how-to-become-a-proficient-python-programmer/


How to become a proficient Python programmer - 如何成为Python高手

标签:python   函数式编程   编码   测试   性能   

原文地址:http://blog.csdn.net/pipisorry/article/details/44801859

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!