Live data from Hacker News

Indentation Style: Notable Styles

en.wikipedia.org

1–10 of 21 posts

Re: Indentation Style: Notable Styles

#5
post #4

You'll have to pry Allman out of my cold, dead hands. My favourite bracketing style by far, and I'm very annoyed that its a syntax error in Go

Second that. I can tolerate K&R, but the others are blasphemy.

Amen on both. The rest is just noise. Brackets are still a disaster though... I do love the fact that you don't have to close HTML tags. Making out-dentation close all brackets in order would be great...

Re: Indentation Style: Notable Styles

#7
post #4

You'll have to pry Allman out of my cold, dead hands. My favourite bracketing style by far, and I'm very annoyed that its a syntax error in Go

Second that. I can tolerate K&R, but the others are blasphemy.

i used to do Allman and worked at a place where K&R was the rule, switched and never looked back

Re: Indentation Style: Notable Styles

#8

You'll have to pry Allman out of my cold, dead hands. My favourite bracketing style by far, and I'm very annoyed that its a syntax error in Go

Agreed 100%! I haven't written in go yet but whenever there are brackets I like for them to be vertically aligned with each other like Allman (even in Python!).

Agreeing with sibling comment too that K&R can be ok.. seems like K&R function declarations have Allman-like vertically-aligned brackets, but why not make that consistent for blocks inside the function too? 1TBS goes in the opposite direction, so not heaps of a fan of that.

I am a big fan of whitespace in code though, running afoul of various style-guides at times (like PEP8) because of the desire to put space between things to make things clearer.

I reckon code is already a very-condensed form of information, so it can help to make it easier to distinguish the meaningfully-different pieces by having some space around them. I know this is not everyone's jam, but that's what I like when reading code.

Re: Indentation Style: Notable Styles

#9
post #8

You'll have to pry Allman out of my cold, dead hands. My favourite bracketing style by far, and I'm very annoyed that its a syntax error in Go

Agreed 100%! I haven't written in go yet but whenever there are brackets I like for them to be vertically aligned with each other like Allman (even in Python!). Agreeing with sibling comment too that K&R can be ok.. seems like K&R function declarations have Allman-like vertically-aligned brackets, but why not make that consistent for blocks inside the function too? 1TBS goes in the opposite direction, so not heaps of…

I often put an extra line of space after blocks, and between lines that are less logically linked, just to separate them in my head better. Also I do wish you could use brackets in Python so I could have my beloved Allman there too :P

Re: Indentation Style: Notable Styles

#10

You'll have to pry Allman out of my cold, dead hands. My favourite bracketing style by far, and I'm very annoyed that its a syntax error in Go

Allman is almost perfect.

If only it had begin and end instead of the ugly braces we'd be in a wonderful world.

Post reply on HN