Cookie Clicker saved my PhD
advaitsarkar.wordpress.com
advaitsarkar.wordpress.com
I recently have undertaken a little side project that at first I assumed I was going to need to pick up an Arduino and hack together some physical inputs, LEDs for an interface, and a speaker. It wasn't until I started shopping around for pieces and learning about the tech stack that I realized I could just take my old phone, pop open a browser, and prototype it that way.
There's a lot of complaints that not everything should be in the browser, and that's very true for a lot of cases, but it's extremely empowering that anything _could_ be in the browser, at least for your MVP.
It seems that that was the experience Smalltalk was aiming for back in the 1980's with it's totally integrated development environments (integrated to the point that it was basically its own operating system).
One could argue that the modern web browser with its integrated tooling for javascript is a reasonable modern interpretation for this. Note the similarities that the web-browser is almost its own operating system in this scenario as well
> But perhaps the simplest way to view this episode was as a playful, recreational activity which through sheer dumb luck gave me the skills needed to solve an important problem in my work life.
I see it capturing my joy of using GPT-4 on ChatGPT, with its cap of 25 messages every 3 hours. There's a joy in exhausting the limit for each session (may be that's what gamification is). Not able to do for full day, as got to sleep for >3 continuous hours, but exploring topics besides day to day work as a result :) Learning I am doing, how much useful - not sure.
I moved towards ML later. I do no interaction with the web whatsoever other than a Flask web app once or twice a year for higher ups' pet projects.
I want to feel the joy of web again as a hobby and maybe side projects.
How do you think Phoenix will fit? I write programs in functional way and somewhat know Elixir.
Do you recommend me learning Phoenix?
Depending on who you're targeting (in terms of both users and developers), the web may or may not be easier than "native" (e.g. R solves problems for users that the JS ecosystem can't solve).
This is exactly why some don't want software essential to their business or personal life to be dependent on the whims of somebody and their server.
What we often do is to buy development, rather than buying a SaaS product. With the right setup, and this is easy to do with OSS as well, you can buy the development as needed from any of the software houses which specialise in this. You can then run things yourself, or buy the maintenance as well. This lets you control what happens with the software on the server and the server itself, and it’s frankly often a cheaper option than buying a SaaS solution for things that are vital to your business. At least in the long run. That being said, even with SaaS solutions you’re rarely at the “whims” or somebody and their server in enterprise SaaS solutions. I think Figma might be the only service we use where we’re at the “whims” of change that we aren’t able to control, and we do use quite a lot of SaaS software for things that are “less” important to us.
As a private user you’re right though. You won’t be able to do those things. But the flip side is that you’re probably not going to find a lot of non web-solutions that don’t sort of work similar. Even with something like an e-mail client, you’re going to see updates, and you’re not going to be able to influence them anymore with a local program than you are with a web-based program. I guess you can continue to use an old version of something, but what then you’re using unsupported software, and eventually, you risk that it might not even run on your Operating System without massive amounts of efforts. Like, I have X-Com: Enemy Unknown on 3 floppy disks, even if I had something that could read floppy disks, I’m not sure how I’d even install it on windows 11 or my Mac.
Plus, you get all of that for (basically) free, at the same time with hardly any extra effort! The web really is the most versatile of platforms.
About that time, the Bank of England issued a new five pound note and made huge claims that it could not be scanned. Supposedly they had designed in loads of high detail textures that would show weird aliasing artifacts on the 300 dpi colour scanners that were state of the art at the time. Challenge accepted! The Sun workstation I camped out on just happened to be connected to a nice 1200 dpi monochrome scanner. I went to my friends at the university theatre and returned with a whole stack of different coloured gels from the theatre lights. Then I took a whole series of scans of a £5 note through the various coloured gels, and wrote software to combine multiple monochrome scans into a colour image and re-align all the layers properly. As a result, my screen background was a perfect image on a supposedly unscannable £5 note.
Six months later, I ran out of funding for my PhD without very much to show for it, but didn't fancy joining the real world. There were two research projects needing people, and I very much liked the idea of one on surgical robotics for neurosurgery, but I guess that was too ambitious and didn't get funded in the end. The one remaining project was on multimedia conferencing. Now, as an undergrad I had avoided all the classes on networking as I thought they would be boring, so I was spectacularly unqualified to do research on networked multimedia, but I applied anyway as I didn't really have any alternatives left. Of course the first question at interview was ``So, what do you know about multimedia?''. The honest answer would have been that I didn't know much at all, but that didn't seem to be what the Professor was hoping to hear. I couldn't think of anything else to talk about, so I told him all about faking £5 notes.
A couple of days later I was really surprised to get offered the job, and a decade or so later, it was me that became Professor of Networked Systems. All because I couldn't resist the challenge to copy a £5 note.
But why did the professor thought you scanning a bill had much to do with networked multimedia?
Are those considered good things now? In all the games where I’ve seen them implemented, they haven’t increased fun at all, just prolonged the grind. I actually like universal paperclips more for being relatively grind-free — there is just enough boring time-consuming manual-labour to get its point across, and then it moves on
The most extreme example (I know of) in that regard is https://pmotschmann.github.io/Evolve/ which has, at last counting, 12 different ways to reset, many of which are not accessible until you have done dozens if not hundreds of others. Exploring the entire game takes years of play.
Obviously, there's still lots of grindey repetition, and it's only something for people who find slow progress towards optimizing grind rewarding.
Poking through the code though, I can see that that's probably not a problem that I'll have for long.
As with many of the better-designed incremental games, there are moments in UP where you might get the impression that the way to continue is to just do more of what you've been doing, but actually the way to continue is to do something slightly different. I think you're referring to the starkest of those.
It's been a while since I played it, but the key is to allocate as many of your resources as possible to reproduction rather than exploration, because that leads to exponential growth.
It's possible to complete the game in around 2 hours of active play, IIRC.
There's one, I don't think Cookie Clicker has an ending. It's got countless multipliers, but eventually you're completely out of upgrades and achievements and it just sort of peters out in diminishing returns.
One remark though: if you've been playing for a while, save & back-up your save games. It stores progress in a cookie (I think) and they have a tendency to expire / get lost after a while. I just opened it up (it seems I last played a year ago) and it started a new game, but I had it backed up. Save before you stop playing.
https://adarkroom.doublespeakgames.com is a link to the main site.
Fnaqobk nppbhag vf shyyl fpnaarq, V'ir nofbeorq Fxl/Fgne/Fha/Fbal/Revf/Fbyne/Whab - V fgvyy unir a0i4, RBAF, Yhan, naq Plcure hanofbeorq, ohg V'z fghpx ba rnpu bs gurz: a0i4 frrzf gb whfg unir n tnzr, RBAF erdhverf 10 pberf gb bireybnq, naq Yhan naq Plcure ner abg ihyarenoyr. Nal gvcf cyrnfr?
EDIT: Oooooh - you can (ROT13) punatr gur nepuvgrpgher bs lbhe pberf gb "zngpu" erdhverzragf gb Sbepr Nofbeo.(/ROT13). I'd assumed that (ROT13)n terlrq-bhg bcgvba zrnag vg jnf fvzcyl haninvynoyr(/ROT13). Cool, thank you!
(Never thought I’d see cross pollination between HN and r/incremental_games!)
I remember the first time that I played it, knowing absolutely nothing about it. It goes so much deeper than I had anticipated.
As a heads-up, there is more than one ending!
I even bought a zipper after I played it because it impressed me so much. It was rather expensive but the quality was pretty poor.
I really like web/html/javascript for building UIs for this reason. It's really fast to prototype and get something decent looking/working, it has a very fast edit-compile-run loop (if you don't use any fancy tooling, as fast as you can press CTRL-S, Alt-Tab, F5), great debugging tools, and in the end, your product immediately works cross platform, both on desktop and mobile!
(I grew up on Delphi).
/s
I do use fancy tooling (an editor with autosave and a framework with hot reloading), and my edit-compile-run loop is as fast as I can press Alt-Tab ;)
https://conicgames.github.io/exponentialidle/
https://apps.apple.com/us/app/exponential-idle/id1538487382
https://play.google.com/store/apps/details?id=com.conicgames...
I'd say my main issue with idle games is how much they reward you for active play. In Cookie Clicker's case, at random, golden cookies will appear that when clicked apply a random boost, e.g. a 7x multiplier. Eventually you unlock upgrades so that another one may appear while the boost is active, leading to a double boost. The ultimate combination involves a multiplier, a boost to cookies per click (again active), then selling a lot of buildings for an additional short-lived bonus, then clicking like mad.
You can earn a year's worth of idling / not playing within a minute then. If it's not more.
Imagine the wonder of introducing the right sorts of curious people to the magical world of "about:blank" and from there hitting F12 to go on a journey of making it not quite so blank anymore.
[0] https://blog.haschek.at/2014/why-hackits-are-the-first-thing... [1] https://www.0xf.at/
I am in my almost mid-40's, so I got to watch the web grow, and have my skills grow with it. Reading uncompressed source code from libraries like PrototypeJS/Scriptaculous, and early jQuery, along with the custom code per website, definitely made me the developer I am today (in regards to web development, although desktop tools have definitely gotten better, as well).
It was thought that the latter sorts of "cool hackers" sending photocopied pamphlets to schools or book stores (or software stores) stopped doing it as much when BASIC stopped being the "operating system" of home computers (the Commodore 64 was one of many that booted directly to a BASIC REPL; the early IBM PCs either booted to BASIC or had a BASIC interpreter close to hand) and BASIC interpreters stopped being "everywhere".
Now the web browser is the modern OS and Dev Tools are ubiquitous and a single button press away (almost universally F12). JS REPLs are right there for immediate use and ES2020+ is the friendliest JS has ever been. I think all we're missing are the "hacker teachers" with the right punk attitudes, an access to a Xerox, and the right sort of store willing to sell home made zip lock bags full of photocopies again.
(Or I don't know, a cheap webpage could be cool too. Make it Geocities-esque with lots of classic Under Construction GIFs and encourage people to fork it and construct it themself.)
Well, the problem is rather, that JavaScript is a pretty bad language (nobody claimed otherwise, when it was designed in 10 days), so that using something like TypeScript makes it much better. Unfortunately your browser understands JavaScript, not TypeScript.
That's the immense tragedy of web development: It's a giant pile of excrement, because it's built on several things that were never meant to be what they are used for today.
It's also why I left a long time ago, and never looked back.
For the record, I think Javascript is fine (with some nasty warts), and Typescript is a great addition. The idea that TS is great but JS sucks is silly.
Exactly, it makes it "more palpable".
> The idea that TS is great but JS sucks is silly.
Just to be clear, I absolutely did not say that. Instead, I'd rather agree with your statement that TS only makes things better. But there is only so much it can do in that ecosystem, even if a good type system does notably improve things.
Everything that's below that is still what it was.
Typo: Palatable, obviously, not palpable. Too late to edit.
There's no accounting for taste, but... aren't we still taking about polished turds on top of a pile of excrement? "Palatable" is not the word I expected to see in this subthread.
Actually... typescript's type system could work quite well in other languages and is in fact in some fashion being ported over to multiple, Python's great turnaround on type hints a few years ago was obviously inspired by it.
So, I disagree. The type system makes a wart of a language into something passable, which is a great achievement.
Isn't all programming just layers of abstraction that make the layers underneath it more usable?
If you view Typescript as a standalone language that is another abstraction -- just like every other programming language -- that may make it more palatable. Yes, it's technically a superset of JavaScript, but I don't think anyone uses it that way. It would defeat the purpose, like buying a car and then tearing out the seats, air conditioner, and sound system.
I know it all gets compiled away in JS and all, but Pydantic is surprisingly ergonomic to use and type hints are sort of a suggestion, albeit available at runtime.
Closest I've seen is Zod, but the syntax looks horrendous IMO. Maybe you look past it eventually though.
The casting doesn't guarantee the JSON from your server fits the interface, but it WILL ensure any downstream use is correct, and also enable auto complete for its fields (assuming your IDE supports it).
I've been using JavaScript on and off for nearly 20 years, and TypeScript is a massive improvement.
I have made such a library myself: https://github.com/decoverto/decoverto
Another library would be https://github.com/typestack/class-transformer
I left over a decade ago and went back to low level kernel programming.
In my opinion, everything else since is an attempt to find a way out of that mess.
I was there when the web happened, though only watching from the side lines. I also remember that there were more fitting approaches early on, but a lot of them suffered under the Internet's explosive growth: Some of the "sane" stuff at least would have needed concerted efforts for plans that have to be executed over time. But the web was already a thing, and people desperately wanted to do certain things with it. The quick hacks for that were available immediately, and they were cool: "Hah, look what I can do. You can now get a travel itinerary through your city's public transport system from the World Wide Web. Isn't that amazing?" (At the time, it was.)
I'm not saying you cannot have joy in web development. As you say, it just wasn't for me. For the reasons above.
I definitely remember as a kid learning Lua scripting because of video games. Just going over forum posts trying to make my own games or break other games.
Definitely gave me the basis to rocket ahead when I took a formal CS class.
It would be exaggeration to say QWOP has become the new normal, but only by so much...
Eventually we'll get tired of this and straighten up, I'm sure. Maybe menu mnemonics will make a comeback (they really are a good idea).
Certain people love to talk trash on JS for many different reasons, some probably valid ones too, but you can do so much with just a basic understanding.
I've probably never felt as empowered in my entire life as when I learned a bit of HTML CSS and JS; it was like I l suddenly had the tools to make tons of new projects. I didn't feel this way using Python or C (those had felt very command line oriented the way I had learned them), but when I saw how easy it was to use JS and make an interactive web page I felt like I could make full applications, games and toys and whatever else I wanted to. Having the browser to draw images and UIs and access to built in features like the HTML canvas or web audio APIs made dream projects feel much more achievable.
I think you're basically saying the same thing as the article, except their emphasis is on that they learned the skill they ended up needing while doing silly things for fun rather than trying to be productive:
> But perhaps the simplest way to view this episode was as a playful, recreational activity which through sheer dumb luck gave me the skills needed to solve an important problem in my work life. My colleague Titus Barik analysed how programmers talk about programming as play, involving ‘spontaneous and creative expression’, ‘experimentation’, and ‘purposeless, ludic activity’. He found that many programmers reflect on episodes of playful programming as joyful experiences that catalysed learning.
> I’m extremely grateful to Cookie Clicker for the journey it put me on, but even if I hadn’t ended up learning JavaScript because of it, I still wouldn’t regret, and would cherish, the many many hours I spent tinkering and clicking away in my college dorm bedroom.
I read the article as less about touting the benefit of some specific technical tool but more about the value of time spent purposely _not_ being productive. It's a counterpoint to the "cult of productivity" that espouses the important of maximizing efficiency and "hustling".
I don't mean to devalue play or passion projects, that is how I learn most. But JS itself played a big role and I wanted to share my perspective on it.
A couple months ago I tried to do a quick hack project where I could get the computer to play a sound and render an image when there was a keystroke.
Turns out with python, without additional libraries, you had to read from stdin which requires the user to end the input with newline before python could read the char. (2 keystrokes, not 1)
But I switched to JS where it’s trivial to intercept single key strokes and finished my script in ~30 minutes
Learning that a browser and a notepad are all you need to have a basically zero second feedback loop in an iterative development experience was pretty breathtaking the first time I press reload and some stuff moved around.
Yes the article strongly implies this with some added nuance:
> I’m extremely grateful to Cookie Clicker for the journey it put me on, but even if I hadn’t ended up learning JavaScript because of it, I still wouldn’t regret, and would cherish, the many many hours I spent tinkering and clicking away in my college dorm bedroom.
A mechanic all too often ruined by desperate monetization.
Grad students in dorms?
I had no idea it was possible to get a doctorate in such a thing.
And there was also a text based one about breeding cats...