That Fibonacci based indentation might not be a bad idea after all. Especially when doing callback-style javascript.
I'd prefer something like 3^n. Would really make you try to avoid needless nesting.
Alternative code styles
21–30 of 107 posts
Re: Alternative code styles
#22Nowadays 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.
Re: Alternative code styles
#23Re: Alternative code styles
#24Nowadays 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.
I laugh when I see those 50-page English-language documents describing how some institution wants code to be formatted. Ain't nobody got time for that.
Re: Alternative code styles
#25Earlier quoted context omitted.
:O that is ... interesting. Sure that's not an entry for the ioccc? ;)
Nope :) This is being used everyday in production by most financial institutions. https://code.kx.com/wiki/Cookbook/InterfacingWithC I've been told that the guy who wrote this believe that the brain only has a limited buffer to compute source code. So he is trying to use the shortest code possible everywhere.
Re: Alternative code styles
#26Earlier quoted context omitted.
I'd prefer something like 3^n. Would really make you try to avoid needless nesting.
Why should I avoid needless nesting ? Is there any other reason besides the holy 80 character limit !? Nesting can for example be used to limit variable scope and make use of closures, or to avoid creating more code paths, or just make the code more readable. You can however often break some code down to named functions and it will be easier to read, with the added benefit of less nesting. But I don't see how avoidin…
Re: Alternative code styles
#27Earlier quoted context omitted.
Nope :) This is being used everyday in production by most financial institutions. https://code.kx.com/wiki/Cookbook/InterfacingWithC I've been told that the guy who wrote this believe that the brain only has a limited buffer to compute source code. So he is trying to use the shortest code possible everywhere.
"This is being used everyday in production by most financial institutions" — you can't be serious...
Re: Alternative code styles
#28Surprised nobody talks about the kdb codding style: https://github.com/KxSystems/kdb/blob/master/c/c/k.h
Re: Alternative code styles
#29Earlier quoted context omitted.
Nope :) This is being used everyday in production by most financial institutions. https://code.kx.com/wiki/Cookbook/InterfacingWithC I've been told that the guy who wrote this believe that the brain only has a limited buffer to compute source code. So he is trying to use the shortest code possible everywhere.
"This is being used everyday in production by most financial institutions" — you can't be serious...
Re: Alternative code styles
#30Earlier quoted context omitted.
I'd prefer something like 3^n. Would really make you try to avoid needless nesting.
Why should I avoid needless nesting ? Is there any other reason besides the holy 80 character limit !? Nesting can for example be used to limit variable scope and make use of closures, or to avoid creating more code paths, or just make the code more readable. You can however often break some code down to named functions and it will be easier to read, with the added benefit of less nesting. But I don't see how avoidin…
Agree with you that reducing nesting is not in and of itself beneficial.