01 Jun 2020
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.
05 Apr 2020
Move semantics were introduced in C++11
to provided a standard way to manage memory using move (instead of copy).
Benefits:
- Avoid unnecessary copies in memory.
Another technique that serves similar purpose is RVO (link to post);
- Resource (memory) management.
The most notable example is
unique_ptr
.
31 Mar 2020
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.
27 Mar 2020
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.
19 Mar 2020
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.