Back

The Unix Pipe Card Game

226 points21 hourspunkx.org
SamBam20 hours ago

As a science teacher and former software dev, I find this totally cute, and I understand exactly why the creator chose to make it a physical card game.

That said, I do think the translation into a physical card game means that kids aren't getting the experimentation and near-instant feedback that they'd be getting if they were doing this digitally.

In order for a kid to "win," they either have to already know, or explicitly be told using words, what all of the commands do. Then they have to hear the parent analyze their solution, and tell them where they went wrong. Picture, however, a different game, played online: A kid has no idea what "sort" does, but when they link the "sort" command to a blob of text, all the lines are sorted in order. Now no one has told them what this command does, but they've discovered it. By playing the role of a scientist discovering these commands, they might actually gain an intuitive understanding of them.

I'm thinking of the board game "robot turtle," where kids needed to create a "program" of commands to move a turtle to a goal. When they did that, they had near-instantaneous feedback: the parent moved the turtle. If the kid mixed up their left with the robot's left, the failure was obvious. But if the game has been re-made so that there was no board, and the parent and kid just needed to talk about whether the turtle would actually end up seven paces forward and three paces to the left -- i.e. doing it all verbally -- it wouldn't have been nearly as powerful.

So I'm not raining on this, I can see this as very cool. But I am having a hard time imagining it's the best way to learn to pipe together commands.

d-us-vb20 hours ago

As a young Linux user I always hated the experimentation aspect because usually it meant just straight up getting the command wrong 5 times before trying to read the man page, thinking I understood what the man page meant, trying again another 5 times and then giving up.

This idea of experimenting and getting instant feedback is just survivorship bias for a certain type of person, not “the way we ought to teach Unix shell”

This view is corroborated by the research summarized and presented in the programmer’s brain by Felienne Hermans.

robocat17 hours ago

> usually it meant just straight up getting the command wrong 5 times before trying to read the man page, thinking I understood what the man page meant, trying again another 5 times

I think that is a developer's superpower. The poncy term for it is grit. I tell others that the secret to leaning computers is frustration and persistence.

> and then giving up.

Knowing when to stop or change direction is hard.

I've definitely wasted years of work failing to solve something that I eventually had to give up on (most memorably depending on nasty Microsoft products).

But I've also been paid very nicely because I've solved problems that others struggled with.

And I was paid for the failures too.

bandrami9 hours ago

I've been a sysadmin for a quarter century and I've always said my only real superpower is that I read error messages when they appear, something none of my non-admin coworkers can do, for some reason.

TonyStr5 hours ago

A smart, and by no means technically incompetent friend of mine struggled to get a software product to run. He would reinstall it, try different configuration, uninstall plugins, yet every time he tried running it, the program gave the same error message. I asked him to read the error, and it very simply stated that it was failing to create symlinks because the the disk was formatted with ExFAT. Had he just piped this message into ChatGPT, he would have avoided hours of debugging.

dspillett1 hour ago

> the secret to leaning computers is frustration and persistence

And if persistence fails, bring out the big gun: belligerence.

snowmobile14 hours ago

I consider myself a fairly good developer, and I think that's in large part due to knowing, "doing this should be possible, and the reason it's not working right now is just due to stupidity (my own or the developer of whatever I'm using's)". But yes, in a few (thankfully rare) cases it just plain isn't practically possible. Even then, I've given up on problems just to have it nagging in the back of my mind and then randomly coming up with a beautifully simple solution weeks later. That's sort of the essence of what I like about programming (and math too).

jama2119 hours ago

Grit is something you gain once you already have an intrinsic motivation, such as already having a belief you can do this. Something has to spark in people that they’re capable in the first place.

godelski9 hours ago

People forget that struggling is part of the learning process. It's great that people want to make things easier to learn, but struggling is essential. You want to ensure that people don't struggle so much they get stuck (one extreme), but you don't want to make it so easy people don't struggle at all (the other extreme). There's balance, but that balance requires struggling.

godelski9 hours ago

  > I think that is a developer's superpower.
I do too, but only because we can do both.

