Clean code advice for Python:
Do not add redundant context.
Avoid adding unnecessary data to variable names, especially when working with classes.
Example:
This is bad:
This is good:
👉 @CEPython
Do not add redundant context.
Avoid adding unnecessary data to variable names, especially when working with classes.
Example:
This is bad:
class Person:
def __init__(self, person_first_name, person_last_name, person_age):
self.person_first_name = person_first_name
self.person_last_name = person_last_name
self.person_age = person_age
This is good:
class Person:
def __init__(self, first_name, last_name, age):
self.first_name = first_name
self.last_name = last_name
self.age = age
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥1