Learn

last modified: October 23, 2025

How and Why to Avoid Preprocessor Macros

Posted on 2016-10-24

I explain why preprocessor macros often cause subtle bugs and naming conflicts in C++ and share safer alternatives—const/constexpr variables, #pragma once, enums, and separate implementation files. If you want clearer, type-safe code with unchanged performance, read the full post for practical examples and replacements.

Read this post

How to Debug Time Critical Code using an Oscilloscope

Posted on 2014-11-13— How and Why

I often use a simple oscilloscope trick to debug time-critical code: toggle an I/O line before and after critical sections and observe interrupt timing and execution width. It’s low-effort and revealing — read on for practical steps, examples, and tips to measure and reason about your timing issues.

Read this post

How and Why to use Namespaces

Posted on 2014-10-31— C++, How and Why

I explain how C++ namespaces prevent name conflicts and why they matter, especially in Arduino projects. I walk through practical patterns—prefixing, selective using-declarations, and importing a namespace—with class and global examples. Read the full post for simple, pragmatic examples to keep your code clearer and conflict-free.

Read this post