Ask HN: Hobby coding that doesn’t feel like work

47 points by _benj ↗ HN
Hi HNers!

I’m curious about what practices you do when coding for fun?

For example, I’d use a different desk/space from the one I do my daily work, or work from a coffee shop, or from the sofa with a laptop. I’d also use different tools and languages.

But sometimes I find that even though I want to learn X or play with project Y being on a desk in front of a computer still feels like work.

Do you guys have some practices to make hobby coding fun?

Thx

76 comments

[ 4.1 ms ] story [ 134 ms ] thread
For me it is painting and 3d-modeling. It rarely ends up in finished software, but I like to include some works in little and primitive games. Do something with it.

I often use browsers + javascript because you very quickly get a result. I have some pipelines to convert data formats ready though.

I am not a talented painter, but with some training everyone can put out decent images.

For me it's easy as programming is only a hobby, not my day job.

Instead of using different tools and setup, try picking different projects or domains you love. For example, if you're a web developer by trade you may write compilers, games, or text editors for fun.

Playing with embedded devices (microcontrollers etc) has become my favorite coding-related hobby. The barriers to entry are hilariously low, the parts and tools are cheap and the code and documentation and tutorials are all free. At the end of the day, what you are left with is a physical thing that you can touch and which Does What You Told It To Do.
This - the use cases, end products and way of thinking about Arduino programming is so different that it doesn't feel like work at all.
I do side projects for myself such as web scraper, etc.. I enjoy hobby coding because I don't do:

1. sprints 2. minimum documentations 3. no test cases 4. only one git branch 5. run on barebone VM

I don't want agile + code review + PRs + git merges + container. I want the least amount of friction between me finishing typing code to running that in prod.

If something feels like work, don't do it. If you want to do it anyway, do it with a level of detail and attention that you wouldn't be allowed on the clock. Write your code on paper, write assembler, make radical choices and do stupid things just because. Play with microcontrollers and build something physically real. Roll your own crypto and design your own networking protocols. Restrict the length of your functions, don't use the standard library, don't use anything but the standard library. Etc.
“Write your code on paper”

From time to time I write code/pseudocode on paper. It can be lots of fun! And it can help one to think about the concepts/semantics without the immediate stress that the code needs to run/compile ASAP.

usually i make silly little games like tetris, 2048, cgol, or attempt simple leetcode challenges, or build userscripts to automate web tediums. To me it feels like solving a sudoku (fun) rather than studying for a math exam (boring). But the real secret sauce to fun programming is to build your own ideas. You might think of an old game you've played, and wonder, can I build that? Yes you can.
Try to make a CRUD app with API and SPA. Then it's both fun and it's also for real world apps you'll build.
I’m glad that you still find SPA and CRUD apps fun! That is my day job and I’m in the, idk, two figures CRUD app during my career? :)
Yeah, i think it's about what kind of CRUP apps is fun that's more important.
Common Lisp is fun!
I’ve been playing with Scheme and I’m loving it!!
You might enjoy some of the little projects in the second Common Lisp book I wrote that you can read on my web site https://markwatson.com/books/lovinglisp-site/

Most of the book is built around fun side projects I have done.

Oh hi! Yes, it was your book in fact that inspired me to work with Common Lisp! Thank you so much! Your book is a work of art.
Thanks! I am releasing an updated version in the next month, and I hope you enjoy the additions.
I'm in the process of making a digital version of a known dice/board game. Idea is to create a main unit that controls the game state with 5 or more handheld controllers.

Think quiz/reaction time/mario party type minigames

Doing pcb design, soldering, network communication and state management between microcontrollers, 3d-modeling and printing, (to protect the bare pcbs), etc. is new to me. Also creating expansions or twists on existing games keeps my mind going and does not feel like work.

Most of my hobby coding is visual somehow. Shader art, procedural graphics, code-based infographics. Laser cutting and 3d printing. Ray tracers. Even microcontroller stuff, most of my projects with those involve blinkenlights.

It's more rewarding to me, and easier to show off to non-coders.

