3 ms·
Because of PHP. Let's assume you are going to write really clean PHP code, with excellent readability, thorough tests, appropriate abstractions, and proper enc
by LeifCarrotson 9y ago
Because of PHP.
Let's assume you are going to write really clean PHP code, with excellent readability, thorough tests, appropriate abstractions, and proper encapsulation.
Understand first that it will be unnecessarily difficult: PHP lacks a number of concepts and constructs that allow you to write better code, and does not really reciprocate with sensible trade-offs that make the loss of these features worthwhile. It makes bad code easy to write and hard to fix.
Then consider any third-party modules you might want to import. The standard libraries and modules in Python, Go, C# etc. are likely to be well-written, well-tested, and will fit into your clean-code project nicely. Sure, every language will have bad third-party code available, but PHP is especially likely to have cruddy tooling messing up any
Finally, assuming you work past all the pitfalls (while still avoiding over-engineering), your beautiful masterpiece will still be hampered by the fractal of bad design [1] which is PHP itself. Your comparisons may be literate, the variables clearly descriptive and in the proper positive tone, but you'll be asking if they're empty(), is_null(), and isset().
Why start with a handicap? Choose a better language if you want to write clean code.
[1] https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
- deleted 9y ago[deleted]