I think comparing math education to programming education is quite apt here. After all, programming is math[0]. Both are extremely abstract subjects that require high amounts of precision. In fact, that's why we use those languages![1]

One of the absolute most difficult parts of math is that you don't have feedback. Proving you did things correctly is not automated. You can't run it and have an independent (not you) mechanism tell you that the output is what you expect it to be. This leads to lots of frustration as you sit there thinking very hard about what you've done wrong. It is frustrating because you're often blind to the mistakes as that's why you've made them in the first place! But the upside is that you quickly become attentive to details and learn those pitfalls very well. This also means you can abstract very well (the entire point of math) as you learn to abuse things on purpose. The struggle is real, but the struggle is important to the learning process. You learn very little if there's no struggle. Your mind is made to remember things that are hard better than things that are easy.

In programming we typically have the opposite problem. You get instant feedback. This makes iteration and solving your specific problem much faster. You can experiment and learn faster as you poke and prod seeing how the output changes. BUT there is a strong tendency to leverage this too much and use it to outsource your thinking and analysis. Iterating your way to success rather than struggling and analyzing. This doesn't result in as strong of neural pathways, so you don't remember as well and you don't generalize as well. Having taught programming I can tell you that countless students graduate from university[2] thinking that because the output of their program is correct that this means that their program is correct. This is a massive failure in logic. Much easier to see in math that just because 3+3=6 and 5+1=6 doesn't mean that the process is equivalent[3]. The correctness of the program is the correctness of the process, not the correctness of the output.

While that's the typical outcome of learning programming, it isn't a necessary outcome and there's nothing stopping anyone from also using the same approach we use in math. Math is only that way because we're forced to[4]! Both have their strengths and weaknesses, but neither is strictly better. The strictly better learning path is the combination and that is the superpower we have. It's just easy to abdicate this power and only do the easy thing.

[0] We can really say this from Church-Turing but if you really have concerns with this statement you'll need to read more up on the theory of computer science and I suggest starting with lambda calculus.

[1] https://www.cs.utexas.edu/~EWD/transcriptions/EWD06xx/EWD667...

[2] and even graduate degrees. You'll also see this idea prolific on HN and I'm sure someone will respond to this comment countering the point

[3] You can abstract this, I'm not going to do some long calculation here but I'm sure most people have done a long calculation where they got the right answer but the process was wrong and they had a professor still mark them wrong (and correctly so).

[4] If you're going to lean on me I'll concede

nomadygnt19 hours ago

Maybe I am wrong about this but I think a lot of recent research has shown that trial and error is a great way to learn almost everything. Even just making an educated guess, even if it is completely wrong, before learning something makes it much more likely that you remember and understand the thing that you learn. It’s a painful and time-consuming way to learn. But very effective.

Maybe Linux commands is a little different but I kinda doubt it. Errors and feedback are the way to learn, as long as you can endure the pain of getting to the correct result.

d-us-vb9 hours ago

Trial and error is necessary and beneficial, but not after the student becomes frustrated or anxious/bewildered by the complexity. The research shows that striking a balance between teacher intervention and trial and error is the optimal approach. If a teacher notices that a student is way off course but they keep persisting in one branch of the trial-and-error search space, it’ll be best if they intervene and put the student on the right branch. The student can still use the knowledge of what wasn’t working to find the solution on the right branch, but just persisting would be ineffective.

Gaining true understanding/insight is necessarily trial and error. Teachers cannot teach insight. But they can present the optimal path to gain insight.

cheesecakegood16 hours ago

Needs qualification. Research shows trial and error learning is very durable, but it’s not the most time efficient (in fact it’s relatively poor, usually, on that front). The two concepts are a bit different. Yes, trial and error engages more of the brain and provides a degree of difficulty that can sometimes be helpful in making the concepts sticky, but well designed teaching coupled with meaningful and appropriately difficult retrieval and practice is better on most axes. When possible… good teaching often needs refinement. And you’d be surprised how many educators know very little about the neuroscience of learning!

+1
zahlman16 hours ago
JamesTRexx16 hours ago

