Plurrrr

Wed 13 Jul 2022

The Top 10 Tips to Write Clean Code

A crucial feature of good software is clean code. Developers prefer to work on applications if the code is easy to understand and modify. Sometimes, the coding hastened to meet deadlines but eventually causes delay since more bugs need fixing. Studies have revealed that the time spent reading code compared to writing is higher than 10:1. Hence, the need for clean code arises.

Source: The Top 10 Tips to Write Clean Code, an article by Rebecca Daniel.

Choosing a PostgreSQL Number Format

It should be the easiest thing in the world: you are modeling your data and you need a column for some numbers, what type do you use?

PostgreSQL offers a lot of different number types, and they all have advantages and limitations. You want the number type that is going to:

  • Store your data using the smallest amount of space
  • Represent your data with the smallest amount of error
  • Manipulate your data using the correct logic

Source: Choosing a PostgreSQL Number Format, an article by Paul Ramsey.

Faster, more memory-efficient Python JSON parsing with msgspec

If you need to process a large JSON file in Python, you want:

  • Make sure you don’t use too much memory, so you don’t crash half-way through.
  • Parse it as quickly as possible.
  • Ideally, make sure the data is actually valid up-front, with the right structure, so you don’t blow up half-way through your analysis.

You can put together solutions with multiple libraries, of course. Or, you can use msgspec a new library that offers schemas, fast parsing, and some neat tricks to reduce memory usage, all in a single library.

Source: Faster, more memory-efficient Python JSON parsing with msgspec, an article by Itamar Turner-Trauring.