A programmer friend recently revealed that his company has a strict no-tabs policy, and that they are forced to use space indentation… at no fewer than eight spaces. This makes me sad. I explain why.
A programmer friend recently revealed that his company has a strict no-tabs policy, and that they are forced to use space indentation… at no fewer than eight spaces. This makes me sad. I explain why.
I address the age-old debate of C and C++; which pointer initialisation syntax to use?
I compare several approaches to object initialisation in C++.
I explore a few oddities with templates and types in C++.
Why does C++ not allow conversion from T**
to T const**
?
I'm occasionally asked why C++ programmers conventionally use .cpp and .hpp files, what they use them for and what happens if they don't. On the spot I'll usually come out with the template answer that conventions exist for a reason, but I thought I might as well take a moment to explain more fully the reasoning behind this one.
A question came up on IRC today regarding preprocessor macros and which ones are standard. Amazingly, MSDN does a good job of describing the standard macros and lists those non-standard but conventional macros implemented in Visual Studio. What it doesn't do is mention that some of those macros in fact aren't macros at all, but implicitly defined variables.
Since I have utterly failed at maintaining Tomalak's Tuesday Tip — though I do intend to pick that up in 2009 — I have reformatted some conversation logs into interview style, as I found them quite interesting on the re-read. Hopefully someone out there might get something out of the ideas of myself and of people I know.
This week I want to talk about two classes that are both part of the C++ Standard Library, both do similar things and yet are fundamentally different. String streams.
Today I quickly point out a possible bug that can easily come about in C++ if you're altering interfaces.