Notice: Undefined index: order_next_posts in /nas/content/live/gadgetmag/wp-content/plugins/smart-scroll-posts/smart-scroll-posts.php on line 194

Notice: Undefined index: post_link_target in /nas/content/live/gadgetmag/wp-content/plugins/smart-scroll-posts/smart-scroll-posts.php on line 195

Notice: Undefined index: posts_featured_size in /nas/content/live/gadgetmag/wp-content/plugins/smart-scroll-posts/smart-scroll-posts.php on line 196

Python development – the golden rules

As part of his Python Development Masterclass, Kunal Deo drew up some golden rules when working with Python. Have you got any Python gems to share?

As part of his massive Python Masterclass article, Kunal Deo drew up some golden rules when working with Python. Click here to jump straight to the article, or add a few of your own golden rules in the comments thread below…

Keep it simple
“Things should be as simple as possible, but no simpler.” (Einstein)

Do one thing well
The UNIX Philosophy certainly applies here.

Don’t fret!
Don’t fret too much about performance – plan to optimise later when needed.

Go with it
Don’t fight the environment and go with the flow.

No-one’s Perfect
Don’t try for perfection because ‘good enough’ is often just that.

Minor shortcut
(Hence) it’s okay to cut corners sometimes, especially if you plan to optimise later.

Learn from the masters
Borrow ideas from elsewhere whenever it makes sense.

Think Cross-platform
The Python implementation should not be tied to a particular platform. It’s okay if some functionality is not always available, but the core should work everywhere.

Stop bugging me (that’s Window’s job)
Don’t bother users with details that the machine can handle.

A large complex system should have multiple levels of extensibility. This maximizes the opportunities for users, sophisticated or not, to help themselves.

Senseless fatalities
Errors should not be fatal. That is, user code should be able to recover from error conditions as long as the virtual machine is still functional. At the same time, errors should not pass silently.

Bug off
A bug in the user’s Python code should not be allowed to lead to undefined behavior of the Python interpreter; a core dump is never the user’s fault.

You can find Linux User & Developer’s Python Development Masterclass here.

[twitter username=”linuxusermag”]