DEV Community

Chibueze Jonas Adielechi
Chibueze Jonas Adielechi

Posted on

Black Python Mentorship

A big thank you to Black Python Dev community for tgis mentorship possible!!

I'm about to take a good journey through the route of programming with python with the help of Black Python Dev community mentorship program and these Zen of python have spiked my interest and have inspired me.
Simple is better than complex.
Complex is better than complicated.
The simplest solutions are often the most elegant and efficient. This truth has been known since the Renaissance, as the famous saying “simplicity is the ultimate sophistication” is often attributed to Leonardo da Vinci.

Simplicity may not always be possible, though, as some systems are complex by nature, consisting of many moving parts and layers. But that doesn’t mean they have to be complicated or difficult to understand. You can often break a bigger problem down into smaller and more manageable subproblems. Python offers a variety of tools to help you with that, such as list comprehensions, generators, iterators, and more.
Flat is better than nested.
Sparse is better than dense.

When it comes to the structure of your code, it’s generally preferable to keep things flat by avoiding deeply nested structures. In an earlier example, the lambda expression replaced an inner function,
On the other side of the spectrum, you might feel tempted to cram as much code as possible into a single line. This is where the second statement comes in. Instead of using one long line of dense code, it’s usually better to spread the individual instructions out, making them easier to reason about.

These rules of python have inspired me alot and I intend to work with them while coding python to make my codes less ambiguous and unique.

Top comments (0)