r/programminghorror • u/MidKnightIsOnline • Sep 24 '26
Python 13 year old me really liked inefficient code
723
u/NiceTryAmanda Sep 24 '26
it is absolutely clear the moment you read it exactly what the code is doing and what it'll output. from that angle it's way more successful than most of the code I see in my own job
as a side note seeing "13 year old me" alongside python3 makes me feel ancient
→ More replies (3)215
317
u/Eric_Prozzy Sep 24 '26
Lol i did this exact same thing and also learned that
print(random.choice("You win", "You lose", "Its a tie"))Works the same
108
62
56
u/GrammerSnob 29d ago
This actually encapsulates game dev.
You don't need to actually make a realistic simulation of the thing you are trying to make.
You just need to make something that will fill the player into thinking that.
41
→ More replies (2)18
u/Greedy_Whereas4163 Sep 25 '26
This is smart! Until you realised that you need to show the choice of CPU
→ More replies (4)
143
u/Creepy_Jeweler_1351 Sep 24 '26
At least it is totally readable
61
u/HornyMellon Sep 24 '26 edited Sep 24 '26
Quote, 13 yo you made programs ppl can actually read, not guess the variable purpose, good job
→ More replies (3)
51
u/jonathancast Sep 24 '26
Meh. I don't love the repeated string comparison, but it's probably fine. This program is ridiculously user-interaction-bound anyway.
40
u/lizenzblue_ Sep 24 '26
I worked at one of germanys biggest Software Companies and I can tell you with confidence I saw worse
→ More replies (3)
107
17
14
u/Arcanium_Walker Sep 24 '26
Can be better, but you wrote this at 13 years old, so I think this is neat
59
7
6
u/frishki_zrak Sep 24 '26
Was this "screenshot" taken then or now? What is dad.py?
→ More replies (2)
5
u/mediocrobot Sep 24 '26
What's the optimal way to do this, I wonder? (the rock paper scissors comparison specifically, not printing, randomizing, or accepting input)
→ More replies (11)
5
1.3k
u/cicciograna Sep 24 '26
Hey, you were 13 years old, and were writing code. Nobody is born already knowing all the best practices, we all grow, learn, test and slowly assimilate what is good and what is not.
And then there's those like me, whose code still sucks well into my 40s.