Are there other major variants of code formatting style still being developed out there?
[1] https://news.ycombinator.com/item?id=30130315
[2] https://github.com/boot-clj/boot/blob/master/boot/base/src/main/java/boot/App.java
[1] https://en.wikipedia.org/wiki/Indentation_style#Horstmann_st... [2] https://bugs.llvm.org/show_bug.cgi?id=27263
GNU C formatting is odd: https://en.wikipedia.org/wiki/GNU_coding_standards
Zlib still uses K&R-1st-edition-era function definitions: https://github.com/madler/zlib/blob/cacf7f1d4e3d44d871b605da...
I think that was done to make grepping for function definitions easier (when searching for the definition of foo, grep for “^foo\b”. That makes implementing “go to function definition” possible without having to parse code)
I myself am a huge fan of Pascal, and limiting code to one function per line. I find that clever/terse code is unmaintainable code.
Here's some code I wrote back in 1991 for a TECO clone that reflects that style. Looking back, I think some things could have a few more comments, but it seems fairly easy to read the intent of the code.
Given near all code (let's say for large projects) is authored with IDEs, elaborate formats can be applied consistently and automatically, at little or no cognitive or typing cost.
To me the question is then if such formatting can increase the legibility of the code. The grid of static variable declarations in [2] is nice, but I wonder if sorting the variable lexicographically would make it easier to read/find a var by name?
Not sure how splitting method signature names onto a second line helps, though.
Niklaus Wirth, Verilog: http://people.inf.ethz.ch/wirth/FPGA-relatedWork/RS232R.v
all of ioccc)
Example:
Saving money, saving bytes
Qed.
https://google.github.io/styleguide/htmlcssguide.html#HTML_F...
Sound confusing - very. I could see his "logic" but as to teaching programming students ... yes confusion all round, and wait till the poor students move on to any other language #@%%!$#!!!
With the availabily of syntax highlighting including color, has anyone seen merit in skipping indentation altogether?
For that matter, what if block color or font size took the place of indentation (under control of syntax highlighting). I'll have to try it by hand.
To make it "less crowded", and allow space for future comments, I was told.