Plurrrr

Tue 11 Feb 2020

Unexpected Places You Can And Can’t Use Null Bytes

The traditional way of representing strings in C is using null-terminated character arrays. Common C library methods like strcpy, printf, etc. detect how long strings are by sequentially scanning memory until a null byte is found. This complicates situations where the string data itself should contain literal null bytes. Generally this doesn’t mean that it’s impossible to use strings with embedded null characters, just that you have to be more careful when doing so. Typically this is done by using methods that explicitly specify the length of strings.

Source: Unexpected Places You Can And Can’t Use Null Bytes, an article by Evan Klitzke.

The economics of clean code

There seem to be many opinions surrounding clean code. Some people have an entire architecture of how code should look. Others stick to the actual layout of the code, or length of a class while even others vaguely point towards Robert C. Martin’s books.

One thing is clear; it’s something that’s really on a lot of developers mind. Clean code makes projects more comfortable to work with and improves shelf life. It’s the antagonist of vile legacy codebases that are unmaintainable.

Then why does business always treat it as a secondary objective? Do they just don’t get it?

Source: The economics of clean code, an article by Frederick Vanbrabant.