Tell HN: My child's first program
417 pointsLast 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
Comments (136) 58 threads
I thought it was the greatest trick ever. Meanwhile my brother was reimplementing every game he saw, including Tetris and some early Mario game.
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.
Continue this thread — 1 reply
- 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.
Continue this thread — 1 more reply
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.
Continue this thread — 1 reply
Continue this thread — 1 more reply
Continue this thread — 1 more reply
Continue this thread — 1 reply
All comments shown.
Couldn't load more comments. Check your connection and try again.