This reminds me of me playing TIS-100, a cool game by Zachtronics where you need to program a small parallel CPU in assembly (see https://zachtronics.com/tis-100/ - btw it's currently on sale at GOG, Steam and HumbleBundle).

At one point in the game i had to implement a sorting function or something like that and i noped out because it very suddenly felt like work.

God the endless struggle of a Zachtronics game. I'm in love with this, but it hurts me to play.
For me, it's game hacking (not online cheating, though!).

Such a diverse topic where you can do a lot of stuff, learn a lot of stuff (x86 assembly, reverse engineering, etc) and you can achieve things like free-cameras, spawning npcs, and understanding how the game actually works at a lower level.

With that, I like to experiment with different languages, I started doing it in C++, moved to Rust, but I also tried Zig and Nim, and since they are all 'system programming languages', and you can interact with FFI, it means you can do fun stuff.

One of my latest projects was to spawn lights in a certain games because I know some folks that likes to take photos inside games, and it was such a fun project to understand how the game manages entities, how to spawn entities and how to control them using an injected imgui.

It feels nothing like work and it's very rewarding.

+1 for game programming. I always wanted to learn ASM, it wasn't until discovering Super Mario World ROM hacking that it became fun and exciting enough to really dig into.
I will get into a free form coding mode to get the thing working as fast as possible, which leaves you with long methods, poorly named variables, and hard coded settings, basically lots of code that would never survive a PR review. Getting out of the "someone else is going to look at this" mindset can make it more creative, faster, and more fun.
>I’m curious about what practices you do when coding for fun?

adventofcode.com

Good time to ask this

It really depends on the nature of hobby coding.

I dedicate considerable time to "hobby coding", including open source, and once a topic - independently of the topic - reaches a certain depth, it becomes "work", and then, the only difference with the daily job, assuming a healthy work environment, is just the choice of the topic.

Documentation, test suites, orderly repository history are not just corporate frills. Once a project reaches a certain size, the developers are, in a way, users themselves. If an open source project is even mildly popular, chores will need to be performed, which includes taking care of the users (this is actually why a sad amount of open source projects ignores PRs and issues).

So if it feels like work, while I can't say with certainly, I believe that you've just experienced how hobby coding of a certain depth, is in real world.

Ultimately, the only answer I can give, is to choose the topic very carefully - one may find that the topic that really tickle them are fewer than one would think.

On this note, contributing to open source was the best "experience" I've ever gotten as it related to my day-to-day job of maintaining a large, but still growing, project.
I listen to music mostly when working on my own projects. I don't talk much about ongoing projects until I have already progressed very far, and when I do I'm deliberately keeping most of the plans and further ideas out of the conversation - I've realized that it's easy to reward myself too much by talking to someone so that afterwards a lot of motivation is not there anymore. I also try no to listen to suggestions too much since it does create some weird obligations in my mind. And, most of all, I try to not ever fall into the mindset of creating something with a specific goal in mind - I find that it's better to focus on the process itself and not on the final product. This means I often pivot ideas or completely abandon then in favor of something that became more interesting. Also, if you have that option, working in the same room with friends.
Recreational mathematics - you usually don't end up with large codebases and most is just a single file/single use code to test some number theory hypothesis or find an integer with some properties/find a counterexample.
I've started to play with microcontrollers and other embedded systems to create tools for performance artists.

It was a path from a very long soul searching effort. After some 18 years of professional career as a SWE I was really tired of anything related to programming. Finally I got to find something that actually motivates me to learn like it was when I was a young kid and programming was a fun and creative hobby.

I got into it after meeting so many incredible people in circus, dance and other performing arts and watching them struggle to make their dream projects come true due to a lack of technical software/hardware skills and lack of money to hire specialists for their projects. It gives me a lot of joy to get into their creative processes and dream together the possibilities, to push my skills to areas I had never worked with and to actually provide value to a community of artists, to be part of a creative process is also pretty magical to me.

Before this I went through a long lull of motivation to code anything outside of work, to study anything related to programming outside of work needs. I don't get any joy anymore from dreaming about apps and products that I could sell, they all just seem like a boring job on top of my job. Actually creating something related to the arts has been very, very refreshing to my soul.

Brilliant! What’s your tool chain in terms of hardware and libraries and so on look like?

I imagine your skill set is very rare in that community.

So far I've been using a lot of Adafruit components. Their 9-DOF breakout sensor board is really cool to keep track of small movements and I pair it with a WiFi enabled Wemos D1 for wearables.

For my current project I'm creating vests with the 9-DOF sensor + Wemos D1 that connect to a central server and this server is a central dispatch to communicate with other stage parts (similar to the architecture of the Philips Hue Bridge). I have an Adafruit HUZZAH32 to control some stage lights and other equipment (fog machines, etc.).

My idea is to enhance the job of the light designers, instead of them having to choreograph with the artists every movement they can instead select areas of the set that should be reacting to the artists movements and the light FX are triggered by those movements at the points the light designer select as focus for the part.

For programming I'm mainly using CircuitPython or MicroPython as I love Python for the ease of prototyping and iterating over, and there are libraries for all the components I've needed so far :)

