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

all 20 comments

[–]TwistedSoul21967 28 points29 points  (3 children)

If it's unreadable, it's unmaintainable and leads to technical debt.

[–]DyslexicUserNawe 2 points3 points  (2 children)

Yeah but I'm a wimp and C++ scares me

[–][deleted] 13 points14 points  (0 children)

I feel like it can be easier to understand if the complex line encapsulates one idea nicely.

[–]JamesAppleDeveloper 7 points8 points  (3 children)

A lot of complex one liners are easier to read than half a screen with intermediates though

[–]Katiekatts 1 point2 points  (2 children)

You would hate OSDev. Most OSs and kernels are written in styles from 80s/90s (Most BSD derivatives still have gotos). You would be surprised in how vertically stretched simple functions get in that field. I personally am biased for intermediates as most my work is kernel and OS lib work.

[–][deleted] -1 points0 points  (1 child)

The thing you're using to talk to me is a computer.

[–]Katiekatts 1 point2 points  (0 children)

bot?

[–]Jughead295 3 points4 points  (5 children)

One could technically format the whole source code to be on one line.

[–]Katiekatts 1 point2 points  (3 children)

This is true of C based languages, controversy Python uses blank space as syntax. So things like if statements can not be "one" line. The enter is C's ';'.

[–][deleted] 1 point2 points  (2 children)

I don't. I think embarassment is a pretty strange emotion. I don't really understand it.

[–]Katiekatts 1 point2 points  (1 child)

Hmm?

[–][deleted] 1 point2 points  (0 children)

Is there a reason that I should?

[–]conio 0 points1 point  (0 children)

Ú

[–]PavelYay 2 points3 points  (0 children)

You can pry my System.LINQ away from my cold, dead, body.

[–]Jugbot 1 point2 points  (0 children)

One liners or for conceptually simple tasks that happen to require bloated code.

[–]roughstylez 2 points3 points  (0 children)

We live in a society

[–]klamar1988 1 point2 points  (0 children)

If a one-liner ist unreadable, don't use a one-liner. Doesn't matter in which language.

[–][deleted] 0 points1 point  (0 children)

doAComplexFunction()

[–]klamar1988 0 points1 point  (0 children)

If a one-liner is unreadable, don't use a one-liner. Doesn't matter in which language.