The Zen of Python - Tim Peters

The Zen of Python

Tim Peters


Long time Pythoneer Tim Peters succinctly channels the BDFL’s guiding principles for Python’s design into 20 aphorisms, only 19 of which have been written down.


The Zen of Python

Beautiful is better than ugly.

Explicit is better than implicit.

Simple is better than complex.

Complex is better than complicated.

Flat is better than nested.

Sparse is better than dense.

Readability counts.

Special cases aren't special enough to break the rules.

Although practicality beats purity.

Errors should never pass silently.

Unless explicitly silenced.

In the face of ambiguity, refuse the temptation to guess.

There should be one-- and preferably only one --obvious way to do it.

Although that way may not be obvious at first unless you're Dutch.

Now is better than never.

Although never is often better than *right* now.

If the implementation is hard to explain, it's a bad idea.

If the implementation is easy to explain, it may be a good idea.

Namespaces are one honking great idea -- let's do more of those!


پائتھون فلسفہ 

خوبصورت بدصورت سے بہتر ہے
نہاں پنہاں سے بہتر ہے
سادہ پیچیدہ سے بہتر ہے
پیچیدہ الجھے ہوئے سے بہتر ہے
ہموار تہہ دار سے بہتر ہے
غیر گنجان گنجان سے بہتر ہے
پڑھنے میں آسانی اہم ہے
استثنائی واقعات کو بھی قواعد سے استثنا نہیں
گو عملیت برتر ہے خالصیت سے
غلطیاں خاموشی سے نظرانداز نہیں ہونی چاہیے
تاوقتیکہ اعلانیہ خاموش کروا دی جائیں
ابہام کی صورت میں گمان کی ترغیب مسترد
ایک اور صرف ایک ترجیحی طریقہ کام کرنے کے لیے
گو وہ طریقہ شروع میں اتنا نمایاں نہ ہو اگر آپ ڈچ نہیں
ابھی کبھی نہیں سے بہتر ہے
گو کبھی نہیں اکثر "بالکل" ابھی سے بہتر ہوتا ہے
اگر ترغیب کو واضح کرنا مشکل ہے تو یہ ایک برا خیال ہے
اگر ترغیب کو واضح کرنا آسان ہے تو یہ ایک اچھا خیال ہو سکتا ہے

نیم اسپیس  ایک زوردار سوچ ہے ۔۔۔ اسے اور زیادہ سوچتے ہیں 

No comments:

Post a Comment

Popular Posts