[TUHS] 80 columns ...

Jon Steinhart jon at fourwinds.com
Sun Nov 12 03:23:51 AEST 2017


Larry McVoy writes:
> > Wait, so _how_ do you like continuations to be indented?
> 
> I do it like so
> 
> 	if ((super_long_name_that_some_idiot_thought_was_smart > 1) &&
> 	    (super_long_name_that_some_idiot_thought_was_smarter > 2)) {
> 	    	something stupid here;
> 	}

To me, and to be clear that this is a personal preference as opposed to
something factual, I would do the above as:

 	if ((super_long_name_that_some_idiot_thought_was_smart > 1)
	 && (super_long_name_that_some_idiot_thought_was_smarter > 2)) {
 	    	something really smart here;
 	}

The one space indent shows that it's a continuation, but doesn't fool my
eye into thinking that it's a block like Larry's example.

There are many times that I am scrolling through code very quickly looking
for block structure, and I'm optimizing for that in my eyes.

There's also another personal preference above, which is that I prefer

	if this
	 AND that
to
	if this AND
	 that

Jon


More information about the TUHS mailing list