Code hoisting is an optimization technique that moves code from inside a loop to outside of the loop, if the code is not dependent on being inside the loop (i.e., the code moved is loop-invariant). If your compiler doesn’t have an …
Read moreOrigin of the Three-Finger Salute (CTRL-ALT-DEL)
The idea for the CTRL-ALT-DEL key combination originated in the IBM PC group, during development of the original IBM PC in 1981. David Bradley wanted a key combination that could be used internally by developers to quickly reboot the computer,without …
Read moreLoop unrolling as a symptom of premature optimization
I was asked a question recently that went something like this: “If a for loop is faster when it’s unrolled, why does my boss always want me to make my code shorter by using for loops, when my way (loop …
Read moreIs C a high-level language or a low-level language?
All programming languages are effectively on a spectrum of abstraction. Some are more abstract than others. So, with this in mind, within the set of high-level languages, you’re going to see some that abstract the inner workings of the machine …
Read moreWhy do some experienced C developers avoid certain features of C99 and later standards?
Professional software developers who use C to develop source code that is portable across compilers will often find themselves avoiding certain newer features of the language, not from lack of knowledge or understanding, but because not all compilers implement all …
Read moreIn C++, when should I use a class vs a struct?
In C++, the only technical difference between a struct and a class is that, by default (i.e., if you don’t specify anything), members of struct are public while members of a class are private. You can achieve encapsulation in a …
Read moreCan data structures and algorithms be implemented in assembly language?
Yes, absolutely. Any general-purpose programming language, including all assembly languages, can be used to implement data structures and algorithms. Data structures and algorithms are independent of the implementation language. In fact, some instructors and authors present them using pseudocode or …
Read moreDoes the free function make a pointer NULL in C?
No, it doesn’t. The free library function places the specified block of memory back onto the heap’s free list (at least conceptually…actual implementation details can vary). But the free function doesn’t have access to the memory containing the pointer, because …
Read moreWhy do some developers advise new developers to ignore using Microsoft Windows?
I’ll go out on a limb and say, “Real developers don’t give advice like this. And if they do, they should examine their own motives and biases before giving that advice again.” It turns out that, although I might have …
Read moreAre Windows 95 and 98 earlier releases than Windows 7, 8, 8.1, and 10?
Yes. Yes they are. This question might seem a bit silly to those of us who lived through, and paid attention to, the early releases of Windows in the 1980s and 1990s. But to someone who didn’t, these numbers can …
Read more