Lurker News
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

Comments (136) 58 threads

rumpope4 replies#
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".
ct02 replies#
All programmers have to start somewhere. My first program was an interactive piece of concrete.
dieselgate#
Much like the parent's comment, we all need to fart somewhere too
mcv#
My 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#
This comment is my spirit animal.
bredren#
Can we get a link to this scratch, please.
ryloric#
Thanks for making my day!
xyzelement6 replies#
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!

belthesar7 replies#
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.

rootusrootus#
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.
taylodl7 replies#
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.
noboostforyou#
Same (did you start learning programming with C?). i++ is pretty much hardcoded into my brain.
craigkilgo1 reply#
Everyone doesn't use i,j,k for counting variables?

Continue this thread — 1 reply

jasonhansel#
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.
SoftTalker#
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.
qolop#
My foo is "yo" and my bar is "ho"
volkanvardar#
Mine are: x, xx, xxx, xxxx...
laylomo2#
Mine are just whatever happens to be under the keyboard layout I'm using at the time. If qwerty, then `asdf`, `qwer`, `uiop`, `zxcv` are likely to be temp variable names. But since I've dabbled in other layouts, I've found the names have changed to:

- Dvorak: aoeu, htns, gcrl, mwvz
- Colemak: arst, neio, qwfp
- Mtgap: inea, htsr, dlcw, fvgj
etc...

andai#
In college, usually a few minutes before an assignment was due, I'd frantically Ctrl+F the project for various curse words.
olav1 reply#
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.
dark-star#
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 ;-)

ExtremisAndy#
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!
xyzelement#
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

jrootabega#
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.
Vaslo#
lol nice find
chewxy1 reply#
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.

ikornaselur#
I don't see how the casing matters here? Would `cum_on_metric` somehow be better?
sakras#
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.
xyzelement#
I lied! It wasn't CVS... It was Visual Source Safe!

Continue this thread — 1 more reply

jvm___2 replies#
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.

highfrequency3 replies#
Is the ChatGPT sample code/tutorials much better than the tutorials that can be found on Google?
teaearlgraycold2 replies#
Sounds like copying from GitHub with extra steps
gardenhedge#
It's more like having an assistant who can do it for you so you need no/little knowledge of GitHub.
jvm___#
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.

jvm___1 reply#
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.

ericmcer1 reply#
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?

Continue this thread — 1 reply

Continue this thread — 1 more reply

Continue this thread — 1 more reply

planede1 reply#
What's the license, are you allowed to distribute? Anyway, we already started using this in production, we expect some free support. /s

Continue this thread — 1 reply

Load more comments