3 ms·
That'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 co
by chipotle_coyote 5y ago
That'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.