Some people copyright their articles/blog posts but explicitly specify that the code is free to use. This is a reasonable case where the author is trying to educate but attempting to stop the shameless people who copy such an article and post it as their own.
I think that the law in a lot of countries require a reasonable level of creativity and/or uniqueness before copyright can apply i.e. Eric's GetDate script is not a valid copyright case (sorry Eric). Otherwise I would be able to build upon Eric's work and produce my own (albeit with some use of Eric's):
-- (c)2016 Shonkey Gaz - All Rights Reserved
-- Portions (c)2016 Eric Russell.
That semicolon makes all the difference!!! 😉
Amongst other reasons to copyright your own work is to stop another party copyrighting it and them stopping you from using it. A despicable act but one that has occurred more than once.
-- Stop your grinnin' and drop your linen...they're everywhere!!!