Trial and error was the root of what became my IT career. I became curious about what each executable did from DOS and with that did my first tweaking of autoexec.bat and config.sys to maximise memory. Years later I was the only one who could investigate network (and some other) problems in Windows via the command line while I was the junior of the team. Ended up being the driver of several new ways of working for the department and company.

+1
raddan13 hours ago
shakna17 hours ago

I'd add nuance to Hermans' work. Its not all experiment blind, but also not feedback-less. They advocate for "direct instruction", not just rote learning.

> As that is not a surprise, since research keeps showing that direct instruction—explanation followed by a lot of focused practice—works well.

Note the "lot of focused practice".

[0] https://www.felienne.com/archives/6150

raddan12 hours ago

There’s a pretty rich literature around this style of pedagogy going back for decades and it is certainly not a new idea. My preferred formulation is Vygotsky’s “zone of proximal development” [1], which is the set of activities that a student can do with assistance from a teacher but not on their own. Keeping a student in the ZPD is pretty easy in a one-on-one setting, and can be done informally, but it is much harder when teaching a group of students (like a class). The. Latter requires a lot more planning, and often leans on tricks like “scaffolded” assignments that let the more advanced students zoom ahead while still providing support to students with a more rudimentary understanding.

Direct instruction sounds similar but in my reading I think the emphasis is more on small, clearly defined tasks. Clarity is always good, but I am not sure that I agree that smallness is. There are times, particularly when students are confused, that little steps are important. But it is also easy for students to lose sight of the goals when they are asked to do countless little steps. I largely tuned out during my elementary school years because class seemed to be entirely about pointless minutiae.

By contrast, project work is often highly motivational for students, especially when projects align with student interests. A good project keeps a student directly in their ZPD, because when they need your help, they ask. Lessons that normally need a lot of motivation to keep students interested just arise naturally.

[1] https://en.wikipedia.org/wiki/Zone_of_proximal_development

inopinatus16 hours ago

I'm trying to remember being a young Unix user but it was four decades ago, so the details become hazy. Nevertheless the proper go-to after the manpage fails to clarify matters is the same as it ever was, that is, one reads the source code, if you have it, and this is easier today than ever.

vacuity14 hours ago

I'd like to add that, while anything will have some learning friction, learning the Unix CLI is rather unnecessarily painful.

trashb2 hours ago

