subreddit stringclasses 7
values | author stringlengths 3 20 | id stringlengths 5 7 | content stringlengths 67 30.4k | score int64 0 140k |
|---|---|---|---|---|
programminghorror | emady | d0gsgz | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|eols|><|endoftext|> | 768 |
programminghorror | emady | ez9a4r9 | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 343 |
programminghorror | heyheyhey27 | ez9dmet | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 169 |
programminghorror | SolarLiner | ez9gd89 | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 72 |
programminghorror | marco262 | ez9msej | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|sor|>Those unsigned 8-bit numbers will getcha every time.<|eor|><|eols|><|endoftext|> | 59 |
programminghorror | Diztruxion | eza4xyi | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|sor|>As someone is used to reading C/C++ syntax and code, usually for embedded stuff, I get so uncomfortable seeing python others/myself write... H... | 50 |
programminghorror | mpinnegar | ez9m5fu | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 38 |
programminghorror | _PM_ME_PANGOLINS_ | ez9yh1k | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 37 |
programminghorror | heyheyhey27 | ez9hl9e | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 30 |
programminghorror | AyrA_ch | ez9c673 | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 24 |
programminghorror | marco262 | ez9mxjn | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 21 |
programminghorror | tonsofmiso | ez9r8x4 | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 20 |
programminghorror | afiefh | ez9zhn6 | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 19 |
programminghorror | afiefh | ez9zxyq | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|sor|>Had to tutor a junior programmer at my last job. It was kind of funny seeing them try to understand why setting a variable to anything above 7... | 18 |
programminghorror | Olssdani | ez9d7zr | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 18 |
programminghorror | lengau | ez9rxbs | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 16 |
programminghorror | emady | eza7vp7 | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|sor|>[deleted]<|eor|><|soopr|>I've been programming for a while, and know all about overflow. My issue was numpy silently setting the type to uint8... | 15 |
programminghorror | AyrA_ch | ez9k0p8 | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 15 |
programminghorror | emady | ez9de4m | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 14 |
programminghorror | SSJ3 | ezbh6xz | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|sor|>As someone is used to reading C/C++ syntax and code, usually for embedded stuff, I get so uncomfortable seeing python others/myself write... H... | 13 |
programminghorror | snerp | ezay0en | <|sols|><|sot|>The fact that I had to fire up the debugger to figure out what was going on shows how stupid this is<|eot|><|sol|>https://i.redd.it/as7mkt7l8zk31.png<|eol|><|soopr|>I don't think this actually counts as horror. Turns out that numpy was lowkey setting the type of the numbers to uint8, thus causing overflo... | 12 |
programminghorror | Adamv27 | gtaduy | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|eols|><|endoftext|> | 763 |
programminghorror | xigoi | fsaompo | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>Now that's commitment<|eor|><|sor|> git commit -m 'ent'<|eor|><|eols|><|endofte... | 194 |
programminghorror | yard2010 | fsah5lo | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>Now that's commitment<|eor|><|eols|><|endoftext|> | 166 |
programminghorror | PoroSn4x | fsajf20 | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>Efficient precomputing i see<|eor|><|eols|><|endoftext|> | 154 |
programminghorror | Adamv27 | fsbapfz | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>Efficient precomputing i see<|eor|><|soopr|>The run time was pretty insane if I sa... | 60 |
programminghorror | 4DGenerate | fsaxhzg | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>What should be the correct way to do it, without hardcoding the coordinates?<|eor|... | 55 |
programminghorror | notvignesh12 | fsajlgc | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>It's weird that I made this exact same thing with a friend, using Python and Pygam... | 48 |
programminghorror | looksLikeImOnTop | fsavzhd | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>What should be the correct way to do it, without hardcoding the coordinates?<|eor|... | 37 |
programminghorror | VedangArekar | fsajmc7 | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>Looks like graphics code which it is<|eor|><|eols|><|endoftext|> | 25 |
programminghorror | Adamv27 | fsbadfv | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>Now that's commitment<|eor|><|soopr|>I dont even remember how long I took to do th... | 23 |
programminghorror | ACoderGirl | fsaw5oc | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>What should be the correct way to do it, without hardcoding the coordinates?<|eor|... | 20 |
programminghorror | kuemmel234 | fsazptt | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>What should be the correct way to do it, without hardcoding the coordinates?<|eor|... | 12 |
programminghorror | Adamv27 | fsbac5w | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>Looks like graphics code which it is<|eor|><|soopr|>Pygame!<|eoopr|><|eols|><|endo... | 10 |
programminghorror | bdlf1729 | fsb9ukk | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>I've seen worse hard coding in commercial game source code <|eor|><|sor|>I'm remin... | 9 |
programminghorror | Adamv27 | fsbafdi | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>It's weird that I made this exact same thing with a friend, using Python and Pygam... | 8 |
programminghorror | Tasik | fsatoh2 | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>[deleted]<|eor|><|sor|>I think this only holds true when there are no other option... | 8 |
programminghorror | CptPickguard | fsasszy | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>I hard coded every win condition. For x and o on every button in every space.
Vis... | 6 |
programminghorror | Chaike | fsbzpmv | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>Sheesh...
In my sophomore year, I programmed tic tac toe on a ti83, without the h... | 6 |
programminghorror | Tasik | fsauqru | <|sols|><|sot|>Code I wrote my sophomore year of high school. I was making tic tac toe with a GUI and hand wrote the coordinates to every point for every X and O on the board.<|eot|><|sol|>https://i.redd.it/twkwxhydwu151.png<|eol|><|sor|>[deleted]<|eor|><|sor|>I think this only holds true when there are no other option... | 6 |
programminghorror | AboookhTheMaster | sfi9dt | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|eols|><|endoftext|> | 759 |
programminghorror | NatoBoram | huq5drg | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>My first programming job, the company's NodeJS 6 monolith built itself this way at runtime. There was a way to write modules and submodules so they can be injected properly into the system.
Of cou... | 223 |
programminghorror | apotentiallytempacc | huq3gm6 | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>What's the problem?<|eor|><|sor|>It reads Python files as text, and then executes whatever was in them.<|eor|><|eols|><|endoftext|> | 160 |
programminghorror | apotentiallytempacc | hupxu6w | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>Ive seen some fucked up things, but this is straight to the point<|eor|><|eols|><|endoftext|> | 118 |
programminghorror | HobblingCobbler | huq7djh | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>What's the problem?<|eor|><|sor|>It reads Python files as text, and then executes whatever was in them.<|eor|><|sor|>Ah.. yeh that's not good<|eor|><|eols|><|endoftext|> | 68 |
programminghorror | blurryroots | huqzd2u | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>Code can be such a beautiful canvas to draw on with the bright color of ignorance.<|eor|><|eols|><|endoftext|> | 65 |
programminghorror | HobblingCobbler | hupx984 | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>What's the problem?<|eor|><|eols|><|endoftext|> | 61 |
programminghorror | elzaidir | huq0jyq | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>What's the problem?<|eor|><|sor|>I'm no python expert, but in think a better way to do this would simply be to import the files<|eor|><|eols|><|endoftext|> | 61 |
programminghorror | UnchainedMundane | hur2o0x | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>What's the problem?<|eor|><|sor|>It reads Python files as text, and then executes whatever was in them.<|eor|><|sor|>Yeah, that's what a regular Python import does<|eor|><|sor|>except now
- it doe... | 60 |
programminghorror | apotentiallytempacc | hupxn9r | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>There are good use cases for this. I'm presently running an app in AWS Lambda that picks up a "config" file from S3 and runs it. It's a single-user system so I'm not worried about security, but its... | 56 |
programminghorror | leopardspotte | hur2p2r | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>My first programming job, the company's NodeJS 6 monolith built itself this way at runtime. There was a way to write modules and submodules so they can be injected properly into the system.
Of cou... | 50 |
programminghorror | serg06 | huql78o | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>What's the problem?<|eor|><|sor|>It reads Python files as text, and then executes whatever was in them.<|eor|><|sor|>That's essentially what the python interpreter does<|eor|><|sor|>Except this wil... | 50 |
programminghorror | Lambda_Wolf | hur6doz | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>Oof, so sloppy. Obviously it should be
for x in ["includes/vars.py","includes/features.py"]:
with open(x) as f:
exec(f.read())
^(/s)<|eor|><|eols|><|endoftext|... | 44 |
programminghorror | TheCountMC | huqpx1p | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>What's the problem?<|eor|><|sor|>It reads Python files as text, and then executes whatever was in them.<|eor|><|sor|>That's essentially what the python interpreter does<|eor|><|sor|>Except this wil... | 39 |
programminghorror | alexkillough | husmtp4 | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>My first programming job, the company's NodeJS 6 monolith built itself this way at runtime. There was a way to write modules and submodules so they can be injected properly into the system.
Of cou... | 35 |
programminghorror | AboookhTheMaster | hur2uy0 | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>Code can be such a beautiful canvas to draw on with the bright color of ignorance.<|eor|><|soopr|>It isn't the ignorance that scares me, the scary part is knowing full well the ramifications of you... | 33 |
programminghorror | TehWhiteKnight1 | hupvu6i | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>I dunno man seems fine to me /s
I definitely didn't write anything similar...<|eor|><|eols|><|endoftext|> | 20 |
programminghorror | dastultz | hupvnh2 | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>There are good use cases for this. I'm presently running an app in AWS Lambda that picks up a "config" file from S3 and runs it. It's a single-user system so I'm not worried about security, but its... | 18 |
programminghorror | apotentiallytempacc | huq6kcs | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>There are good use cases for this. I'm presently running an app in AWS Lambda that picks up a "config" file from S3 and runs it. It's a single-user system so I'm not worried about security, but its... | 18 |
programminghorror | apotentiallytempacc | huq3bp9 | <|sols|><|sot|>My "friend" sent me this. #include in python.<|eot|><|sol|>https://i.redd.it/3l0n5hjupme81.png<|eol|><|sor|>There are good use cases for this. I'm presently running an app in AWS Lambda that picks up a "config" file from S3 and runs it. It's a single-user system so I'm not worried about security, but its... | 12 |
programminghorror | provodkation | s24vt0 | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|eols|><|endoftext|> | 761 |
programminghorror | uvitende | hsc8coc | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>Since 'Try' is capitalized this would not even compile.
Perfect fit for this sub<|eor|><|eols|><|endoftext|> | 458 |
programminghorror | tangerinelion | hscffci | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>Ahh yes, C++'s well known DivideByZeroException.<|eor|><|eols|><|endoftext|> | 398 |
programminghorror | Host127001 | hsdpvyc | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>Since 'Try' is capitalized this would not even compile.
Perfect fit for this sub<|eor|><|sor|>```
gcc -c that-file.cpp -DTry=try
```<|eor|><|eols|><|endoftext|> | 325 |
programminghorror | uvitende | hsdq6cn | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>Since 'Try' is capitalized this would not even compile.
Perfect fit for this sub<|eor|><|sor|>```
gcc -c that-file.cpp -DTry=try
```<|eor|><|sor|>Disgusting, you're grounded<|eor|><|eols|><|endoftext|> | 219 |
programminghorror | 1ElectricHaskeller | hse31no | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>Since 'Try' is capitalized this would not even compile.
Perfect fit for this sub<|eor|><|sor|>```
gcc -c that-file.cpp -DTry=try
```<|eor|><|sor|>Disgusting, you're grounded<|eor|><|sor|>Exactly! That's what macros w... | 124 |
programminghorror | Magmagan | hsd9355 | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>This is kinda... ok? Yeah division by zero wouldn't throw and there is a capitalization issue but this is just an example to illustrate how try/catch blocks work. If you ask me, this is just pseudocode that's really c... | 123 |
programminghorror | eclipsios | hscnmc1 | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>What would that even catch??<|eor|><|sor|>everything?<|eor|><|sor|>Nothing is being thrown<|eor|><|sor|>[deleted]<|eor|><|sor|>I don't, please explain<|eor|><|sor|>It appears C++ don't throw an error when you divide b... | 87 |
programminghorror | Last_Snowbender | hsd0lu6 | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>Prof probably thought he's working with C# or something.<|eor|><|eols|><|endoftext|> | 83 |
programminghorror | TARN4T1ON | hscoywj | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>What would that even catch??<|eor|><|sor|>everything?<|eor|><|sor|>Nothing is being thrown<|eor|><|sor|>[deleted]<|eor|><|sor|>I don't, please explain<|eor|><|sor|>It appears C++ don't throw an error when you divide b... | 80 |
programminghorror | lorhof1 | hsciv9h | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>What would that even catch??<|eor|><|sor|>everything?<|eor|><|eols|><|endoftext|> | 77 |
programminghorror | harlekintiger | hscnz44 | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>What would that even catch??<|eor|><|sor|>everything?<|eor|><|sor|>Nothing is being thrown<|eor|><|sor|>[deleted]<|eor|><|sor|>I don't, please explain<|eor|><|sor|>It appears C++ don't throw an error when you divide b... | 60 |
programminghorror | freak_dessert2 | hsfnt91 | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>This is kinda... ok? Yeah division by zero wouldn't throw and there is a capitalization issue but this is just an example to illustrate how try/catch blocks work. If you ask me, this is just pseudocode that's really c... | 55 |
programminghorror | Host127001 | hsdqrsk | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>Since 'Try' is capitalized this would not even compile.
Perfect fit for this sub<|eor|><|sor|>```
gcc -c that-file.cpp -DTry=try
```<|eor|><|sor|>Disgusting, you're grounded<|eor|><|sor|>That's fair<|eor|><|eols|><|e... | 55 |
programminghorror | 1ElectricHaskeller | hse4b10 | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>Even though font choice here is horrible that's still pretty ok.
Our prof sent us an excel file where the lines are spread around the whole table. One line is in Arial, one in Calibra, one in Helvetica. Some are size... | 47 |
programminghorror | Needleroozer | hsfrkg6 | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>Since 'Try' is capitalized this would not even compile.
Perfect fit for this sub<|eor|><|sor|>```
gcc -c that-file.cpp -DTry=try
```<|eor|><|sor|>Defining in compiler arguments is evil and shouldn't exist<|eor|><|sor... | 39 |
programminghorror | pudy248 | hseniw6 | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>Since 'Try' is capitalized this would not even compile.
Perfect fit for this sub<|eor|><|sor|>```
gcc -c that-file.cpp -DTry=try
```<|eor|><|sor|>Defining in compiler arguments is evil and shouldn't exist<|eor|><|eol... | 38 |
programminghorror | cheraphy | hsczg4x | <|sols|><|sot|>Learing c++ at university<|eot|><|sol|>https://i.redd.it/yv3au3kj09b81.jpg<|eol|><|sor|>What is cerr? Do they mean cout?<|eor|><|sor|>cout streams the stdout where as cerr streams to stderr. (https://en.wikipedia.org/wiki/Standard\_streams#Standard\_error\_(stderr))<|eor|><|eols|><|endoftext|> | 35 |
programminghorror | lieronet | vduacm | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|eols|><|endoftext|> | 763 |
programminghorror | poor_documentation | icmdlit | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|sor|>You're leaving the // holy shit in, right?<|eor|><|eols|><|endoftext|> | 212 |
programminghorror | lieronet | icme7ih | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|sor|>You're leaving the // holy shit in, right?<|eor|><|soopr|>I'm ripping the method out and building our data the sane way. If I didn't have time for that, absolutely that comment stays lol.<|eoopr|><|e... | 153 |
programminghorror | TechnicalTrees | icmogmn | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|sor|>Doesn't look so bad till you realize how many times you've had to collapse those tertiary operators <|eor|><|eols|><|endoftext|> | 103 |
programminghorror | lieronet | icml4y8 | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|sor|>I take it this person was forbidden by management, under threat of immediate termination, to use any switch statements?<|eor|><|sor|>Inside the `Select` lambda, it's more natural to use an expression... | 74 |
programminghorror | StruanT | icmumpm | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|sor|>Doesn't look so bad till you realize how many times you've had to collapse those tertiary operators <|eor|><|sor|>People are upset about the ternary operators? The thing that stood out to me was seri... | 73 |
programminghorror | CaitaXD | icmiwx1 | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|sor|>I take it this person was forbidden by management, under threat of immediate termination, to use any switch statements?<|eor|><|sor|>140 lines of code and 2 semicolons I think he gets paid by one lin... | 59 |
programminghorror | SilverTroop | icmsk91 | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|sor|>You're leaving the // holy shit in, right?<|eor|><|soopr|>I'm ripping the method out and building our data the sane way. If I didn't have time for that, absolutely that comment stays lol.<|eoopr|><|s... | 58 |
programminghorror | lieronet | icmd7c2 | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|soopr|>Names slightly changed to protect the innocent, hence the wonkiness in the method signature.<|eoopr|><|eols|><|endoftext|> | 55 |
programminghorror | svick | icmioyp | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|sor|>I take it this person was forbidden by management, under threat of immediate termination, to use any switch statements?<|eor|><|sor|>Inside the `Select` lambda, it's more natural to use an expression... | 45 |
programminghorror | AttackOfTheThumbs | icmirck | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|sor|>I find this amazing. The fact that someone chose this madness. They likely thought they were clever as shit. And I guess it's clever, because no one is figuring out this mess in a hot second.<|eor|><... | 35 |
programminghorror | dumpeldown | icmo7nz | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|soopr|>Names slightly changed to protect the innocent, hence the wonkiness in the method signature.<|eoopr|><|sor|>Sorry, what language is that? I can't make much sense of it.<|eor|><|sor|>Seems to be C# ... | 35 |
programminghorror | Dealiner | icmugfi | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|soopr|>Names slightly changed to protect the innocent, hence the wonkiness in the method signature.<|eoopr|><|sor|>Sorry, what language is that? I can't make much sense of it.<|eor|><|sor|>It's definitely... | 29 |
programminghorror | PrincessRTFM | icn8dpy | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|sor|>Everyone complaining about the ternaries needs to see my godawful [_32-line_ nested ternary](https://github.com/PrincessRTFM/XIVComboPlugin/blob/9af781fe0c20b8e60723ebc64abfe4fef854011f/CustomCombo.c... | 25 |
programminghorror | lieronet | icmqe72 | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|sor|>Did ReSharper get on drugs, eat the original code and then shit this up?<|eor|><|soopr|>To the best of my knowledge, a human wrote this and saw that it was good.<|eoopr|><|eols|><|endoftext|> | 22 |
programminghorror | svick | icmlmhm | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|sor|>I take it this person was forbidden by management, under threat of immediate termination, to use any switch statements?<|eor|><|sor|>Inside the `Select` lambda, it's more natural to use an expression... | 22 |
programminghorror | Mr_Alicates | icmne4c | <|sols|><|sot|>Found this little gem in the codebase today<|eot|><|sol|>https://i.redd.it/991gomjde1691.png<|eol|><|sor|>Did ReSharper get on drugs, eat the original code and then shit this up?<|eor|><|eols|><|endoftext|> | 14 |
programminghorror | SwordInStone | ot57he | <|sols|><|sot|>Code that rounds to next 1/20th found as SO answer<|eot|><|sol|>https://i.redd.it/csd06xctqwd71.png<|eol|><|eols|><|endoftext|> | 758 |
programminghorror | Sonotsugipaa | h6t24ad | <|sols|><|sot|>Code that rounds to next 1/20th found as SO answer<|eot|><|sol|>https://i.redd.it/csd06xctqwd71.png<|eol|><|sor|> function (x) {
return Math.floor(x * 20) / 20;
}
I hope that one wasn't the accepted answer
Edit: I just noticed (thanks to a reply) that I should have used `ceil` (like the S... | 254 |
programminghorror | datathecodievita | h6t1ru6 | <|sols|><|sot|>Code that rounds to next 1/20th found as SO answer<|eot|><|sol|>https://i.redd.it/csd06xctqwd71.png<|eol|><|sor|>A do-while loop, that's the first time i saw it since college<|eor|><|eols|><|endoftext|> | 136 |
programminghorror | SwordInStone | h6t2wr7 | <|sols|><|sot|>Code that rounds to next 1/20th found as SO answer<|eot|><|sol|>https://i.redd.it/csd06xctqwd71.png<|eol|><|sor|> function (x) {
return Math.floor(x * 20) / 20;
}
I hope that one wasn't the accepted answer
Edit: I just noticed (thanks to a reply) that I should have used `ceil` (like the S... | 72 |
programminghorror | PenisButtuh | h6tkh27 | <|sols|><|sot|>Code that rounds to next 1/20th found as SO answer<|eot|><|sol|>https://i.redd.it/csd06xctqwd71.png<|eol|><|sor|>I wonder if the guy asking the question sat around waiting for an answer rather than googling it.<|eor|><|sor|>Prof here. Most likely did Google for hours. It's pretty common to see beginning ... | 65 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.