Best Naming Conventions When Writing Python Code

By datasciencecentral - 2021-03-15

Description

Naming Conventions  During a recent workshop, bootcamp instructor Alex Baransky shared some of the best practices in writing Python code for better readability…

Summary

  • Naming Conventions During a recent workshop, bootcamp instructor Alex Baransky shared some of the best practices in writing Python code for better readability.
  • Through this series of articles, we will summarize and give you a few examples of those best practices to help you write more elegant Python code, benefiting those who may read and use your code in the future, including yourself.
  • Naming conventions are therules of thumb for naming theobjects that you create.
  • Lowercase letter “el” - instead, use a capital letter “L” Uppercase letter “oh” - “O” Uppercase letter “eye” - “I” We avoid those names because in some fonts, they are indistinguishable from the numbers “1” and “0”, which makes it difficult for the user to understand what’s going on.

 

Topics

  1. Coding (0.25)
  2. NLP (0.08)
  3. UX (0.06)

Similar Articles

Pointers in Python: What's the Point

By realpython - 2021-03-09

In this step-by-step tutorial, you'll get a clearer understanding of Python's object model and learn why pointers don't really exist in Python. You'll also cover ways to simulate pointers in Python wi ...

PyPy: Faster Python With Minimal Effort

By realpython - 2020-12-28

In this tutorial, you'll learn how you can use PyPy to improve the speed of your applications. You'll see how PyPy compares with other Python implementations like CPython and learn about features that ...

Working With Python Virtual Environments

By realpython - 2021-03-10

This course demonstrates how Python's virtual environments work as a "sandbox" and you get a quick walkthrough on how to set up a new environment (or virtualenv, as they're called for short) and how t ...

5 big and powerful Python web frameworks

By InfoWorld - 2021-01-17

Why build your own user credentialing, form handling, security, and other stock components? These big and powerful Python frameworks cover all the bases.