Namespace

last modified: October 23, 2025

Use Enum with More Class!

Posted on 2019-07-29— C++, Improve your Code, Learn

I explain C++11 enum class: why it prevents name conflicts, how it compares to traditional enums and common workarounds, with practical Arduino-friendly examples. If you want clearer, safer enum usage in your interfaces, read the full post for code samples and simple best-practice guidance.

Read this post

Class or Module for Singletons?

Posted on 2019-07-09— C++, Improve your Code, Learn

I compare implementing a singleton as a class or as a module/namespace for Arduino firmware using simple LED driver examples and compiler measurements. I cover size, initialization and runtime trade-offs and explain when each approach makes sense. Read the full post for code, disassembly and practical recommendations.

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