Friday, July 31, 2015

10 Time-saving Tips for Pythonists

time-saving tips for pythonists

Python is a beautiful language, able to inspire love in its users. So if you're looking to get into programming, or if you're a bit tired of C++, Perl, Java and the rest, I recommend you give Python a try.

Python has many features that make it attractive to programmers. It's easy to learn, object oriented, byte-compiled, free and open-source. It also has run-time type checking, full and fast support, and extensive libraries for performing various tasks.

Efficiency with Python

In this article, I want to highlight some of the ways you can save time in Python and thus maximize productivity.

In preparation, I quizzed several Pythonists on their best time-saving tips. Here are the results …

1. Don’t Use Semicolons

Since using semicolons is considered optional in Python—as opposed to other object-oriented programming languages—you don’t need to end each statement of your code with a semicolon.

This may seem simple and not really time wasting; but once your code stretches into thousands of lines, all these semicolons can get a bit distracting, and it's a lot of unnecessary typing.

2. Get a Good Code Editor

Choosing the right Python editor can be a huge time saver. Many new Python programmers are confused over which code editor to pick—especially with so many available.

It's very disruptive to get used to one editor and then have to change to another, so it's best to start with a good one. Make sure whichever you choose does flake8 and PEP8 in real time.

For guidance on which editor to choose, see my previous article on Which Code Editors Do Pythonists Use?

3. Follow the Python Code Style

example of Python styleFollowing the Python code style can enhance the readability of the code, and thus saves time while walking through your code. (The design philosophy of Python emphasizes the issue of code readability.)

Continue reading %10 Time-saving Tips for Pythonists%


by A. Hasan via SitePoint

No comments:

Post a Comment