Python bytes vs bytearray

What’s the Difference Between bytes() and bytearray()? The difference between bytes() and bytearray() is that bytes() returns an immutable and bytearray() returns a mutable object. So you can modify a bytearray but not bytes type. Here’s a minimal example that nicely demonstrates the difference of the two functions: You create two variables a and b. … Read more

Writing Clean Code — Being a Professional [Cheat Sheet + Video]

Download the cheat sheet here (direct PDF download): Have you ever asked yourself, β€œWhat does it mean to be a professional?” This article is about being a professional software developer. It is based on the book, Clean Code by Robert C. Martin. All quotations are from this book.  While reading this article, you will learn … Read more

Premature Optimization is the Root of All Evil

This chapter draft is part of my upcoming book “The Art of Clean Code” (NoStarch 2022). You’ll learn about the concept of premature optimization and why it hurts your programming productivity. Premature optimization is one of the main problems of poorly written code. But what is it anyway? Definition Premature Optimization Definition: Premature optimization is … Read more