Introduction This rather short post is a quick overview of an intermediate concept in C++ and basic type theory. You probably won’t find great value in it if you’re a programming guru.
Variance? During your developer adventures, you may have encountered a few words that made you scratch your head. Perhaps you’ve read that C++ pointers are covariant, or that C# 4 added support for contravariant delegates. But what does it mean?
General considerations As we develop programs, it becomes mandatory for the sake of our sanity to structure our source code by indenting logical blocks with an homogeneous amount of whitespace.
// This is what a sane person would do int main(void) { if (42) puts("Don't panic, and carry a towel"); return 0; } // Oh my god what is wrong with you? int main(void) { if (42) puts("Don't panic, and carry a towel"); return 0; } Among the grand family of programmers, we can observe two schools of thought: those who indent with spaces, and those who indent with tabulation characters (’\t’, internally known as 0x09 for any self respecting charset).