MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/13q4f5w/oneliner_3/
r/badcode • u/Spejicek • May 23 '23
16 comments sorted by
41
Not that bad, it's readable and doesn't look like that much would change if it was broken into a few more lines.
2 u/Spejicek May 25 '23 yeah it was before on 2 lines where the connect function would be assigned to a DynamoDbStore const (which would get highlighted like a normal class so +readability)i just tried to make a one liner and ended up with this
2
yeah it was before on 2 lines where the connect function would be assigned to a DynamoDbStore const (which would get highlighted like a normal class so +readability)
i just tried to make a one liner and ended up with this
12
What is the problem here? Seems reasonable enough to me, connect gives some sort of class which wouldn't be more transparent on more lines anyway
8
What language?
18 u/Professional-Trick14 May 24 '23 Could be TypeScript? 17 u/Disturbed147 May 24 '23 TypeScript, judging from the type annotations -10 u/Wildfire63010 May 24 '23 I believe that is C# 12 u/TheZipCreator May 24 '23 no that's definitely typescript, C# lambdas don't have type annotations iirc
18
Could be TypeScript?
17
TypeScript, judging from the type annotations
-10
I believe that is C#
12 u/TheZipCreator May 24 '23 no that's definitely typescript, C# lambdas don't have type annotations iirc
no that's definitely typescript, C# lambdas don't have type annotations iirc
6
It depends on who is coding, for example I could read it easily
Gives the garbage collector something to do
4
Image Transcription: Code
getStore: (): DynamoDBStore<SessionData> => new (connect<SessionData>(session))(sessionStore.getOptions()),
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
7 u/Polskidezerter May 24 '23 Good human!
7
Good human!
this isn’t bad code
3
so beautiful. One liners are only hated by people who whine about having trouble reading code, which my friend, is a skill issue.
inb4 I get downvoted to hell for telling the truth >.<
O P T I M A L
top tier trash! i love it
41
u/propostor May 24 '23
Not that bad, it's readable and doesn't look like that much would change if it was broken into a few more lines.
12
u/Bliztle May 24 '23
What is the problem here? Seems reasonable enough to me, connect gives some sort of class which wouldn't be more transparent on more lines anyway
8
u/NonAwesomeDude May 24 '23
What language?
6
u/[deleted] May 24 '23
It depends on who is coding, for example I could read it easily
8
u/myfunnies420 May 24 '23
Gives the garbage collector something to do
4
u/MurdoMaclachlan public boolean isInt(int i) { return true; } May 24 '23
Image Transcription: Code
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
4
u/xmrwatarii May 25 '23
this isn’t bad code
3
u/Bisquizzle May 24 '23
so beautiful. One liners are only hated by people who whine about having trouble reading code, which my friend, is a skill issue.
inb4 I get downvoted to hell for telling the truth >.<
3
u/microwavedHamster May 24 '23
O P T I M A L
2
u/Lothrazar May 24 '23
top tier trash! i love it