12 ms·
Tell HN: My child's first program
Last night, I introduced my kid to programming. We'd done some stuff with Mindstorms before, but she never really caught the bug for it. But for some reason, last night when I showed her some simple Python scripting to solve math problems and write to the console, she was enthralled.
After guiding her through a few things, she took the laptop off for a while and then came back with her first program, giggling like a maniac
you='WOW!!!'
fart='So many poops!'
print(you,fart)
I'm pretty proud :D
- gardenhedge 4y agoWhy not rust? /s That is sweet. Congrats.
- vbordo 4y agoBecause this program requires garbage collection :)
- napolux 4y ago#dadjokes #swooosh
- trynewideas 4y agohell, get her poop-farting in 6502 assembly and in 10 years she'll be front-paging HN twice a week
- jamst174 4y agoHaving a 7 yo and 4 yo, this completely tracks. Nice work.
- zhouyisu 4y agoI'd like to see what instruction could let ChatGPT output such invention.
- napolux 4y agono tests, no ci, no dockerization, no deploy on the cloud NO HIRE for me
- ivraatiems 4y agoCounterpoint: Good variable names, concise and readable. Really conveys that you fart, I don't think I could escape knowing that having read this. Shows initiative - she did this on her own. I think we could bring her on as a junior.
- sircastor 4y ago"One of us! One of us!" Congrats! What a fun and delightful thing. Props to you, and here's to many more enjoyable programs. Thanks for bringing a little humor to my day.
- jaydub 4y agoHere's to many more joyful moments! Congrats!
- d--b 4y agoShow her how to loop through the print statement and she’ll be hooked forever!
- bombcar 4y agoI suspect some major portion of computer programmers discovered loops via 10 PRINT "FARTS" 20 GOTO 10
- SoftTalker 4y agoYep, pretty close to my first program on an original TRS-80.
- gibspaulding 4y agoHah, I think one of my first computer programs I wrote on my own looked something like this: while (true) { cout << "Fuck!"; }
- jansan 4y agoEvery Commodore 64 in every department store that I went to was running that loop (but with "Hello") after I left.
- Doctor_Fegg 4y agoI got thrown out of Currys (UK electrical store) aged 11 for doing that with 10 PRINT “Welcome to Currys the electrical ripoff store” 20 GOTO 10
- bombcar 4y agoThe key was learning how to add a delay at the beginning and then the bell character in the message.
- dugmartin 4y agoI did this probably too many times in Radio Shacks as a kid, using a word with one less letter (along with a space to generate a nice diagonal pattern on the screen).
- planede 4y agoWhat's the license, are you allowed to distribute? Anyway, we already started using this in production, we expect some free support. /s
- joshxyz 4y agoshit man what if github copilot picks up on this
- jvm___ 4y agoSo. I made a deal with my kids that they could have a phone if they made an app. There's enough youtube tutorials and they're old enough to follow them. I could have helped them more over the summer, but we didn't get it done. Now ChatGPT will generate the flutter code for an app in seconds, as well as guide you with 'show me how to install flutter'. It's crazy that all the code is written for you. I tried one of their timer/todo list ideas and it generated the code, I just need to install flutter and run it today. So a summer long project of learning to code has been reduced to copy-paste instructions from an AI chat bot. Crazy times.
- highfrequency 4y agoIs the ChatGPT sample code/tutorials much better than the tutorials that can be found on Google?
- teaearlgraycold 4y agoSounds like copying from GitHub with extra steps
- gardenhedge 4y agoIt's more like having an assistant who can do it for you so you need no/little knowledge of GitHub.
- jvm___ 4y agoLess steps as the code it generates will do what you ask of it, or be modified based on your english language changes. It also gives you a human readable section, in addition to the code, that tells you what the code is doing, and where exactly to copy/paste it to make it run. Give me an app in flutter that does X How do I install flutter How do I run my first flutter app That only requires typing and reading for exactly the results you want. Github only gives you what you know already. ChatGPT only gives you what you asked for, and holds your hand for how to use it.
- jvm___ 4y ago
- rglover 4y agoYES! Great things ahead.
- racl101 4y agoShe is the One.
- WrtCdEvrydy 4y ago.... to be honest, fart humour is pretty universal. This could be a 16 year old kid to be honest :D
- nxmnxm99 4y agoHe never mentioned how old the child is. Could be 23!
- racl101 4y agoMy 30 year old ex blue collar worker buddy who took up programming wrote something like this ... but it's too crude for HN.
- jansan 4y agoRick Sanchez is a great fan of fart humor ("He may have manifested some sort of butt") https://www.youtube.com/watch?v=dGqYfoO1eqo https://www.youtube.com/watch?v=dGqYfoO1eqo
- bgoldste 4y agoAdorable. Interesting that mindstorms didn’t take while Python did. I’d kind of assume the opposite, since MS is more tangible and easier to visualize.
- margalabargala 4y agoIMO Mindstorms is a bit more of an all-in proposition; you have to build a thing that does a thing, and then build a "complete" program for it. I never really got into Mindstorms either, I remember I would build a thing, then use the pre-loaded programs to run stuff, but then because I was starting from zero and didn't really have an understanding of what was going on, I wasn't able to really fiddle around very much. With Python, it's easy to get something from very little- as is seen here from OP.
- OkayPhysicist 4y agoThat was my experience with it, too. The feedback time is just too long for autodidactic play. Leetcode style stuff and hacking stuff together in Python? Fantastic. That said, I did get really into Mindstorms when I went to summer camp that split the days between that in the morning and 3D modeling in the afternoons. Once the time was more structured, the feedback loop of "modify working code on a working robot and see what happens" was very fulfilling.
- tricky 4y agoHilarious! After a few of those, I taught my son how to open the javascript console and "hack" his favorite cookie clicker. He was so excited to show his friends but the school-provided chromebooks are really locked down. I was disappointed, thinking that would be the end of it, but his whole class has been trying to find ways around the blocks and filters ever since. They've found some clever workarounds and a lot of things that sort of look like hacks but are not. It's adorable.
- fredley 4y agoPoorly implemented device lockdowns by my school were the start of my interest in understanding and manipulating systems, long may they last!
- coldpie 4y agoYuuup. My favorite instance in I think 9th grade was opening the computer case while the teacher was out so I could pop out the CMOS battery to disable the BIOS password, boot a live disk without the disk protection software (Deep Freeze), edit the Win95 boot logo screen[1] to put a little smiley face in the corner, and then put it all back together (sans BIOS password, since I never knew what it was originally!). No one ever mentioned it, but I'd see my little smiley every time that PC booted. Later, I spent 13 years working in reverse-engeering-related software :) [1] https://www.dslreports.com/faq/3880 https://www.dslreports.com/faq/3880
- lozenge 4y agoThe default admin password for a popular educational software that locked down Windows was "changeme". My school did not change the password.
- RugnirViking 4y agoits excellent! my school only let us modify files in our user network folder, and locked down anything on the C: drive. Turns out, if you could open cmd (you weren't allowed directly, but you could ask a vba script from excel to open one) you could just rename the C: drive to the K: drive or whatever, and that wasn't blocked lol. I'd use it to hide games like https://wz2100.net/ https://wz2100.net/ on particular computers, and show my mates which ones were on which computers, and make little excel files that had macros to open them
- fbn79 4y agoI started programming as an autodidact in fourth grade, creating programs on an Amstrad with BASIC language, reading the instruction manual (I didn't speak English). I remember the joy when I had the idea that it was possible to add a variable to itself to increase a number A = A + 1 instead of having to use multiple variables and that testing it worked. I felt like a genius.
- neilv 4y agoThis is more sophisticated than my first line of code, but maybe reflects some universal underlying truth about how all of humanity is connected. We kids finally got parents to buy a computer. They brought home a TI 99/4A, plugged it into the TV, kids all gathered around, got to the TI Basic prompt, everyone's full attention, but we didn't know what to do. Someone typed something, got an error message, and a few more things. One of us asked whether what we type "goes into the memory of the computer", wide-eyed fascinated. Then we proceeded to type juvenile naughty things into this memory of the computer, which is the greatest thing.
- mawise 4y agoFor those with even younger kids (they say ages 5-7), you might enjoy checking out Scratch Jr[1]. Building-block style programming with lots of examples for kids to get started on their own! (No affiliation, I just loved what happened when I gave it to my kid) [1]: https://www.scratchjr.org/ https://www.scratchjr.org/
- xyzelement 4y agoI love the variable names. I definitely had the same naming conventions as a kid :) Funny story. Sophomore year at college, I worked at a dev shop, and I was the first person to set up version control there (CVS... it was like year 2000.) The next day I reviewed changes that were merged and variables $tit and $ass were all over the place. I assumed the guy who checked it in was just immature and met w him to "professionalize" him. But turns out these variables referred to Titles and Assignments (it was staffing software). LOL!
- belthesar 4y agoAs a kid? When writing stupid scripts, I frequently use `fart` as a variable name to this day. I'm a staunch supporter of naming variables intentionally in software that lives, but I'm definitely not above doing a `fart=True; while fart: ...` in temporary repl work. Maybe I'm just eternally 10 years old, haha.
- rootusrootus 4y agoHeck, when I write throwaway scripts most of my variables are different slang terms for feces. Sure, I use foo, bar, baz, bing sometimes too. But I never grew up either. At some point I decided that was a Good Thing, and I have no further plans to mature.
- taylodl 4y agoI must be old-fashioned! My variable names in throwaway programs tend to be x, y, and z and my iteration variables tend to be i, j, and k.
- deleted 4y ago[deleted]
- noboostforyou 4y agoSame (did you start learning programming with C?). i++ is pretty much hardcoded into my brain.
- 4y ago
- dhosek 4y agoThe first program I ever wrote was in AppleSoft BASIC. It would pick a random location on the screen and print MILK in inverse text at that location. And then GOTO 10. Anyone else remember their first program?
- incanus77 4y agoWasn’t quite my first, but one of the earliest I recall on a TI-99/4A was programming the Jeopardy! theme song with frequencies and durations in CALL SOUND statements.
- Arrath 4y agoAn AutoIt script that opened the cd tray and popped up a message box with some taunting phrase or another.
- rumpope 4y agoMy son took a coding class in elementary school (MIT scratch), and he came in one day and told his teacher that his Dad was a "pro programmer" and had helped him. The program was a pigeon farting on a man's head. The teacher asked what Dad had helped with, and he said "he recorded the fart sound".
- ct0 4y agoAll programmers have to start somewhere. My first program was an interactive piece of concrete.
- dieselgate 4y agoMuch like the parent's comment, we all need to fart somewhere too
- mcv 4y agoMy first was a car (seen from above) driving up the screen, disappearing from the top by printing empty lines below it, and then appearing from the bottom after 24 empty lines. I thought it was the greatest trick ever. Meanwhile my brother was reimplementing every game he saw, including Tetris and some early Mario game.
- wildcow 4y agoThis comment is my spirit animal.
- bredren 4y agoCan we get a link to this scratch, please.
- ryloric 4y agoThanks for making my day!
- bitwize 4y agoI've always said that most kids my age got the programming bug with something like the following: 10 PRINT "FARTS" 20 GOTO 10 And it's as good a start as any other. Probably better since it drives home the idea that the computer follows your orders, even to the point of breaking taboos. There was an intro to computers book from the 80s that was written entirely this way. Its first example Pascal program concatenated the strings FAR, TIN, and G, yielding FARTING. When they wanted to introduce machine language and assembly language, they invented a pretend instruction set and an assembler for it, calling it the Simple, Excellent for You Assembler, or SEXY ASS.
- scrumper 4y agoNow to suck the joy out of it for her by giving her a code review and a lecture about I18N :) I like that the code itself is almost poetic, and is in itself a statement about the problem domain. Knuth would be proud.
- artursapek 4y agowholesome
- kiliancs 4y agoHedy https://www.hedycode.com/ https://www.hedycode.com/ has worked very well with my kids. It starts as an extremely simple language, minimizing friction, provides good examples and exercises, and gradually adds more and more to the language. Finally, it tells you that with just a couple minor changes, you have now learned Python.
- tuckerpo 4y agoBetter code than most engineers can muster.
- nonrandomstring 4y agoMy girl's favourite saying at the moment is "command not found". That's the thing she reads the most, except on the occasion it does something. Walking around the house saying it gave way to answering back to requests with "command not found daddy". What have I unleashed?
- _dain_ 4y agothis is the content i log on every day for
- jasonhansel 4y agoPR review: - Reformat with `black`; needs space around "=" - Change constants to uppercase, so YOU and FART - Probably best to use an f-string, e.g. f"{YOU}{FART}" - Needs tests Otherwise LGTM
- quotehelp1829 4y agoYou forgot space between } and {
- jasonhansel 4y agoIt depends on whether you want the whitespace or not; if so, the ideal would be to use: messages = [YOU, FART] print(" ".join(messages) So that you can add additional messages (manually or programmatically) in the future. Always important to consider extensibility!
- ihaveajob 4y agoMy kid really took to Scratch last year when he was 6. We got a Raspberry Pi 400 and reading the manual he saw a full chapter on Python. Now when I'm working, he'll come by and say "hey! that's Python!" Conveniently, the [turtle module](https://docs.python.org/3/library/turtle.html https://docs.python.org/3/library/turtle.html) comes built-in and he also got to draw some fun patterns after reading the "Secret Coders" comic book series. It's really fascinating to see him develop his mental models.
- eggroe 4y agoI just was showing my daughter some basic Python last night as well and she seemed very interested, but didn’t leave my laptop with her lol so crazy to see this on HN today! Let her have fun! Lol cool to read about today!
- beaned 4y agoI wonder if humor plays a role in developing minds the same way play does. It just seems so universal and good-natured in children.
- quest29 4y agoNice.. I taught 2nd graders and up Computational thinking and python programming for 1.5 years during covid and it was fun and rewarding - this is the repo https://github.com/TheRockStarDBA/CodingForKids https://github.com/TheRockStarDBA/CodingForKids
- SavageBeast 4y agoAccenture will hire her right now! Get after that! I'd be proud too! My first program was merely Hello World and frankly, this is a bit more complex than that.
- ln210484 4y ago
- jrootabega 4y agoI thought fart was a reserved word. Or is that coming in 3.12?
- rdmcelrath 4y agoI guess it is true! All code has a smell...
- avgDev 4y agoWould you mind sharing how old is your child? My son is almost three. I also want to get him into programming. I am utterly sad that my dad wasted his brain doing manual labor as we grew up in a small city in Poland and he never had the resources to even own a computer. He would be a good programmer, as I got it from him. He is really good at finding solutions to repetitive tasks and hates to do the same thing twice.
- yonaguska 4y agoMy father was a brickmason. He could lay a completely level row of brick, using no line- and in the time that it would take 3 people to do the same thing. After a long conversation with him about learning and doing things- I realized that he would have been a very good programmer if he had been able to do so.
- mmcgaha 4y agoMy oldest daughter's first real programming project in school was a Mondrian style art generator. I was so proud of her that I wrapped it up as a CGI and put it on the kids web site. Too bad her excitement for her project was exactly 0% my excitement.
- gigatexal 4y agoHaha you should print it and frame it. Your daughter has a bright future! And a good dad to boot, kudos to you both!
- numlocked 4y agoThe thing that got me to learn OO programming (9th grade...probably 1999) was my desire to write a program that contained the line: > if (ned.isStupid): and show it to my best friend, Ned, who only knew how to program TI-83 calculators.
- jcpst 4y ago<3 Farts and poop talk all the time. There was a post in the past where someone talked about “the function game”. You think of what the function does. The other person gives you “input”, and you give them back “output”, and they try to figure out the internals. Great to play anywhere. There were plenty of fart and poop functions.
- dllthomas 4y agoVery cute! I've been bragging for a bit about my boy's first proof by induction: "Hey dada, if seven ate nine, and that means seven ate ten... then there aren't any numbers bigger than eight!"
- septune 4y agoEditing a game written in BASIC on Amstrad CPC, swapping original author name with mine. Reaching level 9000 of happiness watching my name at the screen. Then playing with C and mode 13h to simulate a an explosion of pixels using for loops. Damn i was 10 and i’ll remember forever.
- tmaly 4y agoShow her some Scratch programming. Kids I have taught, love that they can record and play back the sounds with programming blocks.
- empressplay 4y agoI showed many kids in my school how to program the Commodore 64 on display in the local KMart to display obscenities to shoppers: 10 PRINT "Whatever obscene thing comes to mind" 20 GOTO 10 RUN That's probably the only code many of them ever learned.
- dontbenebby 4y agoNow have them put it on GitHub ;-)
- hnthrowaway0328 4y agoThat's the moment to memorize for ever. I bet that's one of the scenes you will remember before you die (no offence, just thinking about American Beauty). I would.
- iamgopal 4y ago:D, my son tired of changing battery of a computer mouse, added charger circuit and battery of his old toys, ( that’s charging circuit of Bluetooth speaker and that’s old helicopter toy battery ) As 8 year old, I’m proud that he recognised a problem and solved it. https://www.dropbox.com/s/ivuxfgyv9ehlvdu/View%20recent%20photos.png?dl=0 https://www.dropbox.com/s/ivuxfgyv9ehlvdu/View%20recent%20ph...
- ylee 4y agoI well remember the epiphany I felt while learning Logo in elementary school, at the moment I understood what recursion is. While I have never worked as a professional software developer, computers have been a hobby all my life. I don't think the fact that the language I have mostly written code in in recent years is Emacs Lisp is unrelated to the above moment.
- MattDemers 4y agoAdorable. Save that in case she ever gets married.
- ianbicking 4y agoMy daughter was really inspired to explore Scratch by finding all the distinct things she could simultaneously name "poop". I believe she got a variable, list, block, sprite, backdrop, costume, sound, and the project itself. Lots of distinct namespaces there. Very educational.
- mathfailure 4y agoThat's not reddit, I wish crap like this be removed from hacker news.
- AussieWog93 4y agoIf the community as a whole didn't like lighthearted posts like this, they're be buried. Fortunately, it seems that the rest of HN aren't a bunch of miserable old bastards too. :P
- oaiey 4y agoI hate the idea that a community is only on topics. Humans are wholesome things. A certain percentage off-topic is cool.
- dusted 4y agoThat's excellent! Variable assignment, strings, function calls, and two layers of humor! I'm interested as to what age she was when she figured this out? I'd think maybe a 10 year old ? But one steeped in tech from the start maybe younger? 8 ?
- liampulles 4y agoI got hooked into programming via Game Maker, and I've heard of similar experiences from a few of my colleagues. Good fun taking a platformer base and messing with the physics calculations. :)
- hoc 4y agoProud you both can be. Now, with the advent of programming languages supporting full Unicode encoding (e.g. in Swift) since a few years ago, the option of Emoji as variable names should not be forgotten... (Unfortunately the HN comment system does not support Unicode and justs deleted them from my neat example)
- nilslindemann 4y agoMy first program was drawing an escher stairs using basic. Computer screens had just two colors these days, dark green (background) and light green (foreground). Things were simple and fun these days.
- joshxyz 4y agothat's fucking hilarious, well done!
- DoomKangaroo 4y agoAidan was here
- nurettin 4y agoHad my proud dad moment when I gave my (then 6 year old) son a TI-85 during a covid lockdown and he started playing around with generating random waves and learning for/next after a few months of fiddling.