• Martin Thoma
  • Home
  • Categories
  • Tags
  • Archives
  • Support me

Recent Posts

9 Clean Code Patterns I wish I knew earlier

9 Clean Code Patterns I wish I knew earlier

Do you know the feeling when you look back at code which you wrote early in your career? I always feel a bit horrified. But there is a positive side to it: I learned something new 😄 A core part of good software is readability. Keeping the mental complexity low so … Read More »
Python 3.10 is Released

Python 3.10 is Released

Photo by Vraj Shah from pexels and Mike from pexels, edited by Martin Thoma Python 3.10 was released on the 4th of October 2021 according to PEP 619. Let’s see what’s in store for us. Type Annotations I absolutely love type annotations. Since Python 3.6, they … Read More »
6 Alternatives to Classes in Python

6 Alternatives to Classes in Python Speed of development, execution time, (de)serialization, and maintainability all play a role in making your code shine

Photo by the author. As developers, we throw a lot of data around. The representation of data matters a lot and we need to be able to keep track of which variables represent which attributes. Configuration is a prime example of complex data. In the following article, I will use … Read More »
Pythons Scoping Rules

Pythons Scoping Rules The extraordinary short guide to Pythons crazy scoping rules

It’s obvious that you cannot access a variable before it was declared. But if it was declared inside a loop, can you access it outside a loop? If it was declared in a function, can you access the variable outside of the function? This kind of “variable lifetime” is … Read More »
Packaging in Python: Tools and Format

Packaging in Python: Tools and Format 16 solutions to 9 problems — which ones do you know?

A virtual environment is an isolated Python environment. It has it’s own installed site-packages which can be different from the systems site-packages. Don’t worry, we will go into more detail later. After reading this article, you will understand what the following tools are and which problems they solve … Read More »
pydantic

pydantic The library you must know if you juggle data around

Having complex nested data structures is hard. The traditional approach to store this kind of data in Python is nested dictionaries. Although Python dictionaries are amazing, there are two issues which typically arise: (1) How do I, as a developer, know which kind of data is to be expected in … Read More »
PyCharm Professional — Python Editors in Review

PyCharm Professional — Python Editors in Review See what money can give you 🤑

PyCharm Professional 2020.2. The screenshot was taken by Martin Thoma. PyCharm is an IDE developed by JetBrains since 2010. Yes, the same company that developed IntelliJ, the de-facto default for Java. It costs $200 per year which is pretty expensive if you just get your feet wet with Python … Read More »
JSON encoding/decoding with Python

JSON encoding/decoding with Python

JSON is a cornerstone for the exchange of data on the Internet. REST APIs use the standardized message format all around the world. Being a subset of JavaScript, it got a huge initial boost in its adoption right from the start. The fact that its syntax is pretty clear and … Read More »
How to write Flake8 plugins 😍

How to write Flake8 plugins 😍

Really important parts of code reviews are almost impossible to automate: Architectural decisions and logical bugs. They are too customized to your codebase; too specific for the pull request. However, many comments in code reviews are not like that. They are about simply style decisions, common minor mistakes, and misconceptions … Read More »
Logging Basics in Python

Logging Basics in Python

The dmesg output. Screenshot taken by Martin Thoma. Logging is the act of recording information about the current state of execution. It’s typically done for two purposes: Debugging: To enable the developer to narrow down the cause of a system failure Monitoring: To enable people on operations to know … Read More »
  • Martin Thoma - A blog about Code, the Web and Cyberculture
  • E-mail subscription
  • RSS-Feed
  • Privacy/Datenschutzerklärung
  • Impressum
  • Powered by Pelican. Theme: Elegant by Talha Mansoor