4 ms·
You may be right on the main point, but I have a quarrel with one of your arguments. > Put that in a non-proportional font, and the asterisks on the first line
by munch117 5y ago
You may be right on the main point, but I have a quarrel with one of your arguments.
> Put that in a non-proportional font, and the asterisks on the first line probably won't line up with the rest.
So lose the redundant asterisks. They serve no purpose. They make the comment both harder to read and harder to write.
- chipotle_coyote 5y agoThat's a "DocBlock", in this case for PHP, although it comes from JavaDoc and I suspect there are some other languages using the same format. It's a standard convention that API documentation can be automatically generated from, and in many editors the comment block itself can be at least partially automatically generated. (e.g., in Visual Code, if I just type "/*" on a line before a function header and hit TAB, the editor's going to fill in a lot of those details.) At any rate, while you might be technically correct, in practice, "PHP and Java coders should abandon this long-held convention used by hundreds of thousands of programmers and decades' worth of tooling in order to avoid unsightly alignment issues when using proportional fonts in editors" may be a hard sell. :)
- GoblinSlayer 5y agoSacrificing legibility of code for a flawed tradition is a wrong tradeoff.
- ryanbrunner 5y agoLess a tradition and more of a standard. It's more or less complaining that the way HTML escapes < > is ugly so you're going to substitute your own variant. There's nothing technically stopping you, but if you want your code to be parseable by web browsers you unfortunately need to adhere to standards.