The code is the documentation

You read/hear that the code should be clear enough to be understood with very little comments. I wholeheartedly agree bu I rarely see code like the one I like to read/write:

// This is less convoluted than what's required for
// std::result_of (deprecated in C++17) or std::invoke_result
using SystemTimer_t = decltype(::SetTimer(HWND{}, UINT_PTR{}, UINT{}, TIMERPROC{}));

or

m_UpdateUserInterfaceTimerID = SetTimer(UpdateUserInterfaceTimerID, (100ms).count(), nullptr);

What do you think?

Advertisements
This entry was posted in C ++. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s