This is fun and interesting, but I don't think it says much about the various languages. Each of these languages can be formatted in a variety of styles.
As one example, Rust, and especially Servo, began with a recommended (or mandated) style with a heavy use of column alignment for things like function arguments. Like this code from rustfmt:
But the Rust example in the silhouette page doesn't follow this style at all. Instead, it uses a purely indentation-based style with little or no use of column alignment. From looking at the latest Rust coding style document, it seems that the Rust community may be moving away from this aligned style to an indented style. (Anyone who is more tuned into Rust style, feel free to set me straight.)
If the code above were written in an indented style it might look more like this:
Same language, same code, but a very different silhouette.
Similarly, the last time I looked at the Oculus SDK, its C++ and C# code used a column alignment style, and I think some other projects like OpenCV use column alignment too.
Many other C++ and C# projects eschew alignment in favor of indentation, though.
This kind of choice in styles is available in all the languages being compared. Yes, even in Python. The Python example uses column alignment here and there, but it would be just as "Pythonic" to use indentation in those places.
So I don't think this is really comparing programming languages, it's just taking a single example for each language, where other projects in the same language may have very different silhouettes.
As one example, Rust, and especially Servo, began with a recommended (or mandated) style with a heavy use of column alignment for things like function arguments. Like this code from rustfmt:
But the Rust example in the silhouette page doesn't follow this style at all. Instead, it uses a purely indentation-based style with little or no use of column alignment. From looking at the latest Rust coding style document, it seems that the Rust community may be moving away from this aligned style to an indented style. (Anyone who is more tuned into Rust style, feel free to set me straight.)If the code above were written in an indented style it might look more like this:
Same language, same code, but a very different silhouette.Similarly, the last time I looked at the Oculus SDK, its C++ and C# code used a column alignment style, and I think some other projects like OpenCV use column alignment too.
Many other C++ and C# projects eschew alignment in favor of indentation, though.
This kind of choice in styles is available in all the languages being compared. Yes, even in Python. The Python example uses column alignment here and there, but it would be just as "Pythonic" to use indentation in those places.
So I don't think this is really comparing programming languages, it's just taking a single example for each language, where other projects in the same language may have very different silhouettes.