[HN Gopher] Tell HN: My child's first program
___________________________________________________________________
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
Author : FactolSarin
Score : 315 points
Date : 2022-12-06 15:43 UTC (7 hours ago)
| nonrandomstring wrote:
| My 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?
| n4bz0r wrote:
| > What have I unleashed?
|
| Command not found.
| swader999 wrote:
| She's a keeper. Edit: whoops, I read that as my girlfriend. I
| will say your daughter has a good dad as this is a sign you
| spend meaningful time together.
| avgDev wrote:
| Would 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 wrote:
| My 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.
| artursapek wrote:
| wholesome
| fbn79 wrote:
| I 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.
| rumpope wrote:
| My 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".
| bredren wrote:
| Can we get a link to this scratch, please.
| ct0 wrote:
| All programmers have to start somewhere. My first program was
| an interactive piece of concrete.
| dieselgate wrote:
| Much like the parent's comment, we all need to fart somewhere
| too
| wildcow wrote:
| This comment is my spirit animal.
| scrumper wrote:
| Now 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.
| _dain_ wrote:
| this is the content i log on every day for
| SavageBeast wrote:
| Accenture 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.
| gigatexal wrote:
| Haha you should print it and frame it. Your daughter has a bright
| future! And a good dad to boot, kudos to you both!
| jcpst wrote:
| <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.
| napolux wrote:
| no tests, no ci, no dockerization, no deploy on the cloud
|
| NO HIRE for me
| ivraatiems wrote:
| Counterpoint: 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.
| tmaly wrote:
| Show her some Scratch programming.
|
| Kids I have taught, love that they can record and play back the
| sounds with programming blocks.
| racl101 wrote:
| She is the One.
| WrtCdEvrydy wrote:
| .... to be honest, fart humour is pretty universal. This could be
| a 16 year old kid to be honest :D
| nxmnxm99 wrote:
| He never mentioned how old the child is. Could be 23!
| racl101 wrote:
| My 30 year old ex blue collar worker buddy who took up
| programming wrote something like this ... but it's too crude
| for HN.
| jansan wrote:
| Rick Sanchez is a great fan of fart humor ("He may have
| manifested some sort of butt")
|
| https://www.youtube.com/watch?v=dGqYfoO1eqo
| sircastor wrote:
| "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 wrote:
| Here's to many more joyful moments! Congrats!
| eggroe wrote:
| I 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!
| bgoldste wrote:
| Adorable. 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 wrote:
| IMO 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 wrote:
| That 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.
| rdmcelrath wrote:
| I guess it is true!
|
| All code has a smell...
| d--b wrote:
| Show her how to loop through the print statement and she'll be
| hooked forever!
| bombcar wrote:
| I suspect some major portion of computer programmers discovered
| loops via 10 PRINT "FARTS" 20 GOTO 10
| SoftTalker wrote:
| Yep, pretty close to my first program on an original TRS-80.
| gibspaulding wrote:
| Hah, I think one of my first computer programs I wrote on my
| own looked something like this: while
| (true) { cout << "Fuck!"; }
| jansan wrote:
| Every Commodore 64 in every department store that I went to
| was running that loop (but with "Hello") after I left.
| Doctor_Fegg wrote:
| I 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
| dugmartin wrote:
| I 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).
| jrootabega wrote:
| I thought fart was a reserved word. Or is that coming in 3.12?
| jvm___ wrote:
| So. 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 wrote:
| Is the ChatGPT sample code/tutorials much better than the
| tutorials that can be found on Google?
| jvm___ wrote:
| Create me a flutter app that has a list of todo items. Each
| item has a timer. The list shows one item at the top and when
| it's timer finishes the next one in the list moves to the
| top.
|
| That prompt, or something like it, generated Futter code
| along with the instructions of how to modify a default
| flutter app for the code to work.
|
| I haven't ran the code yet, but all the other code samples I
| asked for worked.
|
| Asking for a ruby Student, Teacher application where the
| student takes multiple courses and the teacher can assign a
| grade to each course.
|
| After you get that code, you can clarify in your next
| question.
|
| I want each course to have progress steps.
|
| More generated ruby code..
|
| Can you add a grade for each progress step, and can the
| teacher have the ability to unlock the next progress steps.
|
| Generates more code.
|
| Then.
|
| Generate me a react front end for this.
|
| Generates React code.
|
| I didn't install/run the code, but it looked accurate and had
| comments explaining what the lines of code did.
|
| ----
|
| GitHub code works, ChatGPT code works, and does exactly what
| you want, and you can modify it just by asking.
|
| "Change the progress array to be an object that has a grade,
| started date, finished date and parent acknowledgement."
|
| That actually works as an example after the bot generated the
| initial app.
|
| We're in for a world of changes.
| ericmcer wrote:
| That is what though, 2 hours of coding for an experienced
| dev? And the trade off is you have no context over the code
| running your product?
| jvm___ wrote:
| 2 hours of coding for an experienced dev
|
| Sure, building a table is a two hour job for an
| experienced wood-worker.
|
| If a grade 7 student can make an app by - Describing what
| they want it to do - Copy/pasting some code - And running
| it.
|
| That's a leap forward in my books.
|
| The first barrier to making apps has been the time
| involved in to learn the syntax, if that's gone in the
| first days of this app, what's next? Do we teach how to
| write code anymore, or just to read and understand it?
| teaearlgraycold wrote:
| Sounds like copying from GitHub with extra steps
| gardenhedge wrote:
| It's more like having an assistant who can do it for you so
| you need no/little knowledge of GitHub.
| jvm___ wrote:
| Less 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.
| atahanacar wrote:
| >they could have a phone if they made an app
|
| I think this is a great way to get your kids to have a habit of
| self-learning. In my opinions, this is the single most
| important skill a kid can learn.
|
| Every time my little cousins ask me something they want to
| learn, I go with "Let's search for the answer together" and
| guide them on how to do basic research. Sometimes I ask them
| follow-up questions if they find the topic interesting so it
| gives them a sense of accomplishment. Takes little time and
| effort but teaches the most valuable skill.
| warinukraine wrote:
| I think it's a great way to ensure that the only motivation
| your kids have is external. "What's the point of doing X is
| no one offered me a phone for it"
|
| When I was a kid, I heard that some friends were getting
| money from parents as a reward for good grades. I always had
| good grades so I suggested to my mom that I should get money
| for good grades. She said "No, because then you'll get used
| to only work hard when I'm offering you money". At the time
| my take away was just "no money, got it." But now I think it
| was actually an insightful observation.
| shkkmo wrote:
| Now re-contextualize that as if it were an
| employer/employee relationship. That's actually a pretty
| messed up lesson to teach a kid about negotiation and self
| worth.
| warinukraine wrote:
| But it's not an employer/employee relationship.
|
| It teaches you that you should _also_ consider your own
| long term goals, as opposed to only chasing the someone
| else's short term goals. I think it's a great lesson to
| teach a kid about self-worth.
| lukashrb wrote:
| There is this book "Drive The Surprising Truth About What
| Motivates Us" which makes the same point, they also cite
| some studies about this.
| mmcgaha wrote:
| My 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.
| numlocked wrote:
| The 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.
| tricky wrote:
| Hilarious! 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 wrote:
| Poorly implemented device lockdowns by my school were the start
| of my interest in understanding and manipulating systems, long
| may they last!
| coldpie wrote:
| Yuuup. 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
| mkehrt wrote:
| Back in my day you could just rename programs (read: Quake 2)
| to winword.exe and they would run no problem.
| planede wrote:
| What's the license, are you allowed to distribute? Anyway, we
| already started using this in production, we expect some free
| support. /s
| gardenhedge wrote:
| Why not rust? /s
|
| That is sweet. Congrats.
| vbordo wrote:
| Because this program requires garbage collection :)
| napolux wrote:
| #dadjokes #swooosh
| trynewideas wrote:
| hell, get her poop-farting in 6502 assembly and in 10 years
| she'll be front-paging HN twice a week
| neilv wrote:
| This 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.
| beaned wrote:
| I wonder if humor plays a role in developing minds the same way
| play does. It just seems so universal and good-natured in
| children.
| jasonhansel wrote:
| PR 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 wrote:
| You forgot space between } and {
| jasonhansel wrote:
| It 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!
| dllthomas wrote:
| Very 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 wrote:
| Editing 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.
| xyzelement wrote:
| I 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 wrote:
| As 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.
| dark-star wrote:
| heck, in MY time, variables could only have 2 (significant)
| letters, so we were stuck with "hi", "jk", "ah" and things
| like our initials....
|
| The good thing is that since only 2 letters were significant,
| the variables "fa", "fart", "fan", "fall" etc. were all
| treated the same, which could cause some confusion to people
| not familiar with the intricacies of C64 BASIC ;-)
| taylodl wrote:
| I 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.
| jasonhansel wrote:
| Huh. I tend to use the first letter of the type, so "s" for
| a string, "d" for a dictionary, etc. Then "s2," "d2," etc.
| if there are more than one.
| noboostforyou wrote:
| Same (did you start learning programming with C?). i++ is
| pretty much hardcoded into my brain.
| SoftTalker wrote:
| When I learned programming the BASIC variant I used only
| supported two-character variable names. And even where
| longer names were allowed, the text of the program consumed
| memory so you could optimize by keeping variable names as
| short as possible. So I had the habit of using single-
| letter variables for quite a while. I still use them as
| loop counters, or in small functions where the scope of the
| variable is maybe a few lines of code and completely
| unambiguous. In such cases I think long variable names are
| distracting.
| [deleted]
| craigkilgo wrote:
| Everyone doesn't use i,j,k for counting variables?
| tqwhite wrote:
| Yes. At least all decent people.
| rootusrootus wrote:
| Heck, 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.
| ExtremisAndy wrote:
| Are you serious?! That is so hilarious to me, because I do
| the same thing! And I am always so terrified that I will get
| an interview, and they will want to see a sample of my code,
| and I will have forgotten to take out all the bits of
| juvenile humor that are scattered through the code of my
| personal projects!
| andai wrote:
| In college, usually a few minutes before an assignment was
| due, I'd frantically Ctrl+F the project for various curse
| words.
| olav wrote:
| Nice. I vividly remember the days, sometimes in the 80s, in
| some university cellar, hacking away at our green-lit vt
| terminals connected to some vaxens, that one of the other
| regulars in the room and I used temp variables _hudli_ and
| _tralla_ as some kind of ritual.
| olav wrote:
| Ah, "hudli hudli" stands for "Extraordinarily fast guitar
| playing"
| https://www.urbandictionary.com/define.php?term=Hudli -
| it's only now that I look this up
| xyzelement wrote:
| I actually try to not do that now. As they say, programming
| is the art of naming and I think forcing myself to think
| about what a variable is (and then using that name) leads to
| better outcomes.
|
| Agree for throwaway work it may not matter but I try to keep
| myself disciplined anyway. A good example is say I am doing
| an advent of code and the temptation is to treat it as throw
| away code. But the reality is, sometimes I put it down and
| come back to it, and having variables like fart doesn't
| really help snap back into the context.
|
| Not saying this is an absolute but I find it a general rule
| of thumb for myself
| Mawr wrote:
| "I got fired over a variable name...." -
| https://old.reddit.com/r/cscareerquestions/comments/dpcfns/i...
| metadat wrote:
| The linked "dog story" is an.. eye opener, too:
|
| https://old.reddit.com/r/cscareerquestions/comments/95dgrx/i.
| ..
| chewxy wrote:
| Surprisingly I did get pulled into a meeting with the CEO and
| a sales/custcare guy because of a similar issue.
|
| I wrote functions that are available for the users to use
| (they can customize their own dashboard). Our function
| conventions are camelCase. The function I wrote was something
| along the lines of `cumOnMetric` or something like that.
|
| Needless to say some square somewhere thought this was a joke
| and didn't like it. So there I was, just blinking away and
| wasn't even aware this was something sensitive. It was funny
| sure, but I didn't have the idea that it was
| "unprofessional". I still feel the idea of professionalism is
| quite a club thing.
|
| But yeah we got our first snake_case function name because of
| that.
| Vaslo wrote:
| lol nice find
| jrootabega wrote:
| In a class where we were writing a parser for math expressions,
| this was my plausible deniability scenario when I named the
| functions whose job was to analyze characters. Looking back,
| I'm sure the teachers were not at all amused.
| xyzelement wrote:
| I lied! It wasn't CVS... It was Visual Source Safe!
| sakras wrote:
| As a kid my dad told me that I could name my variables whatever
| I wanted. I still remember the confusion on his face when he
| saw "int iPod" and "string xbox" all over my code.
| kiliancs wrote:
| Hedy 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.
| rglover wrote:
| YES! Great things ahead.
| bitwize wrote:
| I'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.
| tuckerpo wrote:
| Better code than most engineers can muster.
| quest29 wrote:
| Nice.. 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
| mawise wrote:
| For 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/
| jamst174 wrote:
| Having a 7 yo and 4 yo, this completely tracks.
|
| Nice work.
| dhosek wrote:
| The 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?
| Arrath wrote:
| An AutoIt script that opened the cd tray and popped up a
| message box with some taunting phrase or another.
| incanus77 wrote:
| Wasn'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.
| empressplay wrote:
| I 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.
| ihaveajob wrote:
| My 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) 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.
| zhouyisu wrote:
| I'd like to see what instruction could let ChatGPT output such
| invention.
___________________________________________________________________
(page generated 2022-12-06 23:01 UTC)