Nowadays I couldn't care less about what style is used. As long as the code is consistent and there's an easy way to adhere (clang-format, black, prettier, etc.) I'm happy.
Alternative code styles
51–60 of 107 posts
Re: Alternative code styles
#52Surprised nobody talks about the kdb codding style: https://github.com/KxSystems/kdb/blob/master/c/c/k.h
That's Whitney's style. My preferred example is http://www.kparc.com/b/b.c It looks obfuscated, but in fact it is just a lot of information. Many people would claim dividing it in 10 files with longer function names and less tricks would make it easier to understand, but after spending a long time studying (and partly rewriting) this code, I actually find the terse version better.
I'm sure Mr. Goldberg understood his machines just fine, too.
Re: Alternative code styles
#53Braceless Rust does look very nice. I wonder if a python style syntax is possible?
Re: Alternative code styles
#54Re: Alternative code styles
#55Earlier quoted context omitted.
Do you actually do this? From what I hear (and this makes sense from what I know about formatting/parsing algorithms) it's a huge pain, and not implemented for many languages.
I have my IDE do all the formatting every time I close something and rarely personally intervene.
My experience is: each time a team started doing this, all coding-style related discussions vanished, and it became a non-issue. It turns out it's a lot easier to accept a coding style you're not the one doing the actual formatting (this is why, BTW, I think stylechecking hooks alone are a bad idea).
Re: Alternative code styles
#56Re: Alternative code styles
#57Nowadays I couldn't care less about what style is used. As long as the code is consistent and there's an easy way to adhere (clang-format, black, prettier, etc.) I'm happy.
Sign of an experienced architect. Read: "I'm old and too tired to argue, just don't break it ok."
Re: Alternative code styles
#58This has to be satire. Most of these are terrible and I'm pretty sure the fibonacci indentation originated on /g/.
Re: Alternative code styles
#59Putting every single item in this on my list of "reasons to kill a motherfucker". Seriously though, I find myself oddly attracted to the Python-braces style .. if only I could use it without running afoul of my own list.
Re: Alternative code styles
#60Aaaand… “we're achieving levels of nerdery that shouldn't be possible.”