September 26th, 2008

Tips for new coders

The comments in this discussion are priceless. They’re language or platform specific at all — for you folks out there looking for how to learn quickly, get better as a coder and thrive at a new environment, this thread is a must read.

I’m expecially a big fan of:


std::string mkdec(std::string x) // Converts x, a string representing a hexidecimal number, to a decimal string.

vs.


std::string convert_hex_string_to_decimal_string(std::string hex_string)

These methods do the same thing, but the latter example is unquestionably better, as it is simultaneously a method and a comment rolled into one. You won’t forget what that method does no matter where it shows up in your code.