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
138 comments
[ 5.3 ms ] story [ 255 ms ] threadThat is sweet. Congrats.
Nice work.
NO HIRE for me
I think we could bring her on as a junior.
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.
10 PRINT “Welcome to Currys the electrical ripoff store”
20 GOTO 10
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.
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.
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.
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?
Vs. searching for results on StackOverflow and similar, you'd probably have to combine results on 'how to basic flutter app', 'intro to programming', 'todo list example app [perhaps not in flutter]', and even then it wouldn't be exactly what you wanted if you were looking for specific requirements.
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.
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.
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.
You didn't describe any explanation of why good grades are an important step towards your own long term goals.
I'm not saying that paying for grades is a good way to motivate kids. I'm saying that framing it as "I won't pay you because it'll make you lazy" is a very weird way to teach a kid about long term payoffs.
https://www.youtube.com/watch?v=dGqYfoO1eqo
I’d kind of assume the opposite, since MS is more tangible and easier to visualize.
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.
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.
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.
[1] https://www.dslreports.com/faq/3880
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.
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!
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.
- Dvorak: aoeu, htns, gcrl, mwvz
- Colemak: arst, neio, qwfp
- Mtgap: inea, htsr, dlcw, fvgj
etc...
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 ;-)
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
https://old.reddit.com/r/cscareerquestions/comments/95dgrx/i...
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.
[1]: https://www.scratchjr.org/
I thought it was the greatest trick ever. Meanwhile my brother was reimplementing every game he saw, including Tetris and some early Mario game.
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.
I like that the code itself is almost poetic, and is in itself a statement about the problem domain. Knuth would be proud.