But that latter thing is still something guitarists do. You might throw some new strings on and noodle around for a day with no particular purpose in mind.
Likewise it's fine to write code with no bigger goal other than to play with a library or a language.