Edit: I've also started to look into DMX to integrate these tools into the normal workflow of stage lighting/FX.

The emergence of things like MicroPython and CircuitPython have been an amazing game changer for what people can do in the embedded world. It's amazingly fun and feels different enough from day to day work to be fun.
Wow sounds really interesting, do you have anything online (code, videos, writing etc..) I would love to learn a bit more about this.
I recently made a web app for myself as a hobby coding project. Part of what made it tolerable was not doing any of the stuff that makes the web apps I make at work more tedious, like audit logs or even an account system. It really hammers home the idea that it's _for me_ above all else.

>being on a desk in front of a computer still feels like work

Ultimately I couldn't get past this, even for gaming. I got a Steam Deck instead and mostly just use that and/or a tablet with a holder in my bed now.

Working on my hobby code does feel like work, but it feels like the parts of work that I enjoy.

The drudgery of my job comes from all of the stuff surrounding the code: tickets, meeting, code reviews, meetings, time cards, meetings. When I work on my hobby code, all of that goes away, and I can just code.

Sometimes it's frustrating. Sometimes I'll bang my head against a problem for a few hours, or a few days, then have a sudden "a-ha" that makes everything work. That is agitating in the moment, but the "a-ha" makes it worth it.

It also helps that the domains of my work and hobby code are completely separate. When I write code for fun, there's no enterprisey stuff going on. Right now I'm working on some code that generates character sheets for an RPG. There's no database, no Keycloak, hell, there isn't even a server. It feels a lot more like the toy code I wrote in college than the professional code that pays my bills.

If your hobby code doesn't bring you that kind of joy, you might be better off finding a different hobby? We don't need to chain ourselves to an IDE 24/7.

I find competitive programming pretty fun. If you want to learn X, you can start solving problems with X instead of a language you know. I use codeforces and used to solve problems on Project Euler as well.
Advent of Code will start in a couple of days.
I find hobby coding to be more fun and rewarding when I do it with other junior developers. I used to teach coding and I've kept up with and continue to mentor some former students so if one of them has a project idea or they want to practice algorithms or learn some framework and they want some help I'll pair with them. Recently I went back out on the job market so as I study some more advanced algorithms I'll invite them to code with me.

I love teaching, I always have fun doing it. So the hobby coding ends up being fun and rewarding. Sometimes they'll come up with an idea that I quite like, so the aded outside creativity also makes it fun. Some ideas recently we might even release at some point, this also adds a bit of excitement.

No one mentioned it here, but make sure you are using a personal computer for this and not your work computer so you don't get into trouble with your employer. This is well-known advice, but there's always a newbie learning something for the first time.
I think programming always involves certain amount of frustration and a lot of learning so the problem is do you enjoy the learning?

For example I fimd it interesting to write HDL for the nand2tetris but I absolutely hate writing leetcode. But I also know many people enjoy writing leetcode so it's personal. You have to find something you are willing to learn so the fruatration is overcome by the joy.

I work from home. I have a separate work computer than my personal computer which are in different rooms. When I code for fun, I make mods for video games. I get to use the mods I make when playing which is a nice bonus. My mods are played online so I also get to see others use them which is satisfying.