subreddit
stringclasses
7 values
author
stringlengths
3
20
id
stringlengths
5
7
content
stringlengths
67
30.4k
score
int64
0
140k
programminghorror
josephblade
imz3loj
<|sols|><|sot|>arrow code.<|eot|><|sol|>https://i.redd.it/r880jbybgnl91.jpg<|eol|><|sor|>This is a sign of an insecure programmer. Maybe even a nihilistic one. They believe nothing. They test everything, even if the documentation guarantees it. They are also evidently hooked on inline functions. It's their meth I supp...
21
programminghorror
AL1L
imytdur
<|sols|><|sot|>arrow code.<|eot|><|sol|>https://i.redd.it/r880jbybgnl91.jpg<|eol|><|sor|>Transcription: import { isPlatformBrowser } from '@angular/common'; import { Inject, Injectable, PLATFORM_ID } from '@angular/core'; import { NavigationStart, Router } from '@angular/router'; @Injectable e...
20
programminghorror
carcigenicate
imyy9ps
<|sols|><|sot|>arrow code.<|eot|><|sol|>https://i.redd.it/r880jbybgnl91.jpg<|eol|><|sor|>Im new to programming. So, whats the right way?<|eor|><|sor|>[guard clauses](https://pbs.twimg.com/media/EsBDLp8XcAIWugP?format=png&name=orig) \- instead of checking if something is correct before proceeding further into the if/els...
19
programminghorror
AdminYak846
imz2hts
<|sols|><|sot|>arrow code.<|eot|><|sol|>https://i.redd.it/r880jbybgnl91.jpg<|eol|><|sor|>They gotta learn how to just invert the ifs with early returns to avoid having 20 depth blocks. Theres even a switch with only one case...<|eor|><|sor|>>Theres even a switch with only one case... Oh no that's definitely a thing y...
17
programminghorror
CoolDiamond42
imzjohz
<|sols|><|sot|>arrow code.<|eot|><|sol|>https://i.redd.it/r880jbybgnl91.jpg<|eol|><|sor|>This shit drives me insane. I see it a lot at work and it just screams I did this in a single pass and plan on never looking at it again. Writers edit. Composers edit. Artists and craftsmen and tradesmen all know that creation is a...
16
programminghorror
No-Witness2349
imz0uqj
<|sols|><|sot|>arrow code.<|eot|><|sol|>https://i.redd.it/r880jbybgnl91.jpg<|eol|><|sor|>Transcription: import { isPlatformBrowser } from '@angular/common'; import { Inject, Injectable, PLATFORM_ID } from '@angular/core'; import { NavigationStart, Router } from '@angular/router'; @Injectable e...
13
programminghorror
kristallnachte
in0vnrx
<|sols|><|sot|>arrow code.<|eot|><|sol|>https://i.redd.it/r880jbybgnl91.jpg<|eol|><|sor|>They gotta learn how to just invert the ifs with early returns to avoid having 20 depth blocks. Theres even a switch with only one case...<|eor|><|sor|>you cant be serius if(!exp) reutrn; if(!exp2) return; if(!exp2) r...
12
programminghorror
lucidspoon
imzhjky
<|sols|><|sot|>arrow code.<|eot|><|sol|>https://i.redd.it/r880jbybgnl91.jpg<|eol|><|sor|>They gotta learn how to just invert the ifs with early returns to avoid having 20 depth blocks. Theres even a switch with only one case...<|eor|><|sor|>My favorite kind of refactoring. Super satisfying to plow through and remove a...
10
programminghorror
cergo123
10bpmrw
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|eols|><|endoftext|>
1,182
programminghorror
AnnoyingRain5
j4bl6d0
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>Its just making *real* sure that the listening service is enabled<|eor|><|eols|><|endoftext|>
192
programminghorror
BimphyRedixler
j4bku3l
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>In case anyone is wondering about the `!!.`, it looks like Kotlin's [Not-Null assertion operator](https://kotlinlang.org/docs/null-safety.html#the-operator).<|eor|><|eols|><|endoftext|>
74
programminghorror
_Xertz_
j4bn6i2
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>Its just making *real* sure that the listening service is enabled<|eor|><|sor|>Cosmic ray protection <|eor|><|eols|><|endoftext|>
73
programminghorror
DatCoolJeremy
j4bzrx1
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>Mfw the pattern-recognizing robot found a pattern<|eor|><|eols|><|endoftext|>
47
programminghorror
kristallnachte
j4bjeo9
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>That's literally someone else's code copy pasted<|eor|><|sor|>Unlikely. It instead saw that some people did the pattern of maybe one or two maybe even 3 like this and extrapolated.<|eor|><|eols|><|endoftext|>
33
programminghorror
uragiristereo
j4bybur
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>In case anyone is wondering about the `!!.`, it looks like Kotlin's [Not-Null assertion operator](https://kotlinlang.org/docs/null-safety.html#the-operator).<|eor|><|sor|>using it blindly without knowing that the variable will b...
28
programminghorror
Zacryon
j4c683v
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>Why did you crop the image?! I want to know how it ends! /s<|eor|><|eols|><|endoftext|>
24
programminghorror
terminal_styles
j4bnpw4
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>That's literally someone else's code copy pasted<|eor|><|sor|>Tell me you haven't tried Copilot and just read all AI horror stories without telling me lol.<|eor|><|eols|><|endoftext|>
20
programminghorror
WolfOfYoitsu
j4bl7l4
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>I basically never get stuff like this. code base must be messed up.<|eor|><|sor|>Not necessarily. Occasionally I get the same thing when I write HTML. Just with divs. Sometimes Copilot just has a stroke.<|eor|><|eols|><|endoftex...
17
programminghorror
cergo123
j4dpcej
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>Why did you crop the image?! I want to know how it ends! /s<|eor|><|soopr|>There was no end, every time you click tab some new lines with the same count will be added<|eoopr|><|eols|><|endoftext|>
16
programminghorror
kristallnachte
j4ct23b
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>That's literally someone else's code copy pasted<|eor|><|sor|>Unlikely. It instead saw that some people did the pattern of maybe one or two maybe even 3 like this and extrapolated.<|eor|><|sor|>So it copy pasta'd it.<|eor|><|so...
14
programminghorror
FM-96
j4elcfz
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>Why did you crop the image?! I want to know how it ends! /s<|eor|><|soopr|>There was no end, every time you click tab some new lines with the same count will be added<|eoopr|><|sor|>No, no. I'm sure it'll end sometime. Just kee...
9
programminghorror
banzomaikaka
j4d8ri7
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>I'm pretty sure there were people saying that cars were the future of transportation while they were still breaking all the time. so this proves nothing. my statement doesn't prove the opposite either. i know this was posted f...
6
programminghorror
fsactual
j4dz33k
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>I think AI is going to do the opposite of taking everyone's job and instead will make it MUCH easier for regular engineers to start their own small businesses and work as if they're a whole team of engineers. There's only so mu...
5
programminghorror
cergo123
j4bp42v
<|sols|><|sot|>GitHub Copilot<|eot|><|sol|>https://i.redd.it/cy2j790pp0ca1.png<|eol|><|sor|>In case anyone is wondering about the `!!.`, it looks like Kotlin's [Not-Null assertion operator](https://kotlinlang.org/docs/null-safety.html#the-operator).<|eor|><|soopr|>yes, it is<|eoopr|><|eols|><|endoftext|>
5
programminghorror
_xithyl
sh0unm
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|eols|><|endoftext|>
1,184
programminghorror
Kelpsie
hv07zrg
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|soopr|>For those interested in trying, here is the code: globals().update({l[:2]: __import__(l) for l in "re random sys string".split()}) or (lambda a, w: (lambda c: (lambda l:lambda k, i:l(l,k,i)...
246
programminghorror
_xithyl
huzo67y
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|soopr|>For those interested in trying, here is the code: globals().update({l[:2]: __import__(l) for l in "re random sys string".split()}) or (lambda a, w: (lambda c: (lambda l:lambda k, i:l(l,k,i)...
233
programminghorror
_xithyl
hv0jb72
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|soopr|>For those interested in trying, here is the code: globals().update({l[:2]: __import__(l) for l in "re random sys string".split()}) or (lambda a, w: (lambda c: (lambda l:lambda k, i:l(l,k,i)...
87
programminghorror
sohang-3112
hv02kff
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|sor|>This is Code Golf - doesn't really belong here...<|eor|><|eols|><|endoftext|>
86
programminghorror
bajuh
huzv29p
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|sor|>[deleted]<|eor|><|sor|>If an achievement has to do something with code golfing, you need to set aside your feelings and rate it from a code golfing perspective.<|eor|><|eols|><|endoftext|>
67
programminghorror
individual_throwaway
huzxvui
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|sor|>Not really horror, huh? Code golf doesn't aim for beauty, elegance or maintainability.<|eor|><|eols|><|endoftext|>
58
programminghorror
devil_sees
hv0arb8
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|soopr|>For those interested in trying, here is the code: globals().update({l[:2]: __import__(l) for l in "re random sys string".split()}) or (lambda a, w: (lambda c: (lambda l:lambda k, i:l(l,k,i)...
52
programminghorror
rainbow227kitty
hv0920b
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|sor|>This is Code Golf - doesn't really belong here...<|eor|><|sor|>I don't think so. spreading it out into a few lines would surely make a smaller program you could do ``` x = 1 ``` instead of ``` g...
52
programminghorror
_xithyl
hv0l4jr
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|sor|>This is Code Golf - doesn't really belong here...<|eor|><|soopr|>The community description mentions strange code. So I thought this abomination of nested lambdas would belong here. I mean imagine...
39
programminghorror
prashnts
hv0yu8r
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|soopr|>For those interested in trying, here is the code: globals().update({l[:2]: __import__(l) for l in "re random sys string".split()}) or (lambda a, w: (lambda c: (lambda l:lambda k, i:l(l,k,i)...
36
programminghorror
carfniex
hv0ax78
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|sor|> funks Fail... Word was: funks it's not perfect<|eor|><|eols|><|endoftext|>
31
programminghorror
EmbarrassedActive4
hv0ijg5
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|soopr|>For those interested in trying, here is the code: globals().update({l[:2]: __import__(l) for l in "re random sys string".split()}) or (lambda a, w: (lambda c: (lambda l:lambda k, i:l(l,k,i)...
26
programminghorror
Deadly_chef
hv11r57
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|sor|>This is Code Golf - doesn't really belong here...<|eor|><|sor|>I don't think so. spreading it out into a few lines would surely make a smaller program you could do ``` x = 1 ``` instead of ``` g...
22
programminghorror
xigoi
hv0wauw
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|sor|>[deleted]<|eor|><|sor|>If an achievement has to do something with code golfing, you need to set aside your feelings and rate it from a code golfing perspective.<|eor|><|sor|>[deleted]<|eor|><|sor|...
20
programminghorror
leopardspotte
huzvhym
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|sor|>Well fucking done<|eor|><|eols|><|endoftext|>
18
programminghorror
sohang-3112
hv0lifd
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|sor|>This is Code Golf - doesn't really belong here...<|eor|><|soopr|>The community description mentions strange code. So I thought this abomination of nested lambdas would belong here. I mean imagine...
15
programminghorror
CitrusLizard
hv04d8l
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|sor|>Your programmers were so preoccupied with whether or not they could, they didn't stop to think if they should. ... Good stuff, though!<|eor|><|eols|><|endoftext|>
12
programminghorror
_xithyl
hv0lu5g
<|sols|><|sot|>Python3 implementation of Wordle in one line<|eot|><|sol|>https://www.reddit.com/gallery/sh0unm<|eol|><|sor|>But ten turns is 4 too many, so it failed at its goal.<|eor|><|soopr|>Sorry.... But that would only require a small change of the corresponding magic number to fix :) See its right there in line 1...
12
programminghorror
trollgodlol
ro33nq
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|eols|><|endoftext|>
1,180
programminghorror
shurikns
hpw7y51
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>Its Just && with extra steps<|eor|><|eols|><|endoftext|>
313
programminghorror
noop_noob
hpw7qhk
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>I mean... this is what logical operators often compile into in assembly, so...<|eor|><|eols|><|endoftext|>
133
programminghorror
glieseg
hpwcly8
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>Its Just && with extra steps<|eor|><|sor|>Quite a lot of extra steps.<|eor|><|eols|><|endoftext|>
105
programminghorror
AlternativeAardvark6
hpwlqb3
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>I mean... this is what logical operators often compile into in assembly, so...<|eor|><|sor|>But we don't have to read assembly.<|eor|><|eols|><|endoftext|>
89
programminghorror
AgreeableLandscape3
hpwpd8p
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>Its Just && with extra steps<|eor|><|sor|>To be fair the compiler probably optimizes it to the same assembly anyway. The C compiler is kind of a beast.<|eor|><|eols|><|endoftext|>
57
programminghorror
jazzmester
hpwqm8m
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>Congratulations, by calling `strlen` in the condition part, you ensured that an otherwise `O(n)` code would become `O(n^(2))`. The `if` tower seems to be a minor thing compared to that. (Ass...
43
programminghorror
Javascript_above_all
hpwg1hn
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>49th isn't indented correctly<|eor|><|eols|><|endoftext|>
40
programminghorror
lainproliant
hpwcp5k
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>The Machine Spirit is long gone from this codebase.<|eor|><|eols|><|endoftext|>
38
programminghorror
GroundStateGecko
hpwpeop
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>Its Just && with extra steps<|eor|><|sor|>Quite a lot of extra steps.<|eor|><|sor|>And extra spaces.<|eor|><|eols|><|endoftext|>
32
programminghorror
serg06
hpww89u
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>Its Just && with extra steps<|eor|><|sor|>No need for && if (strchr(' ",:.', arg1[i])) { letters++; }<|eor|><|eols|><|endoftext|>
30
programminghorror
GroundStateGecko
hpwpgc9
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>49th isn't indented correctly<|eor|><|sor|>Python entered the chat.<|eor|><|eols|><|endoftext|>
28
programminghorror
K1ngjulien_
hpx8372
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>I mean... this is what logical operators often compile into in assembly, so...<|eor|><|sor|>Yes but just use ascii codes when checking for letters. Why use 100 if statements when 1 would work...
27
programminghorror
WCBROW01
hpx66m6
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>Congratulations, by calling `strlen` in the condition part, you ensured that an otherwise `O(n)` code would become `O(n^(2))`. The `if` tower seems to be a minor thing compared to that. (Ass...
24
programminghorror
NullPro
hpw2qoz
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>Arrrgh pascal case my eyes my eyes<|eor|><|sor|>Worse. Its **inconsistent** case<|eor|><|eols|><|endoftext|>
24
programminghorror
noop_noob
hpw8trw
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>Arrrgh pascal case my eyes my eyes<|eor|><|sor|>Worse. Its **inconsistent** case<|eor|><|sor|>How is it inconsistent?<|eor|><|sor|>letters is all lowercase and Count1 is not<|eor|><|sor|>It's...
17
programminghorror
SeesawMundane5422
hpxcpfe
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>Its Just && with extra steps<|eor|><|sor|>No need for && if (strchr(' ",:.', arg1[i])) { letters++; }<|eor|><|sor|>I mean, to me the bigger concern is that the algorithm is p...
16
programminghorror
MarkusBerkel
hpw190c
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>Arrrgh pascal case my eyes my eyes<|eor|><|eols|><|endoftext|>
15
programminghorror
SneakyStabbalot
hpxatve
<|sols|><|sot|>I opened one of my old projects. Omnissiah save us.<|eot|><|sol|>https://i.redd.it/xvydzzhshm781.png<|eol|><|sor|>Its Just && with extra steps<|eor|><|sor|>Quite a lot of extra steps.<|eor|><|sor|>And extra spaces.<|eor|><|sor|>and lines<|eor|><|eols|><|endoftext|>
13
programminghorror
Mustard_Dimension
f28xd5
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|eols|><|endoftext|>
1,182
programminghorror
TheBrainStone
fhb3qrd
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>That's what you use a map for. Ideally a sorted map. (Like `std::map<std::string, char>`)<|eor|><|eols|><|endoftext|>
226
programminghorror
tech6hutch
fhblyzs
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>What does compare return? Based on the name, I would guess a value indicating whether the object is less than, equal to, or greater than the argument, and since it's C++ and not a fancier language, ...
54
programminghorror
jarrydn
fhbg572
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>That's what you use a map for. Ideally a sorted map. (Like `std::map<std::string, char>`)<|eor|><|sor|>Use a binary tree. Morse can only be a dot (0) or dash (1), in a sequence. For each character, ...
43
programminghorror
Qesa
fhc4egn
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>That's what you use a map for. Ideally a sorted map. (Like `std::map<std::string, char>`)<|eor|><|sor|>A trie (which here will turn out to be a binary tree) will be much more efficient.<|eor|><|sor|...
40
programminghorror
lrflew
fhbv6xc
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>That's what you use a map for. Ideally a sorted map. (Like `std::map<std::string, char>`)<|eor|><|sor|>Use a binary tree. Morse can only be a dot (0) or dash (1), in a sequence. For each character, ...
32
programminghorror
1008oh
fhbolbp
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>That's what you use a map for. Ideally a sorted map. (Like `std::map<std::string, char>`)<|eor|><|sor|>Use a binary tree. Morse can only be a dot (0) or dash (1), in a sequence. For each character, ...
24
programminghorror
Mustard_Dimension
fhbm9i9
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>What does compare return? Based on the name, I would guess a value indicating whether the object is less than, equal to, or greater than the argument, and since it's C++ and not a fancier language, ...
22
programminghorror
zelmarvalarion
fhbqbkx
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>That's what you use a map for. Ideally a sorted map. (Like `std::map<std::string, char>`)<|eor|><|sor|>Why would you want it sorted? If it's unordered, it uses a hash function. It would give you O(1...
22
programminghorror
JoyJoy_
fhbjwm0
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>It's perfect if your hardware is bad at math.<|eor|><|eols|><|endoftext|>
19
programminghorror
tech6hutch
fhbmza5
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>What does compare return? Based on the name, I would guess a value indicating whether the object is less than, equal to, or greater than the argument, and since it's C++ and not a fancier language, ...
17
programminghorror
_kasdeya_
fhc6b1e
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>I swear like 90% of the posts here are people who don't understand arrays, dicts, ior loops. It's kind of depressing.<|eor|><|eols|><|endoftext|>
16
programminghorror
tanner00r
fhbmnjm
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>That's what you use a map for. Ideally a sorted map. (Like `std::map<std::string, char>`)<|eor|><|sor|>Why would you want it sorted? If it's unordered, it uses a hash function. It would give you O(1...
15
programminghorror
JakeN9
fhbh1pc
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>Sorry undergraduate?<|eor|><|eols|><|endoftext|>
13
programminghorror
YellowBunnyReddit
fhb5shv
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>Convert the strings to numbers somehow and use them as array indices for a constant execution time.<|eor|><|eols|><|endoftext|>
11
programminghorror
tech6hutch
fhc7ec3
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>What does compare return? Based on the name, I would guess a value indicating whether the object is less than, equal to, or greater than the argument, and since it's C++ and not a fancier language, ...
8
programminghorror
FM-96
fhd3lzy
<|sols|><|sot|>My developer friend did not enjoy my undergraduate C++<|eot|><|sol|>https://imgur.com/4bzL7dI<|eol|><|sor|>What does compare return? Based on the name, I would guess a value indicating whether the object is less than, equal to, or greater than the argument, and since it's C++ and not a fancier language, ...
8
programminghorror
PyroCatt
ultby8
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|eols|><|endoftext|>
1,183
programminghorror
ifezueyoung
i7xkn7l
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>When I see code like this, my imposter syndrome reduces a bit<|eor|><|eols|><|endoftext|>
422
programminghorror
Sematre
i7xg21o
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>How does the code get worse the more I look at it?<|eor|><|eols|><|endoftext|>
371
programminghorror
PyroCatt
i7xen09
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|soopr|>And the log is active in production still...<|eoopr|><|eols|><|endoftext|>
120
programminghorror
apotentiallytempacc
i7xlp5z
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>This looks obfuscated by something like Closure Compiler. No human would use !0 for true.<|eor|><|eols|><|endoftext|>
108
programminghorror
_last_responder_
i7xpyub
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>How does the code get worse the more I look at it?<|eor|><|sor|>Its recursive<|eor|><|eols|><|endoftext|>
87
programminghorror
happykal
i7ya4e8
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>When I see code like this, my imposter syndrome reduces a bit<|eor|><|sor|>Same..... 25+ years and I still feel it.<|eor|><|eols|><|endoftext|>
82
programminghorror
ings0c
i7y7cu1
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>[deleted]<|eor|><|sor|>I burst out laughing at the `2e3`ms timeout This has to be a joke<|eor|><|eols|><|endoftext|>
82
programminghorror
CastleNugget
i7y3quv
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>How does the code get worse the more I look at it?<|eor|><|sor|>Its recursive<|eor|><|sor|>No? Where does it recurse?<|eor|><|sor|>Hes kidding, but that would be how code ...
81
programminghorror
alvarsnow
i7xklih
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>Looks like is auto-generated code from some kind of framework, not everything you see in JS is made by a developer directly, it was also obfuscated observing the variable ...
69
programminghorror
notian
i7xxrg5
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>This looks obfuscated by something like Closure Compiler. No human would use !0 for true.<|eor|><|sor|>Or \``2e3`\` instead of 2000 for the timeout. I've looked at closure...
58
programminghorror
SC_Reap
i7xnzku
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>This looks obfuscated by something like Closure Compiler. No human would use !0 for true.<|eor|><|sor|>!0<|eor|><|eols|><|endoftext|>
49
programminghorror
EmperorArthur
i7xwws0
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|soopr|>And the log is active in production still...<|eoopr|><|sor|>Sounds about right. If you look at most government contracts, they just care about the product and a load of...
46
programminghorror
Member_Berrys
i7ybv03
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>How does the code get worse the more I look at it?<|eor|><|sor|>Its recursive<|eor|><|sor|>No? Where does it recurse?<|eor|><|sor|>Hes kidding, but that would be how code ...
40
programminghorror
freak_dessert2
i7xolsw
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>Looks like is auto-generated code from some kind of framework, not everything you see in JS is made by a developer directly, it was also obfuscated observing the variable ...
38
programminghorror
ngalotti
i7ybeei
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>[deleted]<|eor|><|sor|>I burst out laughing at the `2e3`ms timeout This has to be a joke<|eor|><|sor|>The 2e3 is a common way for a minifier to save a character.<|eor|><...
38
programminghorror
nystro
i7yq4cd
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>When I see code like this, my imposter syndrome reduces a bit<|eor|><|sor|>Same..... 25+ years and I still feel it.<|eor|><|sor|>Damn It doesn't help that I haven't been...
36
programminghorror
ings0c
i7ycmih
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>[deleted]<|eor|><|sor|>I burst out laughing at the `2e3`ms timeout This has to be a joke<|eor|><|sor|>The 2e3 is a common way for a minifier to save a character.<|eor|><...
29
programminghorror
Tvde1
i7y0gwm
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>How does the code get worse the more I look at it?<|eor|><|sor|>Its recursive<|eor|><|sor|>No? Where does it recurse?<|eor|><|eols|><|endoftext|>
27
programminghorror
BimphyRedixler
i7yya1m
<|sols|><|sot|>So I found this gem in a government website for managing school records<|eot|><|sol|>https://i.redd.it/efb2ao15ugy81.png<|eol|><|sor|>[deleted]<|eor|><|sor|>I burst out laughing at the `2e3`ms timeout This has to be a joke<|eor|><|sor|>The 2e3 is a common way for a minifier to save a character.<|eor|><...
27
programminghorror
AceKiron
rt6ey0
<|sols|><|sot|>No<|eot|><|sol|>https://i.redd.it/p49c5y717t881.png<|eol|><|eols|><|endoftext|>
1,170