I love my job as a data scientist, it's incredibly creative and a lot of fun. But at the end of the day I'm pretty much done with staring at code snippets and reading documentations. The same is true for the weekends - ever since I started to code for work, my motivation to code outside of it rapidly fell towards absolute zero.
The problem is that I have a few private projects that I would love to try out. They all need coding. How do you find the motivation to work on such things when you also code for work?
Personally, I think it's probably a healthy thing to pursue completely diverse activities professionally and privately, but at the same time I feel like not honing one's professional skills during your time off is a little bit of a wasted opportunity.
I sometimes will have a month where I don't even want to think about code outside of work. Other times, all I can think about during work is when I can get off and go home to code more on my side projects. These are the two extremes. I am usually somewhere in the middle: I will go take a walk, go to the gym, read science fiction, cook. During these activities, I will randomly have higher-level, free-flowing thoughts about my coding projects. Perhaps even a spark of insight.
When I return to my projects, I feel refreshed and excited. If I don't feel excited about my project, then I won't force myself.
What I've learned over the years is to never force myself to do "work" for side projects. To be fair, my side projects usually don't get anywhere aside from learning/hacking on new things. My skills improve and I'm having fun and that's good enough. Pressure is for actual work that pays the bills.
1. I code on my time off when I'm not coding enough at work because I'm too busy with other tasks such as management, documentation, specification, testing, or just boring development
2. I try as much as possible to "sharpen my saw" at work. For example:
A MR about an API to review? => let review SOLID principles.
A module to refactor? => Let's explore some new design patterns.
A bug to investigate? => maybe this modeling tool I read on HN can be of help...
Other times I had some linear algebra stuff I was working on, so I learned a bit of Octave[3] to generate test cases with a (hopefully) correct implementation.
I'm still looking for opportunities to try Z3[4] though... (e.g. http://phrack.org/issues/69/4.html#article see "How I Cheat at Maths - Z3 101").
1: https://lamport.azurewebsites.net/tla/tla.html
2: https://alloytools.org/
3: https://www.gnu.org/software/octave/index
4: https://github.com/z3prover/z3
Over time some of them have spawned into their own projects, and some have gained a little popularity in the OSS community and have taken a life of their own. Importantly I am keeping them as hobbies and not revenue streams; I know that isn't a common sentiment on HN.
Further, it's not always about coding — it's important to also do non-coding things in between, to break things up. I'm sure you have some of these as well. The non-coding tasks can serve as time to mull over both work and non-work coding tasks in the back of your head.
At home, I enjoy NOT doing things the right way, one-off stuff, dirty dirty hacks, tricks and kludges.. Whatever makes it work, in whatever language I feel like! I code myself into a corner, or work around refactoring whenever I feel like it, and I enjoy it all the way to the bottom! :-)
I find it enjoyable to have a leg in both "worlds", and they both motivate the other.
Maybe it also helps that I've gotten good enough at the coding bit that it's not really the main bottleneck. For better and for worse, I'd have to contrive reasons to try out the fancy new features that just came out in Metal 3. I still haven't needed the fancy pipelining in Metal 2. I spend more time in Photoshop and Illustrator than I do in XCode. With that said, I think that Apple's done a really good job with Swift and Metal, which means I get to spend more time with content assets.
I think that at work, the bottleneck isn't really code either. We spend more time making decisions about the code than actually coding. So there's that.
Ultimately, the point isn't really to write more code. The point is to make more product.
If I want to learn something, I read about it (at work or at home), then look for a way to apply it at work (it has to be useful though!).