DEV Community

Jakub Rumpel
Jakub Rumpel

Posted on

Code stupid things

Today I’ve watched new video from CodeBullet: Channel that I found when I had a huge phase on watching everything AI - be it teaching a neural network to play a Mario game or drive a simple car... anything like that, and CodeBullet provided me with exactly such a material: simple or not so simple task with an interesting enough narration.

The video was about creating a simple program to cheat in “Clicker Heroes” game. While I don’t know this game, and didn’t want to download it, it reminded me a little bit of an old in-browser clicker game called “Cookie Clicker”. There was a time when I spent too much time there, so I was happy to notice it’s still up and online as of writing this post.

What is this about, really?

After finding the game again I realized that I’m curious about my ability to code something like this: simple clicker to cheat the game, as a fun project. 3 AM be damned, I took a laptop and started coding. Finding whether I was in a game, clicking a cookie, check for upgrades and buying them... all of that in a language I didn’t touch in a long while: Python.

Two and a half hours later, and the code - as simple and unpolished as it is - is done and working. Cookies are clicked, upgrades are being bought and I can watch and smile, as I see my code working without problems.

And then I remembered.

Coding used to be really fun for me. Such small projects, just to achieve simple objective, overcome a simple challenge. For the last two and a half years of my professional career, I stopped coding just for fun. Projects like this weren’t really in my head, while I had to focus on building my independent life which I’ve then just begun and code I was working on at any company I was currently working at.

My point is, I forgot that I’ve got into coding to have fun; To overcome those little challenges, to see my work come to any kind of fruition. Of course, there were other sources of motivation, biggest of which was my desire to make people’s life easier using what I have learned, but this? This is where it all started. Simple pleasure from fulfilling a simple task using code.

Remember to code small, stupid things.

It’s just never boring. There is always something you can do to just... do a thing. Some stupid challenge, like making your computer react to you in some way. Or any kind of automation, like turning off your console at the specified time in case you left it in rest mode. Or anything else that will probably take you less then two hours, but will flood your brain with dopamine. My point is, remember that coding, like any other work, can be used both professionally and just for fun, for the simple pleasure of Doing The Thing. If you can make your life easier while you do that, it’s just gravy.

Just remember to have fun.

PS. For those curious, you can find the code I wrote here. Word of warning: It’s not pretty or polished, I’m not a daily Python developer. It was just the easiest language to quickly achieve this objective, and I like writing simple scripts of this kind in Python.

Top comments (7)

Collapse
 
geraldew profile image
geraldew

This makes a third recent post I've recently read here that has some aspect of coding for work versus coding for fun/home/learning. More about that later.

First though, I agree entirely. A form of coding as "play" is itself quite a functional thing to do.

For me, the irony is that I have historically done more of the code-something-silly from within my paid job rather than outside of it (but do note that I have had longstanding ongoing employment).

Much of the time, that happens when I spot some new facility and I take the chance to see what might be done with it. In which case, a "stupid" example doesn't involve any development or implementation politics (always an issue for those of us working in organisations). Also, in a controlled enterprise environment, just how much of it will actually work is always useful to know.

Here are the other two posts that I alluded to, one that I wrote and one to which I replied.

I do think the link between all of these is that tackling interesting problems has a value even when the specific case is not important to anything else.

p.s. Of course, another reason to consider when choosing between coding stupid things on your employer's system/time and doing it "at home" is who thereby owns the code. This is a side of copyright law that is less clear and less consistent around the world.

Collapse
 
hanewali profile image
Jakub Rumpel

Upon consideration, I think for me it's more of a 50/50 between tackling such small challenges at work and at home. But anywhere you do this, it's still good to sometimes just do this small thing, especially if it makes your life a bit easier ;)

I do wonder about how much of internal tools in organization grown from just "I'll just code this little thing instead of doing it every day", because some developer just decided to, again, tackle the challenge.

Also, about the last part - another thing is a difference between challenges at home versus at work. Cheating Cookie Clicker is not your typical "at work" challenge, meawhile generating scripts to fix common problems in SQL DB connected to some big legacy application probably won't happen at home. And even if you code it at home, what happens when you use such a tool to solve work problem?
Copyright and ownership are mysterious.

That being said, thanks for the comment!

Collapse
 
andrewbaisden profile image
Andrew Baisden

Pet projects, side projects and hackathons are like a breath of fresh air.

Collapse
 
rubedog profile image
rRuBrain

PogU, I'll make a random pepe (the frog) generator

Collapse
 
cess11 profile image
PNS11

For interesting browser game automation, take a look at Trimps and AutoTrimps.

trimps.github.io/
github.com/Zorn192/AutoTrimps

A bonus is that Trimps is quite fun to play casually.

Collapse
 
ezeanamichael profile image
EzeanaMichael

Nice article, at times we all need to remember to have fun coding even though it can be stressful

Collapse
 
vaishnav profile image
vaishnav

Great article Jakub, Thanks for sharing! Really made me feel inspired 👍