//TODO: professional stuff of software engineer 1001010
Category Archives: C++
Remember CodeProject?

I forgot all about it too.  It’s still there, I even have a bit of sample code on their site.  Long-long ago I wrote a /delayload replacement because it was the cool thing to do. At the time it was the best spot to find Win32 code examples other than MSDN.  CodeProject did a decent job answering that core software engineer need for it’s readers: “How do I implement X?”.

Looking back I see that it was backwards.  It was an article/publisher model that relied on people to create the answers to the questions people might be seeking before the questions were answered.  Since psychic powers are in short supply among the technically minded, the reach will always be limited.

Today we have a better answer: StackOverflow.  Instead of waiting for someone to write an answer to the unwritten question, we have a place where we can write the actual question and (if it’s well written & not a plea from someone stuck on their CS homework) get quality answers.

Now the cool geek thing to do is to be the one that writes the best upvoted answers on StackOverflow. For a few of my co-workers, they’ve made a sport* of writing quality answers before anyone else.  It’s sort of like doing Project Euler problems on hard mode.

-Jason De Arte

*I know, a sport involves a ball. whatever

C++ const ref member

I know people bag on c++ (for many valid reasons) but it still amazes me to learn something new: read only members using const references. It’s even better when a c++ non-fan teaches you about it. Thanks Nico!

class Test
  Test() : readOnlyVersion(m_writableVersion)
  const SomeType & readOnlyVersion;
  SomeType m_writableVersion;

Never having a need, I had always filtered out reference data members – I just categorized them with static members and their special initialization. Now that I see a use case, I’m basking in the “Ah that makes total sense” moment.