I actually feel like the Unix/Gnu CLI is quite nice (yes I'm used to it already). I feel like it provides a lot of consistency through community standardization and standardization through POSIX and libraries. For example it's quite difficult to find a program that breaks the "-o --option" long/short options and if you do the "man command" or "info command" pages will tell you how to use a program. In my experience this is quite different on for example Windows.

Learning it is a step but once you've learned the basics you can read 90% of the commands.

raddan13 hours ago

I’m curious: what do you see as unnecessary about the CLI? Or, to put it another way, in what way should the CLI be changed so that the only remaining difficulties are the necessary ones?

+1
vacuity11 hours ago
jackdoe16 hours ago

> But I am having a hard time imagining it's the best way to learn to pipe together commands.

To be honest, it is very strange how hard it is to teach programming concepts, for some reason almost all humans use computers but only 0.1% or so can program them.

I am not sure we have the 'best way' to teach anything computer related.

People develop world model for physics quite early, they know they can pull with a rope but cant push with a rope.

And they get intuition, things that are thrown up, go down, and they can transfer this intuition in the math, because math is real.

For some reason its hard to do that with code. People keep trying to push with a rope, even after studying for many years.

PS: I am trying to teach her neural networks now and am working on this RNN board game https://punkx.org/projekt0/book/part2/rnn.html to fight the "square" dragon. I want her to develop good world model for neural networks, so that she understands what chatgpt is. I just keep experimenting, sometimes things click, sometimes not.

bc569a80a344f9c16 hours ago

> almost all humans use computers but only 0.1% or so can program them.

This is nitpicking but I was curious: there are 4.4 million software developers in the US (https://www.griddynamics.com/blog/number-software-developers...). The population is 340 million, 0.1% would be 340,000. You’re off by over one order of magnitude.

jackdoe15 hours ago

there are 45 million devs in the world (out of which probably 10 can actually program) and 8.5 billion people

we could say 0.5%?

antonvs5 hours ago

It’s misleading to use the entire world’s population. A very large proportion of that hasn’t ever had the opportunity to learn to write code.

smj-edison14 hours ago

> I am not sure we have the 'best way' to teach anything computer related.

Not saying this is the best way, but have you followed any of Bret Victor's work with dynamicland[1]?

[1] https://dynamicland.org/

jackdoe13 hours ago

Yea, and I think it is amazing, but in the same time it will work for some and not for others

The same way scratch works for some, redstone for others, and https://strudel.cc/ for third

I think the truth is that we are more different than alike, and computers are quite strange.

I personally was professionally coding, and writing hundreds of lines of code per day for years, and now I look at this code and I can see that I was not just bad, I literally did not know what programming is.

Human code is an expression of the mind that thinks it. Some language allow us to better see into the author's mind, e.g forth and lisp, leak the most, c also leaks quite a lot e.g. reading antirez's code or https://justine.lol/lambda/, or phk or even k&r, go leaks the least I think.

Anyway, my point is, programming is quite personal, and many people have to find their own way.

PS: what I call programming is very distant from "professional software development"

dr_kiszonka8 hours ago

Amazing diagrams!

derrida16 hours ago

hey, I just copy and pasted your comment into an agent I hope you don't mind.

one shot result:

https://wonderful.exe.xyz

you could do the same, or I could give you access to this one if you want.

empath7515 hours ago

unreal that an agent knocked this out in one shot.

derrida15 hours ago

well, technically 2, my second was "good, now do it better"

antonvs5 hours ago

fyi, the dragging feature doesn’t work on iPad.

dhosek19 hours ago

I’m wondering whether it could be played with a Unix box connected to the big TV in the living room so that with each command added to the pipe you can see the result. That’s my instinct for what to do with this, although it does feel like it is a play once kind of game.

williamcotton16 hours ago

Would this be something along those lines?

https://github.com/williamcotton/guish

It's a GUI for constructing and executing Unix pipelines and it shows the output of each step in the pipeline.

dhosek14 hours ago

I’d been thinking more just typing the commands into a terminal window on the big screen, but something like this could be really helpful for seeing the intermediate steps.

derrida15 hours ago

woah that looks nice!

d--b15 hours ago

One could make an app that actually scans the cards from a distance and computes the stuff. Brett Victor style.

hagbard_c41 minutes ago

I already foresee the quibbling on the answer to all the print the nth line questions: do empty lines count? In *nix-land they certainly do, in player-land they might, then again they might not.

When little Johnny gives teacher his 2000 line essay consisting of 1998 empty lines flanked by My 2000 line essay and That's all Folks! teacher will give Johnny a 1 or an F (depending on locality, might even be E where silly rabbits banned 'F' scores). But teacher, I played this here game of cards where empty lines did count won't be accepted as valid reasoning.

gorpomon50 minutes ago

These are very very cool! I am sad they're sold out, but thankful they can be printed.

GNOMES19 hours ago

This gets shared a ton, but the old Bell Labs video from 4:56 to 10:52 is still the best way I have seen pipes explained:

https://www.youtube.com/watch?v=tc4ROCJYbm0

Dilettante_18 hours ago

Nit: You can get a link to a specific time in the video by clicking the "share" button and ticking "start at": https://youtu.be/tc4ROCJYbm0?&t=296

cube0018 hours ago

Great video, when I first watched it, it switched my thinking from "why is *nix so hard to use" to understanding they were really trying to build with the user in mind and to learn more about the "*nix way" to work with it, not against it.

racl10119 hours ago

It's amazing how these ideas conceived almost 50 years ago still are helpful for new computer users today. Just goes to show how well planned it was.

huflungdung10 hours ago

[dead]

xandrius20 hours ago

Interesting concept but in the current format it feels like a game to bring out exactly once with a very specific group (or perhaps an unexpecting child), play for 10-15min, smile to oneself and then put the deck where these sorts of games go die. If it is attempted to bring it out again with the same group, I'd expect a response similar to "Again? Didn't we play it already?" with some disappointment.

At least it was just $5 but I think it's 1000% more fun to actually use a unix terminal with some sort capture the flag kind of game.

jackdoe19 hours ago

Unix Pipes is a "play once" game, just so you can try some ideas, then try them out on the computer.

I used to randomly set HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon Shell to cmd.exe on my daughter's laptop so she can run programs from there, e.g. go the discord directory and start discord from there.

Then I made unix pipes just to help her with https://overthewire.org/wargames/bandit/ and so we can discuss how do you make "programs that do not know how they will be used", e.g. the programmer of "sort" does not know how it will be used, and you can create ridiculous pipe chains with the cards, just for fun.

Of course I made other random tasks, e.g. we take a random book and we start "catting" and "grepping" it

Most of the games i made on https://punkx.org are like that, i am just trying to teach her something and i need a bit of physical help to "get out of the computer"

The only real card game is http://punkx.org/punk0 which is like uno with state and I play it often with friends, and https://punkx.org/overflow/ which is super intense depending who you play with.

xn--yt9h6 hours ago

Can highly recommend buying from this guy; there was a holdup on my order once so he reached out personally to make sure it was okay and he also gifted me with another set. Worth supporting even if it's just an untouched collectible!

Contax16 hours ago

Love this. I once (2017 I think) made a card game based around MS-DOS with elements of Crazy Eights which I called Crazy DOS (shortened C:DOS) but got zero attention so I moved on. I might try this one, I love this kind of stuff.

slybot20 hours ago

Earlier discussion on this;

2024 - https://news.ycombinator.com/item?id=41047110 (41 comments)

2022 - https://news.ycombinator.com/item?id=33222687 (59 comments)

giancarlostoro19 hours ago

We need one for SELinux for adults, it'll lowkey force people who haven't taken the time to learn SELinux to learn it and be fully capable of using it without fear.

dvratil15 hours ago

Well, there's a SELinux coloring book - you need to start with SELinux while they are still young! https://people.redhat.com/duffy/selinux/selinux-coloring-boo...

cube0018 hours ago

I felt a lot better after seeing even the all knowing LLMs couldn't explain how a set of files were getting labelled automatically with a label that didn't match the parent directory.

seeknotfind21 hours ago

I bought several of these and give them as gifts. Unix Pipe, Expansion Pack, and PUNK0 are my favorites.

behnamoh19 hours ago

I wish pipes would transfer more than just text to avoid re-parsing.

somat18 hours ago

Pipes don't transfer text, they transfer a unformatted byte stream. The commands however do expect a particular format. There is going to be serialization/parsing regardless of the format the command expects. Even if it is an internal object format as found in powershell commands.

allegretto18 hours ago

Could I introduce you to https://www.nushell.sh/, kind sir?

Started using it last year and being able to type ‘ls | sort-by modified -r | take 5’ feels liberating.

zahlman16 hours ago

Disappointing that Debian seems completely uninterested in this :(

matt_kantor19 hours ago

To be fair they really transfer bytes, which can be any data format you want.

snarf2120 hours ago

I used to work with a guy in the data group at MapQuest a long long time ago and the stuff he could very quickly do with nothing but awk and sed was insanely impressive.

sfblah20 hours ago

What a good idea. I couldn't see on the site if there's an online version (especially relevant since it appears to be sold out in physical form).

kykeonaut20 hours ago
j2kun19 hours ago

I saw that huge box of decks they printed for this, and I though, oh dear, how are they going to sell that many copies? :(

jackdoe16 hours ago

:) I actually printed a lot so the price is cheap, and I could sell for 5$ then I sold them until I recoup the printing cost and donated the rest to schools.

I am thinking of doing a reprint, but tbh shipping is so expensive now, and I there is also USA's tariffs and etc.

lrvick11 hours ago

I would pay triple to not have to worry about how to print and box these all neatly as you did. Please take my money for this and all your other games.

LollipopYakuza19 hours ago

"Teaching kids"? Well as a professional in IT I wished I knew how to answer all this!

psarna19 hours ago
rbanffy20 hours ago

Still sold out?

maximgeorge16 hours ago

[dead]

huflungdung10 hours ago

[dead]