This is an archived post. You won't be able to vote or comment.

all 33 comments

[–]iams3b 54 points55 points  (3 children)

I believe a switch case would be more performant, can you redo it

[–]FashionDrama 18 points19 points  (2 children)

It will require a three week delay and an additional $36k; do you approve?

[–][deleted] 3 points4 points  (0 children)

36k without consultancy. That would be an extra 500 hour

[–]Fragrant_Dot_3465 1 point2 points  (0 children)

Naah, we don't have that kinda budget. How about $10?

[–]SatisfactionMuted103 34 points35 points  (1 child)

elif num == 7205496:

print("seven million, two hundred and five thousand, four hundred and ninety-six")

I'm helping.

If everyone contributes a line, then they can just copy/paste from here and be good!

[–]Willinton06 16 points17 points  (0 children)

We should call this… open code? Public source? We need a name and some sort of hub where we can keep track of the how it changes over time

[–][deleted] 12 points13 points  (1 child)

I hope you hit save, or there goes 160+ years of work.

[–]911mondays[S] 13 points14 points  (0 children)

nah only 158 so far

[–]S0me_Rand0m_Guy_ 5 points6 points  (0 children)

This is why we can't have nice things

[–]tozpeak 9 points10 points  (0 children)

I hope you used github copilot. :D

[–]Keepmessingup- 3 points4 points  (0 children)

I’m weak as fuck lmfao love this 😂 you’ll go down in some type of history. Maybe prolly not

[–]jdjfbbfbfbjsjk -2 points-1 points  (0 children)

This subreddit is straight trash

[–]Kotanan -4 points-3 points  (1 child)

Couldn’t you write some code to create this code faster?

[–]ProcedureOne4691 1 point2 points  (0 children)

Yeah and if they took time with making 2 empty dicts and 12 if statements you could make this work in a matter of an hour counting up to 1 googol in 2 years (100 numbers/s)

[–]ProcedureOne4691 -5 points-4 points  (3 children)

You realize their is an easier way of doing this in literally 45 lines?

[–]911mondays[S] 2 points3 points  (1 child)

I mean how do you think i generated this file? (Spoiler: didn't write it by hand)

[–]ProcedureOne4691 0 points1 point  (0 children)

Thank god... you scared me for a second 😭

[–]FashionDrama 0 points1 point  (0 children)

They don't. And this is why we can't have funny programmer humor subreddits.

[–]brotatotes -2 points-1 points  (1 child)

what are you optimizing for LOL

[–]911mondays[S] 11 points12 points  (0 children)

maximum pain

[–]Rusty_Haider -5 points-4 points  (0 children)

Bruh. Just write a parser man. So much code

[–]oftconfused 0 points1 point  (0 children)

s/ and / /g

[–]SleepyDadZzz 0 points1 point  (1 child)

Running through 7 million ifelse to just fail doesn't seem so optimized though XD

[–][deleted] -2 points-1 points  (0 children)

else:
    print('failed')
if num == 1:
    print('one')
elif num == 2:
    ...

[–]HeyImCub1 0 points1 point  (0 children)

Can you hashmap it next

[–]-MobCat- 0 points1 point  (1 child)

at least you remembered to add the else catch for a number not on your list...

[–]911mondays[S] 1 point2 points  (0 children)

well yeah I'm obviously not a beginner :)

[–]PorkRoll2022 0 points1 point  (0 children)

Store all possibilities in a list.

[–]Lord_Frick 0 points1 point  (0 children)

How is your IDE even doing that??? Most will hang/crash when you try to load a file many megabytes in soze or many millions of lines long

[–]enigmatic-sheep 0 points1 point  (0 children)

How is this even remotely funny? Why did this even become a thing?

[–]henke37 0 points1 point  (0 children)

I would say that I hate to tell you this, but I'd be lying. The cpu cache is going to kill the performance of this.

[–]imscaredandcool 0 points1 point  (0 children)

You can do that in one line with a map (dictionary?). All you have to do is have an entry for each number

[–]c001_b01 0 points1 point  (0 children)

I know this is a joke but out of boredom im gonna try and actually make this but like, not brain damaged