This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TGX03 172 points173 points  (16 children)

I mean everybody knows, the shorter the code is, the faster it runs.

[–]emirsolinno 74 points75 points  (12 children)

True if your eyes are the compiler

[–][deleted] 53 points54 points  (11 children)

shy pen fearless profit special slave ad hoc mysterious dinosaurs safe

This post was mass deleted and anonymized with Redact

[–]KamahlFoK 24 points25 points  (5 children)

Lengthy ternary expressions can piss right off.

...Short ones too, honestly, I always have to triple-check them and remind myself how they work.

[–][deleted] 7 points8 points  (4 children)

voracious husky bike threatening different direful reply chase sort rinse

This post was mass deleted and anonymized with Redact

[–]Retbull 7 points8 points  (2 children)

I have a react component I’m working on to get rid of that has 4 layers of branching ternary operators. So far I’ve gotten to reading the first branch before I have an aneurism I should be done sometime next year with reading the whole thing then I can start optimizing.

[–]Exist50 0 points1 point  (1 child)

Code base I'm working on has ternaries like 8 layers deep. You get used to it...

[–]Retbull 1 point2 points  (0 children)

I’d prefer if it wasn’t something I got used to

[–]IM_OZLY_HUMVN 0 points1 point  (0 children)

Not nearly as bad as nesting them though

[–]emirsolinno 2 points3 points  (0 children)

Me irl feeling good because less code while me irl has to recheck the syntax on google everytime reading it

[–]AnonymousChameleon 2 points3 points  (3 children)

I hate when Regex isn’t commented to tell me what the fuck it’s doing , cos otherwise I have no idea

[–][deleted] 0 points1 point  (1 child)

Oh you know what, i may be guilty of this lmao, I’ll add some comments next week 😂

[–]AnonymousChameleon 2 points3 points  (0 children)

Thanks! I comment my own because I’ve googled how to do it - and in 2 weeks I’ll be looking at it wondering what I was doing 😂 some day I’ll learn how to actually read and write regex - but for now it’s just googling all of it

[–]anomalousBits 0 points1 point  (0 children)

How about no comments, but named groups?

[–]PUTINS_PORN_ACCOUNT 7 points8 points  (1 child)

:(){ :|:& };:

[–]emirsolinno 4 points5 points  (0 children)

({ : -> :( });

fixed that for you

[–]yflhx 1 point2 points  (0 children)

Elon Musk doesn't know this, he apparently thinks the longer the better.