Coding learning Python version of Google

When learning something, of course, we need a guide. Whether it's learning programming, networking, databases, data structures or other common things. What is the point of guidance? Actually guidance is guidance when we do something, in which we can find out which way is good and bad.

On this occasion, the author will be sharing Python coding style guide Google. Already no stranger indeed if we associate Google and Python, because Python is already 'ingrained' with Google. Since Google is built, Python has become an important part in a variety of Google software product developer.

Now the Python programming language is still the official Google. It is delivered by Peter Norvig, Direkur Search Quality at Google.


“Python has been an important part of Google since the beginning, and remains so as the system grows and evolves. Today dozens of Google engineers use Python, and we’re looking for more people with skills in this language”


Many Google products that have been developed with the Python programming language including Google App Engine, which is used as a web-based application development environment Python. Then there is Youtube which has now become the most popular video sites. No Google APIs, Google Data and many more.

Another interesting thing is done by Google is a Python application coding are pretty tight. In this guide, a lot mentioned about the use of Python style One-liner, the advantages and disadvantages to each style of writing Python code. Here is a brief guide to the Python coding style Google:

Import
The use of imports only to package and module only. Typically used for re-use of existing functions in other files.

profit
Convention namespace management becomes simpler. Since the source of any identifier used in a consistent manner. For example, x.Obj said object obj has been defined in a module x.

Deficiency
Sometimes collide module name and module name sometimes there were long.

Use

Use import x to import package and module
Use from x import y where x is the prefix package and y is the module name without the prefix
Use from x import y as z If two modules y have the same name as that has been imported or if the module y has a long module names.
For example sound.effects.echo module can be imported via:

from sound.effects import echo
...
echo.EchoFilter (input, output, delay = 0.7, atten = 4)
Do not use a name that is relative in the import and avoid abbreviating the name to avoid import twice with the same package.

The import section is one of the suggestions from Google. How do I write a good Python coding la Google? For more Python coding guidelines can be seen more fully in https://google.github.io/styleguide/pyguide.html.

Well Python coding style guide Google, may increase the knowledge of how coding Python is good and right. In this guide, filled with a variety of suggestions from Google senior engineer for its employees. That's it, hopefully coding Python its more tidy well.

(Yp / google / quitagroup)

0 Response to "Coding learning Python version of Google"

Posting Komentar