Creative Commons Attribution is not the Public Domain, and it's not a good idea to use the CC licenses for source code.
If what you want is for the code to always have your name on it, you should use a 4-clause BSD license (the original one with the advertising clause).