Dumb Pointers and Smart Pointers

Gone are the days when you need match every malloc(...) with free(ptr), match every new with delete and check whether we created an array or a single element. Those practices are unfriendly to maintainers and readers, and also handle exceptions poorly. Come are the days of smart pointers.

L/R/U References and Move Semantics

Move semantics were introduced in C++11 to provided a standard way to manage memory using move (instead of copy). Benefits:

  1. Avoid unnecessary copies in memory. Another technique that serves similar purpose is RVO (link to post);
  2. Resource (memory) management. The most notable example is unique_ptr.

C++ Types

C++ is a static typed programming language - its variables type are well-defined at compile type and does not change over the course of runtime execution. Its types are further decorator with qualifiers, and value categories completes the story. Lastly, there are some tools to assist us in type probing.

A close look at Git Alias

I finally decided to overcome my laziness and set up my aliases for git commands. Naturally, I got my mind set on using bash alias to set it up, until discovering git provides native support for alias.

Remapping CAPS_LOCK

Throughout the history of keyboards, CAPS LOCK’s key’s placement (and maybe existence) might have been the single biggest mistake of keyboard designs - it occupies one of the most expensive real estate in the keyboard-land yet serves very limited purpose. In this post, we discuss how to gentrify and repurpose the CAPS LOCK key.