Python quirks

Structural Pattern Matching In Python

Once upon a time, Guido van Rossum, the Python creator, decided to reject a simple feature (PEP 3103): Switch case The reason for rejecting this PEP is: A quick poll during my keynote presentation at PyCon 2007 shows this proposal has no popular support. I therefore reject it.~ Guido van Rossum Lots of software developers… Continue reading Structural Pattern Matching In Python

C++ quirks

I Like To Move It Move It

In the last article, I explained the different value categories. In this article, I'll elaborate on the C++ move semantics. Let's review this code: #include <iostream> #include <string> class DataStructure { public: DataStructure (uint64_t size) : m_size(size), m_data(new uint64_t[m_size]) { print("ctor"); } ~DataStructure () { print("dtor"); if (m_data) { delete[] m_data; m_data = nullptr; }… Continue reading I Like To Move It Move It