Thursday, August 06, 2009
Sometimes we want to display some text on the console in some specified color (e.g. error in red, warning in yellow, etc). The procedure is often virtually identical, that is, it consists of three steps:
Save the current color.
Write the text on the console.
Restore saved color.
As we can know, the duplication of code is not a good practice, therefore we should extract the first and the [...]
Read the whole post…