Diomidis Spinellis, a software engineering professor and author of Code Reading, writes on Unix history, C, and tooling.
HN links it for the C preprocessing algorithm write-up, which a compiler writer says is needed, and for Unix history charts.
Yes, though I don't think you can say anything really objective about the "quality" based on the data available. I found some of the statistics in the case of Windows source indicative of lower readability and maintainability...defined global funcs and structs counts are higher than the Open Source systems (FreeBSD and Linux) and file length is significantly longer, even though Linux is a significantly larger codebase (the largest of all of the systems analyzed). But, of course, that's just numbers...roughly meaningless without context. And, obviously, Microsoft manages to keep shipping code that mostly works, and they hire some of the best developers in the world.
Here's the paper:
http://www.spinellis.gr/pubs/conf/2008-ICSE-4kernel/html/Spi08b.pdf
And some additional commentary:
http://www.spinellis.gr/sw/4kernel/
Anyway, while I've never seen the Windows source code, I have looked at FreeBSD, Linux and Solaris, and all are pretty good. I think FreeBSD may be the cleanest (partly because it tries to be fewer things to fewer people than Linux), but probably not technically the most interesting. And, of course, I've only taken a few quick trips through FreeBSD and Solaris, and I've actually written driver code for Linux. Doing real work in a codebase always makes the warts more apparent.
Using my complete lack of statistical knowledge, I multiplied the wrong output rate % by the total lines of code in the examples from original paper here http://www.spinellis.gr/pubs/conf/2012-PLATEAU-Fuzzer/pub/html/fuzzer.html to get a very bad approximation of fat fingering adjusted for program length. You'd expect more typos in a longer program; the original experiment always introduced 1 typo per run regardless of program length.
You guys enjoy while I prepare for the lynch mob of Statisticians :-)
Lang Err % LOC LOC adjusted Err %
Ruby 0.17 159 27.03
Python 0.15 161 24.15
Perl 0.22 156 34.32
PHP 0.36 224 80.64
JS 0.18 102 18.36
Java 0.1 331 33.1
Haskell 0.15 114 17.1
C# 0.095 389 36.955
C++ 0.08 461 36.88
C 0.1 458 45.8
There's nothing particularly wrong about it. Twitter does something like this with a bit of timing thrown in the mix, which is why some smart-asses have made self-referencing tweets:
https://www.spinellis.gr/blog/20090805/
I believe they also for a long time had a public API^.. and I'm pretty sure they soft-delete posts (bonus that they could revive the tweet down the track if it was a 'mistake'). I don't think the Twitter team are amateurs though.
Having monotonically increasing IDs for non-distributed systems removes the possibility of duplicate IDs. In distributed systems ID conflicts are unavoidable, and you might have less conflicts if you generate random IDs, as well as it becomes difficult for an attacker to guess IDs.
^ likely it would have been rate-limited, which isn't a problem if you've got a large pool of users you can authenticate with
Yes being able to store the FDs for pipes in variables is something that would make it more explicit and flexible. (It could also introduce deadlocks though)
Also, dgsh is along these lines: https://www.spinellis.gr/sw/dgsh/#compress-compare
It appears to use Unix domain sockets, not pipes.
I think I might want to use the Ruby-like blocks for syntax, something like
grep FOO *.py | wc -l | sort -n
pipeline {
pipe :p1 # variables that are pipes
pipe :p2
# this syntax isn't great but shows the idea
grep FOO *.py > &p1
< &p1 wc -l > &p2
< &p2 sort -n
}
-----
Although I think richer pipelines make sense, structured data will probably come first:
https://github.com/oilshell/oil/wiki/Structured-Data-in-Oil
I'd love to see textual preprocessors kinda banned. Or at least done upstream and outside of the language. You can't both be <the language> and also have a textual preprocessor defined internally. It doesn't work.
I really like what Zig and C++ are doing with `const`.
https://ikrima.dev/dev-notes/zig/zig-metaprogramming/
Have you looked at Spinal?
https://github.com/SpinalHDL/SpinalHDL
https://spinalhdl.github.io/SpinalDoc-RTD/master/index.html
edit, I see in your post history that your first submission was on Prosser's macro expansion. https://www.spinellis.gr/blog/20060626/cpp.algo.pdf :)
Great example. About a clever technique. And implementing it in the author's own code.
Check out Dr. Spinellis' Code Reading:
"Code reading requires its own set of skills, and the ability to determine which technique to use when is crucial. In this indispensable book, Diomidis Spinellis uses more than 600 real-world examples to show you how to identify good (and bad) code: how to read it, what to look for, and how to use this knowledge to improve your own code.
Fact: If you make a habit of reading good code, you will write better code yourself."
http://www.spinellis.gr/codereading/