If you're here to see programming projects, click here.
Structs over classes. Structs are more likely to fit into cache, leading to more performant applications. Additionally, I am just not a fan of object-oriented programming.
Enums over strings and bools. "Unless a human is going to read it, use an enum."
Diagrams, code, and comments. As in, all three of those, always in conjunction. In my opinion, "if you cannot draw a model of the problem, you cannot solve the problem." Diagrams may also double as documentation. Graphical (versus textual) documentation in many ways is preferable, because visual communication is generally more intuitive.
Switch cases. These are faster than if-else statements (in C, at least), work very well with enumerations, and better model the problem. "Better model the problem" may be a purely descriptive thing, but I stand by it; it is important to be able to describe what's happening. By modeling the problem using cases ("states" as I see it), it is also easy to create a related diagram.
Debugging by default. Instead of waiting for something to inevitably go wrong in your program, and only then adding a ton of debugging statements, just add debugging statements ahead of time; you are already writing the code, after all. Also, if an error can occur, just check for the error state instead of letting the program crash.
Data types matter. They also don't. If you don't need signed values, then it is better to use unsigned integers; unsigned integers are faster and can store greater numeric values. Do we really need a bunch of 32-bit integers for this, or can we save double the storage by using 16-bit integers? Can we use some of the bits in this 32-bit integer for flags and other variables that don't need an entire byte of storage? These are questions that matter. I also say that "data types don't matter," because they are abstractions and some people forget that underlying all the abstractions are numbers and memory addresses. There is no "real" difference between a "string" and an array of integers; a string IS an array of integers.
This section of the website is an archive of online or personally created programming resources. You can find programming resources in the following categories:
TODO: write an article on how to use Unicode in C.
Format specifiers and length modifiers with printf and wprintf: This article details both the common and uncommon format specifiers with the printf and wprintf family of functions in C. For example, this article writes about how the L specifier can be used on string literals to mark them as wide strings (e.g. arrays of wchar_t characters) and how the %ls specifier can be used within said wide strings to specify the point of interpolation for a wide string within a wide string literal when using functions such as wprintf.