Diving into Programming with Python I’ve spent years entertaining the thought of becoming a software developer, only to get overwhelmed by the vast array (pun intended) of programming languages to choose from. Which one should I choose, where do I begin? Java? JavaScript? C? C++? C#? Ruby? Django? Flask? Woah… wait a minute? Understanding Frameworks… Continue reading Why Start Your Programming Journey With Python?
Articles on Zen of Python
Write more maintainable Python code, avoid these 15 code smells
By PyBites Team on 15 September 2023
This week we talk about code smells. 💡 Listen here: Also available on our YouTube channel: Code smells are characteristics in the code that might indicate deeper issues or potential problems. While they’re not necessarily bugs, they can be a sign of poor code quality or maintainability issues. 😱 We distilled 15 common smells ranging… Continue reading Write more maintainable Python code, avoid these 15 code smells
Make Each Line Count, Keeping Things Simple in Python
By Bob Belderbos on 24 August 2023
A challenge in software development is to keep things simple 🤯 For your code to not grow overly complex over time 😱 Simple is better than complex.Complex is better than complicated. Zen of Python 🐍 Simplicity in your code means fewer possibilities for bugs to hide and easier debugging when they do arise 📈 It… Continue reading Make Each Line Count, Keeping Things Simple in Python
⚠️Why you should avoid import * in Python 🐍
By Bob Belderbos on 15 August 2023
Anyone who’s worked with Python knows that modules can be a Godsend, saving you time, effort, and many lines of code. They even have namespacing built-in 💪 😍 To expand on this a bit: However, not all ways of using modules are equally beneficial. In this article, we will discuss why using import * can… Continue reading ⚠️Why you should avoid import * in Python 🐍
The Arbitrary (Keyword) Arguments (args and kwargs) don’t come “for free” in Python
By Bob Belderbos on 9 August 2023
Python allows you to use *args and **kwargs in function definitions to accept an arbitrary number of positional and keyword arguments, respectively. Here is a simple example: Different types of function arguments In the above example, the arbitrary_args function is defined to accept any number of positional and keyword arguments using the *args and **kwargs… Continue reading The Arbitrary (Keyword) Arguments (args and kwargs) don’t come “for free” in Python
Why is Flat Better Than Nested? (Zen of Python)
By Bob Belderbos on 1 August 2023
The short answer: deeply nested code can be hard to read and understand (and this not only applies to Python, but for any code really). Each level of indentation adds a level of complexity and an additional condition that the reader (which is often you!) has to keep in their head while trying to understand… Continue reading Why is Flat Better Than Nested? (Zen of Python)
Django class based vs function based views
By PyBites Team on 28 February 2023
This post first appeared as an email on our friends list. We decided to publish it here because the question is still commonly asked 🤔 The other day I did a presentation on Django class based vs function based views. (Warning: this post is opinionated 😃) Also if you’re not into Django don’t stop reading just yet, because there are… Continue reading Django class based vs function based views
Reflections on the Zen of Python
By Bob Belderbos on 21 December 2022
An initial version of this article appeared as a Pybites email first. If you like it join our friends list to get our valuable Python, developer and mindset content first … How following the Zen of Python will make your code better, a lot better. This epic set of axioms (triggered by typing import this in the… Continue reading Reflections on the Zen of Python
Tips for clean code in Python
By Bob Belderbos on 8 November 2022
In this article I will give you 10 tips for cleaner code. Hope this helps improve your Python code. 1. Smaller units. Break long functions (methods) into multiple smaller ones that do one thing (SRP or “Single-responsibility principle”). This will make your code more modular and easier to test. For example, a function that parses… Continue reading Tips for clean code in Python
10 Tips to Write Better Functions in Python
By Bob Belderbos on 19 January 2022
In today’s article 10 tips to improve the quality of your Python functions.