subreddit stringclasses 7
values | author stringlengths 3 20 | id stringlengths 5 7 | content stringlengths 67 30.4k | score int64 0 140k |
|---|---|---|---|---|
programminghorror | Fortunos | j4nao17 | <|sols|><|sot|>TIL that all of undertales dialogue is handled in one spaghetti code massive switch statement that takes thousands of lines<|eot|><|sol|>https://v.redd.it/nef7685gogca1<|eol|><|sor|>I doubt that's the original source code. Looks decompiled to me.<|eor|><|sor|>Toby Fox has been pretty open about their shi... | 66 |
programminghorror | theg721 | j4ma3jh | <|sols|><|sot|>TIL that all of undertales dialogue is handled in one spaghetti code massive switch statement that takes thousands of lines<|eot|><|sol|>https://v.redd.it/nef7685gogca1<|eol|><|sor|>I doubt that's the original source code. Looks decompiled to me.<|eor|><|sor|>The switch(argument0) gives it away very quic... | 57 |
programminghorror | sailorbob134280 | j4oir1h | <|sols|><|sot|>TIL that all of undertales dialogue is handled in one spaghetti code massive switch statement that takes thousands of lines<|eot|><|sol|>https://v.redd.it/nef7685gogca1<|eol|><|sor|>Dev here with 25+ years experience in big enterprise companies and small spunky startups in Silicon Valley. Currently a se... | 38 |
programminghorror | Mizzter_perro | j4nw29h | <|sols|><|sot|>TIL that all of undertales dialogue is handled in one spaghetti code massive switch statement that takes thousands of lines<|eot|><|sol|>https://v.redd.it/nef7685gogca1<|eol|><|sor|>I doubt that's the original source code. Looks decompiled to me.<|eor|><|sor|>Toby Fox has been pretty open about their shi... | 34 |
programminghorror | teateateateaisking | j4nmlxb | <|sols|><|sot|>TIL that all of undertales dialogue is handled in one spaghetti code massive switch statement that takes thousands of lines<|eot|><|sol|>https://v.redd.it/nef7685gogca1<|eol|><|sor|>I doubt that's the original source code. Looks decompiled to me.<|eor|><|sor|>Undertale used GameMaker. Depending on what v... | 33 |
programminghorror | its-miir | j4ny45d | <|sols|><|sot|>TIL that all of undertales dialogue is handled in one spaghetti code massive switch statement that takes thousands of lines<|eot|><|sol|>https://v.redd.it/nef7685gogca1<|eol|><|sor|>So even I could meke successful game??? Somewhat inspirational<|eor|><|sor|>the problem with "i want to make a game" progra... | 27 |
programminghorror | khanzarate | j4p3gmb | <|sols|><|sot|>TIL that all of undertales dialogue is handled in one spaghetti code massive switch statement that takes thousands of lines<|eot|><|sol|>https://v.redd.it/nef7685gogca1<|eol|><|sor|>So even I could meke successful game??? Somewhat inspirational<|eor|><|sor|>this but unironically, you just need a good ide... | 27 |
programminghorror | SanianCreations | j4nuvzz | <|sols|><|sot|>TIL that all of undertales dialogue is handled in one spaghetti code massive switch statement that takes thousands of lines<|eot|><|sol|>https://v.redd.it/nef7685gogca1<|eol|><|sor|>I doubt that's the original source code. Looks decompiled to me.<|eor|><|sor|>Undertale used GameMaker. Depending on what v... | 27 |
programminghorror | Dukat863 | j4nfh6u | <|sols|><|sot|>TIL that all of undertales dialogue is handled in one spaghetti code massive switch statement that takes thousands of lines<|eot|><|sol|>https://v.redd.it/nef7685gogca1<|eol|><|sor|>I doubt that's the original source code. Looks decompiled to me.<|eor|><|sor|>The switch(argument0) gives it away very quic... | 24 |
programminghorror | fllr | j4q96bp | <|sols|><|sot|>TIL that all of undertales dialogue is handled in one spaghetti code massive switch statement that takes thousands of lines<|eot|><|sol|>https://v.redd.it/nef7685gogca1<|eol|><|sor|>Well at least they shipped and got rich, right?<|eor|><|sor|>Came here to say this! They made a ton of money from the game.... | 23 |
programminghorror | RafaelSwi | 103yffa | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|eols|><|endoftext|> | 1,395 |
programminghorror | Vociferix | j31s0mn | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>The biggest horror is "adress"<|eor|><|eols|><|endoftext|> | 624 |
programminghorror | LetterBoxSnatch | j31xxvn | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>I was really hoping you were going to employ emoji ligatures / graphemes but you stopped short. Remember, if you join the UTF-8 strings ++[skin tone black] you get <|eor|><|eols|><|endoftext|> | 216 |
programminghorror | ChaseBianchi | j31zkoi | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>Was really expecting adress: <|eor|><|eols|><|endoftext|> | 132 |
programminghorror | prx24 | j320ph0 | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>The biggest horror is "adress"<|eor|><|sor|>Probably German speaking developer. I work in network automation and I see this a lot lol<|eor|><|eols|><|endoftext|> | 131 |
programminghorror | OrganicPotatoSprouts | j32b5km | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>I was really hoping you were going to employ emoji ligatures / graphemes but you stopped short. Remember, if you join the UTF-8 strings ++[skin tone black] you get <|eor|><|sor|>The work that's gone into emojis, I'm amazed<|eor|><|eols|... | 98 |
programminghorror | pockarelli | j32ltnb | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>The way you didnt capitalize your enum types made me very, very angry. I might have issues I need to deal with.<|eor|><|eols|><|endoftext|> | 59 |
programminghorror | VirresAldSRz | j31vbr0 | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>adress adress adress adress<|eor|><|eols|><|endoftext|> | 40 |
programminghorror | RafaelSwi | j329bg1 | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|soopr|>I like how I accidentally made this thing even worse by writing "address" wrong.
good job, me.<|eoopr|><|eols|><|endoftext|> | 38 |
programminghorror | bordaa | j31yj3f | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>I was really hoping you were going to employ emoji ligatures / graphemes but you stopped short. Remember, if you join the UTF-8 strings ++[skin tone black] you get <|eor|><|sor|>Thanks, I hate it.<|eor|><|eols|><|endoftext|> | 38 |
programminghorror | XejgaToast | j326bmm | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>Will this thing even compile?
I hope it doesn't.<|eor|><|sor|>It should, if you save the file in unicode<|eor|><|eols|><|endoftext|> | 36 |
programminghorror | already-registered | j324drw | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>The biggest horror is "adress"<|eor|><|sor|>Probably German speaking developer. I work in network automation and I see this a lot lol<|eor|><|sor|>can confirm that.<|eor|><|eols|><|endoftext|> | 31 |
programminghorror | killeronthecorner | j337myr | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>The biggest horror is "adress"<|eor|><|sor|>I know right? Should be 'Adress' for a type name<|eor|><|eols|><|endoftext|> | 30 |
programminghorror | Max_Insanity | j33r7qg | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>The biggest horror is "adress"<|eor|><|sor|>Probably German speaking developer. I work in network automation and I see this a lot lol<|eor|><|sor|>Ich habe das Gefhl, mit diesem Kommentar adressiert worden zu sein.
(I feel like having ... | 30 |
programminghorror | orga12 | j31sic2 | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>Will this thing even compile?
I hope it doesn't.<|eor|><|eols|><|endoftext|> | 27 |
programminghorror | Kinexity | j33k34i | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>The biggest horror is "adress"<|eor|><|sor|>I know right? Should be 'Adress' for a type name<|eor|><|sor|>You're lucky I can't stab people over the internet... yet.<|eor|><|sor|>You'd need to know his adres first.<|eor|><|eols|><|endoft... | 27 |
programminghorror | mshthn | j32w7op | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>I was really hoping you were going to employ emoji ligatures / graphemes but you stopped short. Remember, if you join the UTF-8 strings ++[skin tone black] you get <|eor|><|sor|>I hate emojis from day 0, what a stupid way to communicate... | 21 |
programminghorror | DOGGYYY0311 | j341u5t | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>The biggest horror is "adress"<|eor|><|sor|>Probably German speaking developer. I work in network automation and I see this a lot lol<|eor|><|sor|>Ich habe das Gefhl, mit diesem Kommentar adressiert worden zu sein.
(I feel like having ... | 21 |
programminghorror | smbell | j33gzl7 | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>The biggest horror is "adress"<|eor|><|sor|>I know right? Should be 'Adress' for a type name<|eor|><|sor|>You're lucky I can't stab people over the internet... yet.<|eor|><|eols|><|endoftext|> | 20 |
programminghorror | JackalopeZero | j32ceev | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>Was really expecting adress: <|eor|><|sor|>Its all fun and games until you need to refer to anything on the cli<|eor|><|eols|><|endoftext|> | 19 |
programminghorror | Frumk | j32w1ip | <|sols|><|sot|>depression<|eot|><|sol|>https://v.redd.it/4cm9g1sn38aa1<|eol|><|sor|>What language is this?<|eor|><|sor|>Swift<|eor|><|eols|><|endoftext|> | 19 |
programminghorror | numeprenume | rv2t8u | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|eols|><|endoftext|> | 1,401 |
programminghorror | lulzmachine | hr37h6g | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>It's not enterprise enough without an AbstractBuilderFactoryImplemtorAdapter<|eor|><|eols|><|endoftext|> | 231 |
programminghorror | daennie | hr31qcc | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>I know how to make it more "production quality"
if (str) {
return true;
} else {
return false;
}<|eor|><|eols|><|endoftext|> | 121 |
programminghorror | JoyJoy_ | hr2x13j | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>For the curious, this is how you would inline it.
isNotEmpty(str: string) {
return !!str;
}
Or you can do it the sane way.
isNotEmpty(str: string) {
return str.length > 0;
}<|eor|><|eo... | 113 |
programminghorror | AlternativeAardvark6 | hr3wsg8 | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>Seen things like these quite often sadly.<|eor|><|sor|>Probably more readable having a stringIsNotEmpty(str) in your code than an if(str).<|eor|><|eols|><|endoftext|> | 78 |
programminghorror | LethalOliveDrab | hr3wzcm | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>It's not enterprise enough without an AbstractBuilderFactoryImplemtorAdapter<|eor|><|sor|>You mean AbstractBuilderBooleanManufacturer ?<|eor|><|eols|><|endoftext|> | 56 |
programminghorror | R3D3-1 | hr2z6v5 | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>For the curious, this is how you would inline it.
isNotEmpty(str: string) {
return !!str;
}
Or you can do it the sane way.
isNotEmpty(str: string) {
return str.length > 0;
}<|eor|><|so... | 56 |
programminghorror | caerphoto | hr3h2je | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>I know how to make it more "production quality"
if (str) {
return true;
} else {
return false;
}<|eor|><|sor|> if (str)
return true;
return false;<|eor|><|sor|>You evil bastar... | 55 |
programminghorror | agnostic_science | hr37h8c | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>I'm absolutely not a fan of putting a non boolean value in an if<|eor|><|sor|>But what about the thrill of seeing if you've accurately remembered how your current programming language handles all the various inputs and ... | 51 |
programminghorror | sirreldar | hr47zyg | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>Seen things like these quite often sadly.<|eor|><|sor|>Probably more readable having a stringIsNotEmpty(str) in your code than an if(str).<|eor|><|sor|>Wouldn't the most readible be if(!isEmpty(myString))?
In other wor... | 50 |
programminghorror | RunnableReddit | hr337mp | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>I'm absolutely not a fan of putting a non boolean value in an if<|eor|><|eols|><|endoftext|> | 46 |
programminghorror | Chaoslab | hr4pi3h | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>It's not enterprise enough without an AbstractBuilderFactoryImplemtorAdapter<|eor|><|sor|>You mean AbstractBuilderBooleanManufacturer ?<|eor|><|sor|>You need more [Enterprisify!](https://projects.haykranen.nl/java/)<|eo... | 46 |
programminghorror | HotRodLincoln | hr3mz1h | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>I know how to make it more "production quality"
if (str) {
return true;
} else {
return false;
}<|eor|><|sor|> if (str)
return true;
return false;<|eor|><|sor|>return str?true... | 46 |
programminghorror | soiguapo | hr47o2r | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>Actually. Having that function isn't dumb at all. As mentioned other places in this thread, it makes the code more self documenting and coerces the string to a boolean. But the best use case is to use the function as a ... | 37 |
programminghorror | all3f0r1 | hr2xuo4 | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>For the curious, this is how you would inline it.
isNotEmpty(str: string) {
return !!str;
}
Or you can do it the sane way.
isNotEmpty(str: string) {
return str.length > 0;
}<|eor|><|so... | 36 |
programminghorror | der_RAV3N | hr454co | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>I know how to make it more "production quality"
if (str) {
return true;
} else {
return false;
}<|eor|><|sor|> if (str)
return true;
return false;<|eor|><|sor|>return str?true... | 35 |
programminghorror | DoYouEverJustInvert | hr3e4ap | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>So like now you can just write if (isNotEmpty(str)) instead of the lengthy if (str). Great success.<|eor|><|eols|><|endoftext|> | 34 |
programminghorror | QuicksortThis | hr44xxw | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>So like now you can just write if (isNotEmpty(str)) instead of the lengthy if (str). Great success.<|eor|><|sor|>It's about having your documentation be the code itself
Not about short or long code lines, it's about re... | 32 |
programminghorror | Phyrik2222 | hr40a9m | <|sols|><|sot|>Production quality code<|eot|><|sol|>https://i.redd.it/5vin2fvt8h981.png<|eol|><|sor|>Seen things like these quite often sadly.<|eor|><|sor|>Probably more readable having a stringIsNotEmpty(str) in your code than an if(str).<|eor|><|sor|>Honestly yeah, this really isn't that bad when you take readability... | 22 |
programminghorror | fatboychummy | bu1ybn | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|eols|><|endoftext|> | 1,398 |
programminghorror | bonafidebob | ep6742r | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>Assigning a while loop to a var, that's a new one.<|eor|><|sor|>> while true do local variable1 print(variable1) sleep(0) end
Let's assume that was a copy paste error and they just wanted one loop:
... | 101 |
programminghorror | jerslan | ep5vasa | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>I would try to answer that, but our lovely, beautifully written Reddit mobile won't show me this picture even though I have perfect connection.<|eor|><|sor|>Code from the picture:
while true do
... | 58 |
programminghorror | TomatoCo | ep6qefz | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>Assigning a while loop to a var, that's a new one.<|eor|><|sor|>> while true do local variable1 print(variable1) sleep(0) end
Let's assume that was a copy paste error and they just wanted one loop:
... | 52 |
programminghorror | DisappointingToaster | ep69m9n | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>This looks like Lua to me, as you can assign functions as variables. But why does he want to do that, ara ara<|eor|><|eols|><|endoftext|> | 25 |
programminghorror | Squalleze | ep5v3t6 | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>Looks like they're using the Wikipedia "pseudocode" style, or something.<|eor|><|sor|>It's Lua, but kinda wrong<|eor|><|eols|><|endoftext|> | 23 |
programminghorror | droomph | ep5uttm | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>Looks like they're using the Wikipedia "pseudocode" style, or something.<|eor|><|eols|><|endoftext|> | 20 |
programminghorror | PJvG | ep5xiaa | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>Looks like they're using the Wikipedia "pseudocode" style, or something.<|eor|><|sor|>It's Lua, but kinda wrong<|eor|><|sor|>Only kinda?<|eor|><|eols|><|endoftext|> | 17 |
programminghorror | fixator10 | ep8wr5d | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>This is LUA - I'd say it's someone trying to use OpenComputers in Minecraft?<|eor|><|sor|>```
Please do not write it as "LUA", which is both ugly and confusing, because then it becomes an acronym withd... | 15 |
programminghorror | bonafidebob | ep6r7pc | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>Assigning a while loop to a var, that's a new one.<|eor|><|sor|>> while true do local variable1 print(variable1) sleep(0) end
Let's assume that was a copy paste error and they just wanted one loop:
... | 15 |
programminghorror | careseite | ep69a37 | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>I would try to answer that, but our lovely, beautifully written Reddit mobile won't show me this picture even though I have perfect connection.<|eor|><|soopr|>[Here's an imgur link for you](https://i.i... | 15 |
programminghorror | fatboychummy | ep5uki0 | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>I would try to answer that, but our lovely, beautifully written Reddit mobile won't show me this picture even though I have perfect connection.<|eor|><|soopr|>[Here's an imgur link for you](https://i.i... | 14 |
programminghorror | SnowdensOfYesteryear | ep770vg | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>Assigning a while loop to a var, that's a new one.<|eor|><|sor|>> while true do local variable1 print(variable1) sleep(0) end
Let's assume that was a copy paste error and they just wanted one loop:
... | 14 |
programminghorror | TomatoCo | ep7jdh8 | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>Assigning a while loop to a var, that's a new one.<|eor|><|sor|>> while true do local variable1 print(variable1) sleep(0) end
Let's assume that was a copy paste error and they just wanted one loop:
... | 14 |
programminghorror | MiniOozyPC | ep75ko3 | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>This is LUA - I'd say it's someone trying to use OpenComputers in Minecraft?<|eor|><|eols|><|endoftext|> | 10 |
programminghorror | MJBrune | ep8a46u | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>Assigning a while loop to a var, that's a new one.<|eor|><|sor|>> while true do local variable1 print(variable1) sleep(0) end
Let's assume that was a copy paste error and they just wanted one loop:
... | 10 |
programminghorror | Igor_GR | ep6el4b | <|sols|><|sot|>What is he even attempting to accomplish?<|eot|><|sol|>https://i.redd.it/jajc77s19z031.jpg<|eol|><|sor|>Assigning a while loop to a var, that's a new one.<|eor|><|sor|>this kinda look like bad ruby but you can assign a while to a var and it isn't particularly bad imo.
Shitty exemple :
i = 0
=> ... | 9 |
programminghorror | SpartanNige329 | 10one0l | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|eols|><|endoftext|> | 1,382 |
programminghorror | Lanoroth | j6fuags | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>I think it needs a switch statement<|eor|><|eols|><|endoftext|> | 273 |
programminghorror | jstwtchngrnd | j6fzi55 | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>You should make a function for each number. isOneEven calls isTwoEven calls isThreeEven That gives a good maintainability<|eor|><|eols|><|endoftext|> | 139 |
programminghorror | DrShocker | j6fxwuj | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>I think it needs a switch statement<|eor|><|sor|>A switch statement and recursion<|eor|><|eols|><|endoftext|> | 106 |
programminghorror | Gamecrazy721 | j6fz6cr | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>[deleted]<|eor|><|sor|>Holy shit<|eor|><|eols|><|endoftext|> | 47 |
programminghorror | TotalDifficulty | j6hhaay | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>I think it needs a switch statement<|eor|><|sor|>A switch statement and recursion<|eor|><|sor|>Recursion is slow and not required here.<|eor|><|sor|>On that note, I feel like there may be something else in the code that ... | 47 |
programminghorror | bstowers | j6fzd6c | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>I think it needs a switch statement<|eor|><|sor|>*modulus has entered the chat*<|eor|><|eols|><|endoftext|> | 40 |
programminghorror | vikingXviking | j6gzxvf | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>You should make a function for each number. isOneEven calls isTwoEven calls isThreeEven That gives a good maintainability<|eor|><|sor|>This makes unit testning easier<|eor|><|eols|><|endoftext|> | 32 |
programminghorror | tecanec | j6hs2mh | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>I think it needs a switch statement<|eor|><|sor|>*modulus has entered the chat*<|eor|><|sor|>```
bool isEven(int x) {
if (x == 0) return true;
switch (x % 3) {
case 0: return isEven(x / 3);
case 1... | 29 |
programminghorror | bstowers | j6hsfg3 | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>I think it needs a switch statement<|eor|><|sor|>*modulus has entered the chat*<|eor|><|sor|>```
bool isEven(int x) {
if (x == 0) return true;
switch (x % 3) {
case 0: return isEven(x / 3);
case 1... | 29 |
programminghorror | GeorgeDir | j6geln4 | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>Not this again<|eor|><|eols|><|endoftext|> | 25 |
programminghorror | im_bread_inside | j6g9xxf | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>[deleted]<|eor|><|sor|>I swear to God<|eor|><|eols|><|endoftext|> | 21 |
programminghorror | Delta8Girl | j6g0r3f | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>Geometry dash: The 2D game that can make a 2080 cry<|eor|><|eols|><|endoftext|> | 19 |
programminghorror | Gogu_Libarca | j6hb8cs | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>I think it needs a switch statement<|eor|><|sor|>*modulus has entered the chat*<|eor|><|sor|>or just check first bit if it is 1 or 0<|eor|><|sor|>Thats the last bit, not the first bit, and its not correct in all encoding... | 19 |
programminghorror | Mihai4544 | j6h1p49 | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>[deleted]<|eor|><|sor|>What happens with 11? It seems like it can't work on odd numbers where all factors are greater than 9.<|eor|><|sor|>You hit the worst case scenario of O(infinity) and get an exclusive show of your... | 18 |
programminghorror | DrShocker | j6i2zdp | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>I think it needs a switch statement<|eor|><|sor|>A switch statement and recursion<|eor|><|sor|>Recursion is slow and not required here.<|eor|><|sor|>On that note, I feel like there may be something else in the code that ... | 17 |
programminghorror | adamthebread | j6gzey5 | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>everytime [this tweet](https://twitter.com/ctrlshifti/status/1288745146759000064?s=20&t=T0W5VJaF-mraQx_AYf1OIA) is reposted someone photoshops it to be tweeted by someone else<|eor|><|eols|><|endoftext|> | 15 |
programminghorror | Handle-Flaky | j6h5h4y | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>I think it needs a switch statement<|eor|><|sor|>*modulus has entered the chat*<|eor|><|sor|>or just check first bit if it is 1 or 0<|eor|><|sor|>Thats the last bit, not the first bit, and its not correct in all encoding... | 14 |
programminghorror | KingHavana | j6gi1w6 | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>[deleted]<|eor|><|sor|>What happens with 11? It seems like it can't work on odd numbers where all factors are greater than 9.<|eor|><|eols|><|endoftext|> | 13 |
programminghorror | ithika | j6himsa | <|sols|><|sot|>i love gd optimization<|eot|><|sol|>https://i.redd.it/keys87k061fa1.jpg<|eol|><|sor|>I think it needs a switch statement<|eor|><|sor|>*modulus has entered the chat*<|eor|><|sor|>or just check first bit if it is 1 or 0<|eor|><|sor|>Thats the last bit, not the first bit, and its not correct in all encoding... | 13 |
programminghorror | SarahSplatz | p7up30 | <|sols|><|sot|>Found in my friend's High School Java course folder :)<|eot|><|sol|>https://www.reddit.com/gallery/p7up30<|eol|><|eols|><|endoftext|> | 1,382 |
programminghorror | killeronthecorner | h9mw63w | <|sols|><|sot|>Found in my friend's High School Java course folder :)<|eot|><|sol|>https://www.reddit.com/gallery/p7up30<|eol|><|sor|>What's pravate?<|eor|><|sor|>Opposite of poblic<|eor|><|eols|><|endoftext|> | 381 |
programminghorror | 5p4n911 | h9mofdq | <|sols|><|sot|>Found in my friend's High School Java course folder :)<|eot|><|sol|>https://www.reddit.com/gallery/p7up30<|eol|><|sor|>What's pravate?<|eor|><|eols|><|endoftext|> | 312 |
programminghorror | Ahajha1177 | h9n5b7s | <|sols|><|sot|>Found in my friend's High School Java course folder :)<|eot|><|sol|>https://www.reddit.com/gallery/p7up30<|eol|><|sor|>What's pravate?<|eor|><|sor|>Opposite of poblic<|eor|><|sor|>poblic bul<|eor|><|sor|>poblic doid<|eor|><|sor|> pobloc cluss Maim {
pobloc sdadic doid maim(Strang[] rrgs) {
... | 161 |
programminghorror | ings0c | h9mxd0i | <|sols|><|sot|>Found in my friend's High School Java course folder :)<|eot|><|sol|>https://www.reddit.com/gallery/p7up30<|eol|><|sor|>What's pravate?<|eor|><|sor|>Opposite of poblic<|eor|><|sor|>poblic bul<|eor|><|eols|><|endoftext|> | 125 |
programminghorror | andrei0x309 | h9mminn | <|sols|><|sot|>Found in my friend's High School Java course folder :)<|eot|><|sol|>https://www.reddit.com/gallery/p7up30<|eol|><|sor|>Not evil enough, for example, me on procedural programming in UNI like 13 years ago, I was sending all my homework in c code, with almost no dependencies, all code was practically reinve... | 105 |
programminghorror | Cookies_Master | h9ms64p | <|sols|><|sot|>Found in my friend's High School Java course folder :)<|eot|><|sol|>https://www.reddit.com/gallery/p7up30<|eol|><|sor|>Oh I'm definitely stealing 'thingthing2'!<|eor|><|eols|><|endoftext|> | 95 |
programminghorror | lawrencfgsdfg | h9mh66a | <|sols|><|sot|>Found in my friend's High School Java course folder :)<|eot|><|sol|>https://www.reddit.com/gallery/p7up30<|eol|><|sor|>no need for obfuscation<|eor|><|eols|><|endoftext|> | 87 |
programminghorror | pxOMR | h9n7okt | <|sols|><|sot|>Found in my friend's High School Java course folder :)<|eot|><|sol|>https://www.reddit.com/gallery/p7up30<|eol|><|sor|>What's pravate?<|eor|><|sor|>Opposite of poblic<|eor|><|sor|>poblic bul<|eor|><|sor|>poblic doid<|eor|><|sor|> pobloc cluss Maim {
pobloc sdadic doid maim(Strang[] rrgs) {
... | 82 |
programminghorror | sandwich1699975 | h9mpkmu | <|sols|><|sot|>Found in my friend's High School Java course folder :)<|eot|><|sol|>https://www.reddit.com/gallery/p7up30<|eol|><|sor|>My _"friend's"_<|eor|><|eols|><|endoftext|> | 63 |
programminghorror | famz12 | h9n1u2r | <|sols|><|sot|>Found in my friend's High School Java course folder :)<|eot|><|sol|>https://www.reddit.com/gallery/p7up30<|eol|><|sor|>What's pravate?<|eor|><|sor|>Opposite of poblic<|eor|><|sor|>poblic bul<|eor|><|sor|>poblic doid<|eor|><|eols|><|endoftext|> | 63 |
programminghorror | iliekcats- | h9n8fwm | <|sols|><|sot|>Found in my friend's High School Java course folder :)<|eot|><|sol|>https://www.reddit.com/gallery/p7up30<|eol|><|sor|>What's pravate?<|eor|><|sor|>Opposite of poblic<|eor|><|sor|>poblic bul<|eor|><|sor|>poblic doid<|eor|><|sor|> pobloc cluss Maim {
pobloc sdadic doid maim(Strang[] rrgs) {
... | 41 |
programminghorror | theuniverseisboring | h9mz8qf | <|sols|><|sot|>Found in my friend's High School Java course folder :)<|eot|><|sol|>https://www.reddit.com/gallery/p7up30<|eol|><|sor|>"my friend's"
Suuure OP<|eor|><|eols|><|endoftext|> | 34 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.