9 ms·
Programs are games, programming is a game
- gitgud 3y ago> What is a Program? A program is a set of rules for converting input into output. A program doesn’t need input or output though right?… it’s just a series of logical instructions that are executed
- kubb 3y agoYou’re right. What the author is doing here is philosophizing. Trying to make connections, view things from an angle, come up with your own definition. Maybe forgetting that others have already explored the space. It’s OK to do that even if you don’t impress many people.
- kaoD 3y agoIf a program has no IO it can be reduced to not running a program at all (not counting side effects like the CPU getting warmer... but I don't think we'd count that as a property of the program itself).
- Etheryte 3y agoIO is a side effect, at least from the functional programming perspective.
- pjerem 3y agoYes but also in FP perspective, a program without IO will not be ran at all. Except if you count static parameter to not be an input, then you have a static output which is basically a constant. Compiler may in fact try to transform it into a constant and if you don’t do anything with it, well, it’ll probably be marked as unused and not even embedded in your binary.
- blowski 3y agoIf you have a program that sends an email with fixed content to a fixed email address, whenever you run that program that email address will receive an email. Is the email an output, or a side-effect?
- rzzzt 3y agourn:xkcd:1172
- infradig 3y agoNon-termination is a valid computation. No I/O involved.
- ReactiveJelly 3y agoIf the program doesn't take any input and your only output is termination time, you are writing an egg timer.
- Supermancho 3y ago> If a program has no IO it can be reduced Thats a difference between the theory and practice. In practice you always have to consider physics. There are always inputs and outputs.
- RugnirViking 3y agoI disagree, if I make a program to calculate something complicated, it can start with everything hardcoded and still be a program no? Maybe there is some academic definition im not aware of though.
- glimshe 3y agoThe result of your calculation is technically the output. But if the program is just an infinite loop doing nothing... The output is heat :).
- nonameiguess 3y agoThere seems to be a mixing of definitions going on here that is confusing people. You've got an algorithm, a finite sequence of unambiguous instructions that, given some initial conditions, will produce some end state that is interpreted as either correct or incorrect. You've got a function, which is some mapping of elements from a domain to elements of a codomain such that the mapping is unique for each element of the domain. Then you've got a "program." This one doesn't come from mathematics, so I guess that means it doesn't get a rigorous, clear, agree-upon definition. So what does the writer himself mean? He wrote an earlier post linked to from this post that provides his definition: https://blog.charliemeyer.co/code-doesnt-happen-to-you/ https://blog.charliemeyer.co/code-doesnt-happen-to-you/. My definition is a sequence of instructions provided to a machine allowing the machine to do work partially or fully autonomously once it has been started. If we limit ourselves to the kind of machine the people of 2023 commonly called programmers typically program, we've got electronic boolean state machines that receive fixed-length sequences of bits either as operands to a boolean circuit or instructions telling the state machine which boolean circuit to execute in this cycle. The instructions and operands are either persistently stored as firmware, fetched from NVRAM in the case of a bootloader, or fetched from volatile memory in the case of most other programs. These were in turned put there by some higher-level management program that read them from sources such as durable storage or buffers that may be written to by hardware that receives messages from external sources such as network interfaces, capacitative touch devices, or keyboards. Not all instructions accept operands and thus not all programs require operands. Trivially, the null program executes a sequence of NOPs. So does every program need inputs? Well, every program is a state machine. A state machine has an initial state and an end state and these usually get referred to as inputs and outputs when discussing state machines. Even the null program is a state machine. It remains in the same state at each cycle no matter the current state, such that the final state is always the same as the initial state. The null program is also a function. It even has a special name: the identity function. Like all functions, the identity function has an input and an output and these are always the same. Another trivial program is the constant function, which produces the same output no matter the input. Consider a program to factory reset or wipe a device. The initial state of the device is still an input, but the final state at program completion will not depend upon this input. What every program does not need is inputs provided at startup in the argv and envp arrays or provided interactively at runtime by other programs or human users. The mixup here seems to be readers limiting themselves to considering input only in the sense of hardware devices that get labeled as IO devices when discussing the basic taxonomy of computer organization and design, but these are one of those "the categories are made for man" things. The execution unit on a processor just receives bits from the buses connecting the processor to a memory module. It doesn't know or care where they came from and whether they were already there or not before a particular program started.
- Jensson 3y ago> the player controls a png of a dingo They control a png file, and like move it around a directory structure? Sounds cool! Anything can be a game, even just dragging around a png from folder to folder.
- ReactiveJelly 3y agoHmm if ECS is just a database, and filesystems are just databases... you might be onto something
- revskill 3y agoHm, programming to me is about connecting input and output somehow. Input -> input1 -> input2 -> (our solution) -> output2 -> output1 -> output The hard part is not the (out solution), it's about finding out what's input1, input2, outpu2, outpu1 there before getting the (maybe already made) our solution.
- Almondsetat 3y agoWow everything's a game, the world's a stage, life's a play. Never heard this before
- andai 3y agoThis one time I dreamed I went to a theater. We all sat down. The lights dimmed... and my alarm went off.
- deleted 3y ago[deleted]
- lioeters 3y ago"Anarchist Evening at the Magic Theatre, For Madmen Only, Price of Admission Your Mind" - Hermann Hesse
- rspoerri 3y agoReality Is Broken: Why Games Make Us Better and How They Can Change the World by Jane McGonigal
- ilaksh 3y agoMaybe a better description would be that programming tools are a type of toy, or programming is a type of play, in a loose sense. Because games usually have fairly well defined rules. Although sandbox games are quite popular. So maybe programming is the ultimate sandbox game. But I remember when I was a kid, the computer was always the most fascinating thing to play around with in the house. Besides the part about defining and achieving goals within some constraint, there is also the exploratory aspect of programming and computer software in general. What's in there? Could be anything. Also, what can you do with a certain subsystem, how does it behave, can you make it do something new. Programming is like making your own toys.
- scotty79 3y agoMaybe that's why I like debugging. It has clear set of rules and fairly clear win condition. Building stuff is way worse with a lot of ambiguity, cloudy goal and having to choose one thing among others equally unsatisfying ones. It has a lot of freedom but almost always I use the ultimate form of freedom and just stop doing in favor of something that's more fun for me. I know most programmers are not like me, but I'm here for the puzzle and the power of being capable ... and money of course.
- lpapez 3y agoDefinitely agree with the puzzle sentiment. I've been fortunate enough in my career to reach a point where I can sell myself as a "freelance firefighter" and now my gigs consist mostly of exploration of dumpster fires or legacy projects reboots - which I find incredibly fun. The simple sounding puzzle tasks such as "can you get this ancient project to compile on a modern compiler" are such a refreshment compared to feature planning, OKR sync and other endless, directionless and unmeasurable work.
- resatori 3y agoThis! So much! I am developing a clojure framework for making 2d games and it is the most fun I've had coding so far! Check it out: https://github.com/damn/gdl https://github.com/damn/gdl I am developing an action RPG with it (pausable): https://github.com/damn/Cyber-Dungeon-Quest https://github.com/damn/Cyber-Dungeon-Quest
- contrarian1234 3y agoI've played with neither, but how does it contrast with play-cljc?
- resatori 3y agoAs far as I know play-clj is a libgdx wrapper, play-cljc a quite low level cljs library and GDL aims to provide a simple API for 2D games without getting bigged down in details.
- deleted 3y ago[deleted]
- contrarian1234 3y agoOh, your project is not a straight wrapper like play-clj? (haven't seen a new lein project in a while!) I only took a quick look at the API docs and thought it was - sorry and it looks like play-cljc .. as the name implies, is cross-platform
- sakex 3y agoProgramming is fun, software engineering is not
- mock-possum 3y agoAre you familiar with the theory of the three types of fun? https://www.rei.com/blog/climb/fun-scale https://www.rei.com/blog/climb/fun-scale
- deleted 3y ago[deleted]
- 082349872349872 3y agoMore formally speaking, programming is a game, and a program is a strategy. Programming is a two-team alternating-play game, between Murphy et. al. on one side (the environment) and the program, as coached by Alyssa P. Hacker et. al. on the other side (the programmers), on the other side. Sometimes the programmers have the initiative, and the environment must provide a value of product type (from which the programmers have already decided a choice [a sum] of elements to keep). Sometimes the environment has the initiative, so it may choose a play from a sum type, and if the programmers wanted to play a winning strategy, they must have provided a product of responses, so that no matter which summand the environment plays, the program has a suitable response. When no further moves are possible, the game ends. At this point, if the program has successfully produced quod erat faciendum, the programmers win. Otherwise (in some cases something else has been produced, in others the game has deadlocked) the environment wins.
- bboozzoo 3y agoAlways had the impression that same could be said about solving math problems at school/uni. Some planning, knowing the right algo or tools, some creative thinking, many ways to get the desired output. Linear algebra was particularly fun when approached this way.
- MrPatan 3y agoI'd call it a puzzle more than a game. But yeah
- h4kor 3y agoRust feels like a game to me. You play against the compiler to create a valid program.
- ReactiveJelly 3y agoFighting the borrow checker, much like reaching the summit in Celeste, used to take me days, now takes mere hours
- alfonsodev 3y agoSomething I’ve experienced programming is that if you establish a feedback loop you progress faster, worse scenario is when you have legacy code in a broken local environment and changes take very long to be deployed somewhere. Mastering the art of zooming-in to the enough scope you can handle and make significant verificable progress it’s not a trivial task. Sometimes makes want to migrate to whatever language that has the best tools for debugging and more stable local dev environments so I can get to enjoy fast loops of feedback and be motivated by feeling like the progress in a game experience like article points out. Edit: Shameless plug: that’s actually what inspired me to create flowcus.bar to have constant feedback on the screen like in games. https://github.com/indiedevai/flowcus.bar https://github.com/indiedevai/flowcus.bar
- omnibrain 3y agoI often rant about everything related to the Delphi project I inherited, especially the stupid single pass compiler. But on the other hand having a blazing fast compiler that compiles even very large programs within seconds makes makes developing, debugging and testing so much easier. Even better is developing a new project with vue.js and Vite, where changes in the code just show up in the browser. Often even without visible reload. Fells like magic.
- ReactiveJelly 3y agoYeah, slow compile loops are the worst part of Rust for me. (The 2nd-worst part is fighting the borrow checker) I know it'll get faster as hardware marches on, but I often wish I could draw a boundary and say, "Look compiler, this program is months from being done. Let's say everything outside this boundary can be optimized and it won't change. But everything inside the boundary is quick-changing business logic that I'm actively debugging. Don't link or optimize across that boundary. Use wasm to enforce that if you need it." In C++ I did that with Lua for a while, but the DevEx cost of FFI boundaries is pretty awful even when the performance cost is affordable. I dunno.
- feoren 3y ago
- afc 3y agoThis resonates strongly with me. I've been working on my side project (which afaik I'm the only user of ... a text editor implemented in 65.2k C++ lines) for 9 years and ... yeah, it feels like I'm playing a game. Maybe it's like I'm building my own virtual castle, where I spend a significant portion of my time. I come up with a new feature to add and the challenge of extending my implementation to support it often feels quite similar to solving a challenging new level in a videogame. I guess a meta point one could make is that I need to make sure I steer the implementation in directions that keep the game fun, so that (this being a side project) I'll continue to play in the future.
- gorgoiler 3y agoI bought a Steam Deck recently. It is a very well crafted device and that goes for both the hardware and the Linux distribution it runs. Within a few hours I had sampled the following puzzle games: - Portal 2: simple, physical world logic puzzles with excellent script and graphics. - Stephen’s Sausage Roll: incredibly hard physical world logic puzzles with awful graphics but it’s part of the style and I love it. - The Case of the Golden Idol: interactive mystery fiction logic puzzles with even worse graphics that, again, are part of the charm. - Python 3: text based open world logic puzzles with no graphics whatsoever and some of the most fun I’ve ever had on a computer. (Edit: for clarity this is a humorous anecdote in that the last “game” on my list is a fully fledged programming language, in line with the original article’s thesis that programming can be viewed as being an excellent computer game. I genuinely had my steam deck for all of a few hours before I was using it write primes.py ;)
- shakna 3y agoOne small correction - most versions of Python 3 come bundled with the Tk DLC, which gives you graphics and a whole 'nother world of logic puzzles to solve.
- ReactiveJelly 3y agoNot to mention the dev-endorsed hack of sending HTML to a browser so that you can use text as "graphics"
- pas 3y agoOh, if you like py3, I recommend the mypy DLC! it's fun to imagine the shape and color of your datastructures and how the abstract monsters of the voidspace munch on them! and mypy helps you find the right arcane incantations, so you can be pretty sure that what you imagined will actually rip through that messy real world just the way you envisioned it! well, of course it would be unfair of me if I wouldn't mention that there are serious hazards too, as gradual typing is a gateway drug to many abilities some consider to be unnatural. (you too might wake up drenched in sweat thinking about ... what if we all are just monoids in the category of endofunctors!?)
- samsquire 3y agoI think games (and programming) cause us to feel competence. If you write an SQL query and it works or a Rust program and it produces the correct answer, you feel competent and empowered. That's your reward for playing the game. There isn't an environment where I feel truly competent in. My programs are small kingdoms where I understand how they work: they are written in Java, C or Python or Javascript. Every codebase or system has its own mental model which is slightly different to every other, so feeling competence across a large variety of things is pretty hard. There's a point when computing stuff no longer feels a game but just hard work. (Anything to do with Kubernetes, OIDC, IAM policies)
- cmrx64 3y agoThere’s a psychology concept called “self-efficacy” that I think integrates really well here, we have to summon the belief that we are capable of performing a task, and that has both positive and negative feedbacks. It’s a powerful idea: if your belief in your ability to do something gets eroded, your actual capacity is almost irrelevant. https://en.m.wikipedia.org/wiki/Self-efficacy https://en.m.wikipedia.org/wiki/Self-efficacy
- stared 3y ago“[A game is a] voluntary attempt to overcome unnecessary obstacles” — Bernard Suits Within this definition, in theory, programming is not a game. In practice, it often is.
- rspoerri 3y agoUnnecessary obstacles can be defined as voluntary obstacles or voluntary commitment. Most defintions of a game or play require it to be without real world consequence or and to be voluntary. Gardening is playing if you do it just for fun and not for food to live off. Playing soccer is no game for you, if it's your profession.
- zubairq 3y agoNice article! When I work in a company programming is not a game, but when I work on my own hobby project then programming is a fun game.. although a lot of hard work needed at times too!
- Am4TIfIsER0ppos 3y agoThen this game needs more tooltips. I want the game to tell me what the effect of changing this parameter is not compile something, run something, and watch numbers scroll past trying to intuit if it is better or worse. One other comment said a game was overcoming deliberately placed restrictions and that definitely what this is. Why can't I just dump packets onto the network at link speeds rather than trying to transmit at a constant rate? Fuck the specs, burst now!
- ReactiveJelly 3y agoThe problem I've noticed is that scrolling numbers are way easier to implement than useful GUIs. I have half-joked that GUIs are an unsolved problem. Someone called me out and said that so many GUI frameworks exist. I now think I am not joking. GUIs are an unsolved problem.
- Kalanos 3y agoprograms are simulations*
- JohnMakin 3y agoProgramming is no more a game than arithmetic is a game when doing math. It is a means to an end.
- mondocat 3y agoProgramming is game-like, but agreed, it's more tool-like. tool: a device or implement, especially one held in the hand, used to carry out a particular function.
- JohnMakin 3y agoProblems that AI can easily solve will hopefully be the more tool-like problems, while humans can think about the more abstract.
- j2kun 3y agoYou should see my math students who beg me to give them sheets of arithmetic problems.
- amoss 3y agoWhy is arithmetic not a game? Conway showed the equivalence between numbers and games. Arithmetic procedures are just wrapping a game-like structure around games.
- rspoerri 3y agoPlay can come in any form of challenge or experience. It's about wether you do it for fun or for a living. A game is more specific and often needs a challenge or a target.
- mtreis86 3y agoWhen I got into modding Skyrim I pretty much stopped playing. For technical reasons sure, there is always another change to make and their system is too fragile for any random change to be made mid-save - gotta restart the playthrough every time. It's hard to actually play when you've got mods to working on. But modding is fun of its own, and I'd have never learned any pascal if some of the opensource modding tools weren't written in it.
- CableNinja 3y agoThis was part of my problem with Space Engineers. I had 5k hours in that game when i put it down, abd more than half of that was modding time, where i was either building or debugging one of the many mods i had. I eventually put it down because of the scummy things KSWH were doing, and tried to find people to take over my mods. I agree, modding is fun, but its unfortunately a surefire way to stop me from playing the game. Once you get a look at the code you have to deal with, tactics the game devs pull, etc, just not worth doin anymore. I find tool dev to be more fun, and more rewarding
- atodorov99 3y agoI was the type that played a lot of competitive games when growing up - mostly League of Legends and some CS GO. I got quite good at at LoL and over the years have noticed that feeling of being good at something is so surreal. In LoL I developed game sense and just knew stuff before it happened - I could forsee something that would happen in a game where theoretically every game is different. After I learned to program I noticed that feeling of "game" sense can be developed for programming as well. When I am debugging something or looking at some code, I just "feel" stuff about the code, like the feeling of being reading through a function that is obviously doing that X thing. You just know without reading it whole. And you know where and how it is used without seeing it before hand. This is really enchanced for code that is written in a style that you are used to. I believe all skills develop such an extra sense and the satisfaction from using it is really high. I think a lot of people refer to this as intuition but to me particularly it feels like something that is part of the sensations of my body.
- philipov 3y agoIn the past, it used to be called Intuition, and was looked down on as feminine and unreliable. But intuition is quite similar to making use of a highly-trained neural network that's not amenable to introspection because it's an advanced filter rather than a discrete chain of syllogisms, and we have suddenly developed a lot more respect for those.
- fshr 3y agoI’m not sure what shaped your view of “the past”, but gut instinct is a very visceral and touted drive inherent in most people in most of history and isn’t more-so described as an unreliable feminine trait.
- argiopetech 3y ago> intuition ... was looked down on as feminine and unreliable Hate to be that guy, but, citation? This strikes me as the casual reframing through the eyes of an imagined arch-misogynist that has become so commonplace when reflecting on the past (which was a very different time than the present, but which enabled the present [despite the also-popular idea that we've come to our present place in spite of the past]). Happy to be shown to be incorrect.
- dqft 3y agoYou can't say this and not mention Factorio. Software engineering at the limit is just like industrial engineering except you work with bits. You need to be aware of your pipelines and timelines to ensure maximum throughput. To run with the metaphor further, you could call it a kind of instrumental play, which is the type of play where it is actually socially rude to have consistent low performance. https://www.academia.edu/34821396/Instrumental_Play https://www.academia.edu/34821396/Instrumental_Play
- otachack 3y agoShhh don't divulge the secret of Zachtronics! :P
- JoyeeChen 3y agoIn reinforcement learning, everything is a game