Author image

Base Friend Design Pattern

Just a software design pattern I have come up with, as a means to effectively and efficiently share code between different components/classes without breaking (too much) the rule of encapsulation. For these reasons I will classify it as a behavioral design pattern.


We have a certain ResourceClass, that we wish to use its internals in various other UserClasses. How do we achieve interaction using the base friend pattern?

We can leverage the C++ friendship rules. We're aware that C++ friends break encapsulation, "friends invade our private life". We don't like that, we hate it. However.. remember that friendship is not inherited nor bidirectional. Given this we could create a base class for all our UserClasses and that class alone can be made a friend of the ResourceClass. Hence, that base class alone, call it BaseFriend, will have access to the ResourceClass....

Author image

Exception Class Hierarchies in C++

How to use exceptions, manage error codes in your C++ programs? That is the question of the day.

Luckily c++ exceptions are pretty standard in their programming. The strategy is to create a base exception class with a name of your choosing (KeyException was mine) and then you can create subclass exception classes, nested in the various principal classes of your codebase. For example, in a game engine project you can create GraphicsException, WindowException, KeyboardException all inherit from KeyException and override the getType and what() functions to provide meaningful unambiguous errors.

Let's start with a tiny C++ exception primer -reminder- though before you get your hands on the code.

You handle exceptions using a try block. 

Author image

"KeyC0de Productions" intro sequence

If you've seen some of my YouTube videos you may have noticed the 12 sec intro sequence that rolls first thing.

I made this mainly using 3d Studio Max 2015 and Adobe After Effects.

To say it was tough would be an understatement, as I'm not really a modeler, animator. I just loved 3d Studio max and years ago I got the student license which allowed me to play and tinker with it to my heart's content. Same goes with After Effects, although the After Effects aspect was much simpler, required less work and after watching a few YouTube tutorials I was set.

I drew inspiration from various intros I adore such as:

  • Audio Visual Enterprises (1993)
  • Prism Entertainment (80s)
  • Gun Media (which is basically a carbon copy of Vidmark Entertainment 88)
  • Zodiac video (from 1985)
  • WWE Monday Night 1985
  • 20-20 vision (90s)

The music tune you will hear being played is a free sound from 

Author image

Aspect Oriented Programming

Aspect Oriented Programming (AOP) is a programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns. It does so by adding additional behavior to existing code without modifying the code itself, instead separately specifying which code is modified via a 'pointcut' specification, such as “log all function calls when the function's name begins with 'set'”. This allows secondary behaviors (eg logging) to be added to a program without cluttering the meaty code that's core to the functionality.


  • The AspectConfiguration specifies which aspect applies to which method of an object
  • Each aspect is essentially a method (or a separate class containing a group of those aspect-methods) written in an aspect-oriented language (or annotation, or through an idiom in an existing language).
  • Aspects are wrapped 'before', 'after' or 'around' methods. For example we...

Author image

Thread Pool

A thread pool is a software design pattern that helps programmers achieve concurrency in an optimal way. By maintaining a pool of threads ready to execute at any moment performance is increased since latency is minimized by keeping a set of threads always available; at the ready, instead of frequently starting them up and destroying them because of frequent brief tasks. Thus we avoid short lived threads which break concurrency.

All this because creating and destroying threads takes a longer time than keeping them constantly alive and waiting.


  • there is an array of threads - m_pool
  • there is a FIFO queue of tasks (a Task should be a wrapper for a Callable object) - m_tasks. Task are enqueue()ed into the task queue
  • all threads are started...

Author image

Event Queue, Message Bus and Dispatcher

NOTE: I will use the terms event and message interchangeably. In some contexts there may be a minor differentiation but for this discussion it will be ignored.

Event Queue or Message Bus


Decouple when a message or event is sent from when it is processed. - R. Nystrom

What's the easiest way to manage the connections between event listeners and event producers? You guessed it, “Event Queues”.

When an event occurs, such as user input, or an entity sending an event to another entity, it needs to be stored somewhere such that it's not lost while in transit between the source that reported the event and when the program gets around to respond to it. That “somewhere” is a queue.

New events are added (aka enqueue) to a queue of unprocessed events. And at a later time when it's convenient in the application we...

Author image

Console on a Windows GUI Application

Provision Windows C++ GUI applications with a fully featured & functional console window that you can use for logging or whatever other purpose you deem would prove useful.

I used Windows 8.1 x86_64, Visual Studio 2017 & C++17 to build the project.


Github repository link.

Author image

C++ Timing

A Timer that I plan to use in a lot of projects.

Bonus: Performance log - merely an extension of the Timer entries, which is actually an array of pair<timestamp,stringLabel>. It has many uses. Find one!

Plenty of test cases to test thy mettle.

I used Windows 8.1 x86_64, Visual Studio 2017 to build the project. It should work on other platforms as well.


Github repository link.

Author image

Quadcopter Drone CC3200 Radio Telemetry Project

This was my Electronics Engineering Bachelor Thesis Project (2015).

Nikos Lazaridis, Technical University of Piraeus, Greece.

Texas Instruments (T.I.) CC3200 wifi unit, acting as the telemetry intermediate between the Ground Control Station (GCS) and the APM Ardupilot flight controller on top of the QuadCopter/Drone.

The thesis is written in Greek. You can find it in Thesis_QuadcopterTelemetry_Nikos_Lazaridis_ppapag.pdf. If I get requests I may get motivated to translate it to English.

Most of the code has been written in Texas Instruments Code Composer Studio 6. I haven't tested it with updated CCS versions.


Youtube video link.


Github repository link.

1 2 ... 7