subreddit stringclasses 7
values | author stringlengths 3 20 | id stringlengths 5 7 | content stringlengths 67 30.4k | score int64 0 140k |
|---|---|---|---|---|
programminghorror | binary-tree | hh3ah1m | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>DRY stands for Do Repeat Yourself<|eor|><|eols|><|endoftext|> | 146 |
programminghorror | rift95 | hh3etv8 | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>I once wrote 1.5k lines because my nested for loops didn't work as expected ...
In my defense it was in my first year of learning to code, but still ...... | 135 |
programminghorror | ings0c | hh3bmhe | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>DRY stands for Do Repeat Yourself<|eor|><|sor|>Yourself
Yourself
Yourself
Yourself
Yourself
Yourself
Yourself<|eor|><|eols|><|endoftext|> | 105 |
programminghorror | Farpafraf | hh3remz | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>I once wrote 1.5k lines because my nested for loops didn't work as expected ...
In my defense it was in my first year of learning to code, but still ...... | 104 |
programminghorror | KingOfSpiderDucks | hh3r6fw | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>I once wrote 1.5k lines because my nested for loops didn't work as expected ...
In my defense it was in my first year of learning to code, but still ...... | 99 |
programminghorror | lucidspoon | hh3i4pd | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>I actually like finding shit like this. I find it satisfying, especially seeing the Git changes.<|eor|><|eols|><|endoftext|> | 76 |
programminghorror | peterasplund | hh3tvlh | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>This must be the only time Im actually relieved that I wasnt able to zoom and read the code<|eor|><|eols|><|endoftext|> | 70 |
programminghorror | nosoupforyou | hh3ki4v | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>I actually like finding shit like this. I find it satisfying, especially seeing the Git changes.<|eor|><|sor|>I do too, except that when you fix it, you ... | 59 |
programminghorror | jaleCro | hh3bpm9 | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>Happy cakeday to start with. I would forgive this if it was made by a beginner/hobbyist or a CS102 student. Not knowing is perfectly fine.
But if it wa... | 55 |
programminghorror | KingOfSpiderDucks | hh3rllg | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>I once wrote 1.5k lines because my nested for loops didn't work as expected ...
In my defense it was in my first year of learning to code, but still ...... | 51 |
programminghorror | IshKebab | hh3rl0e | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>I actually like finding shit like this. I find it satisfying, especially seeing the Git changes.<|eor|><|sor|>I do too, except that when you fix it, you ... | 48 |
programminghorror | b4ux1t3 | hh3tdsd | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>I once wrote 1.5k lines because my nested for loops didn't work as expected ...
In my defense it was in my first year of learning to code, but still ...... | 45 |
programminghorror | TheMoraxno | hh437xo | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>I once wrote 1.5k lines because my nested for loops didn't work as expected ...
In my defense it was in my first year of learning to code, but still ...... | 44 |
programminghorror | m477m | hh3efdz | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>Let's say it's loop unrolling for optimisation
^(Edit: 128 upvotes? Yay! Round number!)<|eor|><|sor|>Gotta change the sprite registers and video mode in... | 41 |
programminghorror | lightwhite | hh3aqxa | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>Happy cakeday to start with. I would forgive this if it was made by a beginner/hobbyist or a CS102 student. Not knowing is perfectly fine.
But if it wa... | 38 |
programminghorror | sohang-3112 | hh3smct | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>I actually like finding shit like this. I find it satisfying, especially seeing the Git changes.<|eor|><|sor|>I do too, except that when you fix it, you ... | 32 |
programminghorror | realnzall | hh46etx | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>What you do in a case like this:
1. Find a genuine problem this part of the code causes, like a significant slowdown, a security risk, an edge case whic... | 27 |
programminghorror | veryusedrname | hh3iqhg | <|sols|><|sot|>500 lines of code that could have been 3 for loops totalling ~30. i love inheriting projects!<|eot|><|sol|>https://i.imgur.com/vIIFwYz.png<|eol|><|sor|>Where are the human translators when we actually need them?<|eor|><|eols|><|endoftext|> | 26 |
programminghorror | bajuh | ts4dps | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|eols|><|endoftext|> | 987 |
programminghorror | bajuh | i2pb9jk | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|soopr|>There was [this post](https://www.reddit.com/r/ProgrammerHumor/comments/tpb6d2/translation_print_the_following_pattern_solution/) where people started submitting their solutio... | 322 |
programminghorror | Kyriios188 | i2q4pwl | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|sor|>wym programming horror this is programming porn<|eor|><|eols|><|endoftext|> | 215 |
programminghorror | freak_dessert2 | i2pii62 | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|soopr|>There was [this post](https://www.reddit.com/r/ProgrammerHumor/comments/tpb6d2/translation_print_the_following_pattern_solution/) where people started submitting their solutio... | 212 |
programminghorror | Behrooz0 | i2pllh7 | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|sor|>branch-less
pure function
stdlib only
10/10<|eor|><|eols|><|endoftext|> | 136 |
programminghorror | bajuh | i2qc4go | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|sor|>wym programming horror this is programming porn<|eor|><|soopr|>Why? Because [everything](https://github.com/jbebe/mine2048) I do is considered [horror](https://github.com/jbebe/... | 99 |
programminghorror | Movpasd | i2plrd2 | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|soopr|>There was [this post](https://www.reddit.com/r/ProgrammerHumor/comments/tpb6d2/translation_print_the_following_pattern_solution/) where people started submitting their solutio... | 51 |
programminghorror | bajuh | i2psjoi | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|soopr|>There was [this post](https://www.reddit.com/r/ProgrammerHumor/comments/tpb6d2/translation_print_the_following_pattern_solution/) where people started submitting their solutio... | 35 |
programminghorror | BakuhatsuK | i2qb8u1 | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|sor|>JavaScript port
const range = n => new Array(n).fill().map((_, i) => i)
const { sin, tan, atan, pow, abs, PI, trunc, sign } = Math
const nl_sin = x => sin((x-9) * ... | 32 |
programminghorror | AstraeusGB | i2sterl | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|sor|>wym programming horror this is programming porn<|eor|><|soopr|>Why? Because [everything](https://github.com/jbebe/mine2048) I do is considered [horror](https://github.com/jbebe/... | 30 |
programminghorror | bajuh | i2qch3u | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|sor|>JavaScript port
const range = n => new Array(n).fill().map((_, i) => i)
const { sin, tan, atan, pow, abs, PI, trunc, sign } = Math
const nl_sin = x => sin((x-9) * ... | 25 |
programminghorror | bajuh | i2rdf96 | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|sor|>wym programming horror this is programming porn<|eor|><|soopr|>Why? Because [everything](https://github.com/jbebe/mine2048) I do is considered [horror](https://github.com/jbebe/... | 23 |
programminghorror | chooxy | i2puese | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|sor|>branch-less
pure function
stdlib only
10/10<|eor|><|sor|>[Lol reminded me of that ice cream guy](https://youtu.be/EYtFH2bFCfg?t=21)<|eor|><|eols|><|endoftext|> | 22 |
programminghorror | oNamelessWonder | i2rf38f | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|sor|>I don't want to say this is programming horror, god, this looks like a next level math shit. Ngl, I'm kinda jeolus of you rn lol.<|eor|><|eols|><|endoftext|> | 17 |
programminghorror | TeaCrab131 | i2qbnas | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|sor|>Does it work on all fonts? Does it work on non-monospaced text fields? Can user control the size, or width to height ratio?
Most importantly, does it run on all platforms?
/s... | 16 |
programminghorror | BakuhatsuK | i2r2onb | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|sor|>wym programming horror this is programming porn<|eor|><|soopr|>Why? Because [everything](https://github.com/jbebe/mine2048) I do is considered [horror](https://github.com/jbebe/... | 16 |
programminghorror | mohragk | i2psb11 | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|soopr|>There was [this post](https://www.reddit.com/r/ProgrammerHumor/comments/tpb6d2/translation_print_the_following_pattern_solution/) where people started submitting their solutio... | 14 |
programminghorror | piestormer | i2rye8q | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|sor|>wym programming horror this is programming porn<|eor|><|soopr|>Why? Because [everything](https://github.com/jbebe/mine2048) I do is considered [horror](https://github.com/jbebe/... | 13 |
programminghorror | bajuh | i2rgjdi | <|sols|><|sot|>Printing out the rhombus without programming (details in comment)<|eot|><|sol|>https://i.redd.it/f3vn79qu8iq81.png<|eol|><|sor|>JavaScript port
const range = n => new Array(n).fill().map((_, i) => i)
const { sin, tan, atan, pow, abs, PI, trunc, sign } = Math
const nl_sin = x => sin((x-9) * ... | 11 |
programminghorror | Mike_Oxlong25 | ln0po5 | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|eols|><|endoftext|> | 982 |
programminghorror | ShadowGeist91 | gny8w9l | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|> if (!(y - 1 < 0))
The negation of that is equal to:
if (y - 1 >= 0)
There's also an unnecessary and redundant use of ternary operators which was reu... | 124 |
programminghorror | forzamotorsportsucks | gnyaps1 | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|> if (!(y - 1 < 0))
The negation of that is equal to:
if (y - 1 >= 0)
There's also an unnecessary and redundant use of ternary operators which was reu... | 81 |
programminghorror | nukesrb | gnyayg4 | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|> if (!(y - 1 < 0))
The negation of that is equal to:
if (y - 1 >= 0)
There's also an unnecessary and redundant use of ternary operators which was reu... | 72 |
programminghorror | ryrythe3rd | gny6jnq | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|>I want to downvote but I have to upvote<|eor|><|eols|><|endoftext|> | 44 |
programminghorror | CompWiz1 | gnyh7in | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|>uses less ram tho!<|eor|><|sor|>why would that matter? you can always download more ram [downloadmoreram.com](https://downloadmoreram.com)<|eor|><|eols|><|endo... | 44 |
programminghorror | aue_sum | gny6h12 | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|>uses less ram tho!<|eor|><|eols|><|endoftext|> | 30 |
programminghorror | BakuhatsuK | gnyp8gx | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|>uses less ram tho!<|eor|><|sor|>why would that matter? you can always download more ram [downloadmoreram.com](https://downloadmoreram.com)<|eor|><|sor|>Alterna... | 30 |
programminghorror | Beach-Devil | gnycg8d | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|> if (!(y - 1 < 0))
The negation of that is equal to:
if (y - 1 >= 0)
There's also an unnecessary and redundant use of ternary operators which was reu... | 29 |
programminghorror | mypetocean | gnz95ba | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|> if (!(y - 1 < 0))
The negation of that is equal to:
if (y - 1 >= 0)
There's also an unnecessary and redundant use of ternary operators which was reu... | 21 |
programminghorror | LimbRetrieval-Bot | gnyzo7w | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|> if (!(y - 1 < 0))
The negation of that is equal to:
if (y - 1 >= 0)
There's also an unnecessary and redundant use of ternary operators which was reu... | 20 |
programminghorror | stone_henge | gnzkqf6 | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|> if (!(y - 1 < 0))
The negation of that is equal to:
if (y - 1 >= 0)
There's also an unnecessary and redundant use of ternary operators which was reu... | 17 |
programminghorror | ArthurSafeZone | gnycoti | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|>I want to downvote but I have to upvote<|eor|><|sor|>r/angryupvote<|eor|><|eols|><|endoftext|> | 14 |
programminghorror | TheGhostBrain | gnz1sfh | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|>This makes me wanna scream and run frantically.<|eor|><|eols|><|endoftext|> | 13 |
programminghorror | krisnarocks | gnyloqi | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|> if (!(y - 1 < 0))
The negation of that is equal to:
if (y - 1 >= 0)
There's also an unnecessary and redundant use of ternary operators which was reu... | 12 |
programminghorror | VisibleSignificance | gnzf2l9 | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|> if (!(y - 1 < 0))
The negation of that is equal to:
if (y - 1 >= 0)
There's also an unnecessary and redundant use of ternary operators which was reu... | 10 |
programminghorror | alphachurch | gnytf0n | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|>I had a programming test that did this. Whole brain stopped working<|eor|><|eols|><|endoftext|> | 9 |
programminghorror | 874elffaw | gnzqtgo | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|>You are using
"grid[y-1][x] = (((grid[y-1][x] - '0')+1) +'0')"
But you can increase a char variable by 1 like an integer.
So you could use it like this:
"gr... | 7 |
programminghorror | OjustrunanddieO | gnzvt5w | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|>I can't even read this, the moment I've read one line, I would have already forgotten what the previous one did :p
Lately I've been trying to always extract m... | 7 |
programminghorror | Own_Cryptographer563 | gnztom6 | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|>What the fuck is monster<|eor|><|eols|><|endoftext|> | 7 |
programminghorror | Mike_Oxlong25 | gnyzn4b | <|sols|><|sot|>Using a char array to store characters of numbers is not one of my brighter moments<|eot|><|sol|>https://i.redd.it/32tr5jobnbi61.png<|eol|><|sor|> if (!(y - 1 < 0))
The negation of that is equal to:
if (y - 1 >= 0)
There's also an unnecessary and redundant use of ternary operators which was reu... | 7 |
programminghorror | small_hole_energy | 12p6tj0 | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|eols|><|endoftext|> | 981 |
programminghorror | Strex_1234 | jgl47tw | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>That's celever tbh<|eor|><|eols|><|endoftext|> | 302 |
programminghorror | same_subreddit_bot | jgl9aed | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>That's celever tbh<|eor|><|sor|>You could use only one modulo
```
for i in range(1,101):
print(["fizzbuzz",i,i,"fizz",i,"buzz","fizz",i,i,"fizz","buzz",i,"fizz",i,i][i%15])
```<|eor|><|sor|>r/programminghorror<|eor|... | 262 |
programminghorror | Strex_1234 | jgl6mo0 | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>That's celever tbh<|eor|><|sor|>You could use only one modulo
```
for i in range(1,101):
print(["fizzbuzz",i,i,"fizz",i,"buzz","fizz",i,i,"fizz","buzz",i,"fizz",i,i][i%15])
```<|eor|><|eols|><|endoftext|> | 249 |
programminghorror | CataclysmClive | jgl567k | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>this is just solid code golf<|eor|><|eols|><|endoftext|> | 184 |
programminghorror | Bloody_Insane | jgl99rv | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>That's celever tbh<|eor|><|sor|>You could use only one modulo
```
for i in range(1,101):
print(["fizzbuzz",i,i,"fizz",i,"buzz","fizz",i,i,"fizz","buzz",i,"fizz",i,i][i%15])
```<|eor|><|sor|>r/programminghorror<|eor|... | 155 |
programminghorror | Bloody_Insane | jgl5f2y | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>Where's the horror? This is legit a good answer. Especially since fizzbuzz is an interview question. If someone responded with that in an interview I'd definitely be paying attention to them<|eor|><|eols|><|endoftext|> | 116 |
programminghorror | DeviousBeevious | jgl9r49 | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>That's celever tbh<|eor|><|sor|>You could use only one modulo
```
for i in range(1,101):
print(["fizzbuzz",i,i,"fizz",i,"buzz","fizz",i,i,"fizz","buzz",i,"fizz",i,i][i%15])
```<|eor|><|sor|>r/programminghorror<|eor|... | 110 |
programminghorror | Udzu | jgledvr | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>this is just solid code golf<|eor|><|sor|>The whitespace and string redundancy suggests it's not purely for golfing though. Here's a more effectively golfed version:
for i in range(100):
print((i%3==2)*"fi... | 89 |
programminghorror | katakat_ | jgl6g0s | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>You dont need two lines
print(*[[i, "fizz", "buzz", "fizzbuzz"][(i % 3 == 0) | (i % 5 == 0) << 1] for i in range(1, 101)], sep="\n")<|eor|><|eols|><|endoftext|> | 88 |
programminghorror | iceman012 | jgm6y5j | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>this is just solid code golf<|eor|><|sor|>The whitespace and string redundancy suggests it's not purely for golfing though. Here's a more effectively golfed version:
for i in range(100):
print((i%3==2)*"fi... | 74 |
programminghorror | DoYouEverJustInvert | jglehjm | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>Where's the horror? This is legit a good answer. Especially since fizzbuzz is an interview question. If someone responded with that in an interview I'd definitely be paying attention to them<|eor|><|sor|>The fact of pu... | 38 |
programminghorror | tgiyb1 | jgl9wen | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>Is this not 300 unnecessary string allocations along with 100 unnecessary array allocations? I don't see how python would manage to optimize either of those factors out.<|eor|><|eols|><|endoftext|> | 34 |
programminghorror | Naeio_Galaxy | jgl8rrj | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>Where's the horror? This is legit a good answer. Especially since fizzbuzz is an interview question. If someone responded with that in an interview I'd definitely be paying attention to them<|eor|><|sor|>The fact of pu... | 34 |
programminghorror | B0tRank | jgl9rw6 | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>That's celever tbh<|eor|><|sor|>You could use only one modulo
```
for i in range(1,101):
print(["fizzbuzz",i,i,"fizz",i,"buzz","fizz",i,i,"fizz","buzz",i,"fizz",i,i][i%15])
```<|eor|><|sor|>r/programminghorror<|eor|... | 31 |
programminghorror | Maciek300 | jglh45p | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>Where's the horror? This is legit a good answer. Especially since fizzbuzz is an interview question. If someone responded with that in an interview I'd definitely be paying attention to them<|eor|><|sor|>The code is un... | 26 |
programminghorror | historymaker118 | jglnv2m | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>Where's the horror? This is legit a good answer. Especially since fizzbuzz is an interview question. If someone responded with that in an interview I'd definitely be paying attention to them<|eor|><|sor|>The code is un... | 24 |
programminghorror | SAI_Peregrinus | jglls8t | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>Where's the horror? This is legit a good answer. Especially since fizzbuzz is an interview question. If someone responded with that in an interview I'd definitely be paying attention to them<|eor|><|sor|>The fact of pu... | 24 |
programminghorror | StochasticTinkr | jgn2n32 | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>this is just solid code golf<|eor|><|sor|>The whitespace and string redundancy suggests it's not purely for golfing though. Here's a more effectively golfed version:
for i in range(100):
print((i%3==2)*"fi... | 22 |
programminghorror | Udzu | jglf1er | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>You dont need two lines
print(*[[i, "fizz", "buzz", "fizzbuzz"][(i % 3 == 0) | (i % 5 == 0) << 1] for i in range(1, 101)], sep="\n")<|eor|><|sor|>You don't have to use list comprehension to put it on one line eith... | 18 |
programminghorror | jso__ | jglg5g2 | <|sols|><|sot|>Peak Efficiency Fizzbuzz<|eot|><|sol|>https://i.redd.it/n6q6zqyieeua1.png<|eol|><|sor|>Is this not 300 unnecessary string allocations along with 100 unnecessary array allocations? I don't see how python would manage to optimize either of those factors out.<|eor|><|sor|>that's why you have a line which sa... | 18 |
programminghorror | i_am_adult_now | jkuhnc | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|eols|><|endoftext|> | 980 |
programminghorror | i_am_adult_now | gal6tp5 | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|soopr|>For those who want to kill their brian cells, read the [full source code](https://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh).
Have a nice day.
**Edit**: Some of y'all are missing the point... | 202 |
programminghorror | jha666 | gal9cns | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>bash is not Bourne Shell.<|eor|><|eols|><|endoftext|> | 121 |
programminghorror | i_am_adult_now | gal9kx4 | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>bash is not Bourne Shell.<|eor|><|soopr|>You're right. Was supposed to be `bsh` but I made a typo. Even then it was just `sh`.<|eoopr|><|eols|><|endoftext|> | 81 |
programminghorror | GOKOP | galgc9b | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|soopr|>For those who want to kill their brian cells, read the [full source code](https://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh).
Have a nice day.
**Edit**: Some of y'all are missing the point... | 75 |
programminghorror | ebkalderon | gallowd | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|soopr|>For those who want to kill their brian cells, read the [full source code](https://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh).
Have a nice day.
**Edit**: Some of y'all are missing the point... | 68 |
programminghorror | schlupa | gamnp6m | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>I'm surprized by the comments that are amazed and surprized by that. There was a time, when C started to gain traction (in the 80s) and was progressively replacing Pascal, this was an extremely common pa... | 59 |
programminghorror | PolyGlotCoder | galeivq | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>Why<|eor|><|sor|>To make C look like fortran it seems. Or similar languages of that time.
Believe it or not for many programmers in the 70s this would probably be very readable.<|eor|><|eols|><|endoftex... | 45 |
programminghorror | snf | galeiek | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>Is this meant to emulate some other language's keywords? I recognize bits and pieces of it, but overall it doesn't look like anything I'm familiar with<|eor|><|eols|><|endoftext|> | 36 |
programminghorror | coenvanloo | galuzhq | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>What the actual fuck, Why???
How does Bourne-Again shell look like though? Is it better or is it just as bad as this?<|eor|><|sor|>this is the bourne shell. borne again is a modern reimplentatikn better... | 29 |
programminghorror | this_is_martin | galdkrd | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>Why<|eor|><|eols|><|endoftext|> | 27 |
programminghorror | coenvanloo | galun4n | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>And done in notepad too. A true evil genius<|eor|><|sor|>as this was for the original unix. it would probably have been ed.<|eor|><|eols|><|endoftext|> | 24 |
programminghorror | zelmarvalarion | galkep6 | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>Is this meant to emulate some other language's keywords? I recognize bits and pieces of it, but overall it doesn't look like anything I'm familiar with<|eor|><|sor|>FORTRAN maybe. Been many years since ... | 18 |
programminghorror | kokoseij | gam058z | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>What the actual fuck, Why???
How does Bourne-Again shell look like though? Is it better or is it just as bad as this?<|eor|><|sor|>this is the bourne shell. borne again is a modern reimplentatikn better... | 16 |
programminghorror | coenvanloo | galvir1 | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>For its time this was amazing. Sorry, not a programming horror. In fact, just the opposite. We all owe Bourne a great debt.<|eor|><|sor|>How are a bunch of defines "amazing" in any time<|eor|><|sor|>bour... | 15 |
programminghorror | linuxlib | galrdg9 | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>For its time this was amazing. Sorry, not a programming horror. In fact, just the opposite. We all owe Bourne a great debt.<|eor|><|eols|><|endoftext|> | 14 |
programminghorror | SolarBear | galdyr3 | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|soopr|>For those who want to kill their brian cells, read the [full source code](https://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh).
Have a nice day.
**Edit**: Some of y'all are missing the point... | 14 |
programminghorror | qh4os | ganqc9u | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>Bourne: Can we have ALGOL?
Unix team: We have ALGOL at home!
ALGOL at home:<|eor|><|eols|><|endoftext|> | 12 |
programminghorror | kokoseij | galklw8 | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>What the actual fuck, Why???
How does Bourne-Again shell look like though? Is it better or is it just as bad as this?<|eor|><|eols|><|endoftext|> | 12 |
programminghorror | coenvanloo | galy6pi | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>Is this meant to emulate some other language's keywords? I recognize bits and pieces of it, but overall it doesn't look like anything I'm familiar with<|eor|><|sor|>seing as the programmer is known for ... | 12 |
programminghorror | Andomar | galux22 | <|sols|><|sot|>Bourne Shell a.k.a bash a.k.a. i-hate-c<|eot|><|sol|>https://i.redd.it/k8c48kwjo7w51.jpg<|eol|><|sor|>For its time this was amazing. Sorry, not a programming horror. In fact, just the opposite. We all owe Bourne a great debt.<|eor|><|sor|>Yeah, its funny how people make fun of one of the most successful ... | 12 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.