3 ms·
A novice programmer can write dangerously horrible code in C or C++ but we don't say those languages suck (most of the time). I'd rather debug/refactor a poorly
by vectorpush 14y ago
A novice programmer can write dangerously horrible code in C or C++ but we don't say those languages suck (most of the time). I'd rather debug/refactor a poorly engineered PHP project than a poorly engineered C or C++ application any day of the week.
- Locke1689 14y agoNo, pretty much everyone says that C++ sucks.
- Scriptor 14y agoC or C++ aren't competing with PHP. You'd have to look at Python or Ruby in this case. While it's definitely possible to write shitty code in those languages it doesn't provide nearly as many ways to screw up. Besides the lack of language features like @ (error silencing), you won't find nearly as many terrible tutorials out there created by some guy who's been learning for a few weeks and decided to write a blog post. Given a poorly engineered PHP or Python project, I will always pick the latter. However, if I were to start a project on my own I'm confident enough in my PHP that the language choice is harder to make.
- vectorpush 14y agoC or C++ aren't competing with PHP. That's true, but my point is that there isn't such a visceral hatred for C and C++ even though they are widespread and notorious for memory leaks, vulnerabilities, indecipherable corporate quagmires (perhaps due to an over-engineered OO architecture or 700 line functions or opaque symbol names or dependency hell, etc). Besides the lack of language features like @ (error silencing) Red-flag bad practices exist on all platforms. The horror story of a PHP project littered with error suppression is like opening up a C project and discovering that the control flow is guided by a 200 label GOTO architecture. It's not PHP's fault that the programmer abuses the language, it's the employer's fault for hiring a highschool student at $15/hr.
- 10098 14y ago> indecipherable corporate quagmires (perhaps due to an over-engineered OO architecture ...) Sounds like Java to me :-)
- nupark2 14y ago> That's true, but my point is that there isn't such a visceral hatred for C and C++ even though they are widespread and notorious for memory leaks, vulnerabilities, indecipherable corporate quagmires (perhaps due to an over-engineered OO architecture or 700 line functions or opaque symbol names or dependency hell, etc). C is enormously more consistent, better defined and specified, and well-documented than PHP. It's a solid enough language with a very specific use case, and not even remotely competing with PHP. PHP is a terribly inconsistent, poorly defined, poorly documented, poorly implemented, poorly designed language that can't do anything better than any of the other languages it is competing with. The one thing PHP has going for it is inertia. That's it.
- vectorpush 14y agoC is enormously more consistent, better defined and specified, and well-documented than PHP. Yes, this is a trite and negligible truth of PHP. A developer suffering any significant loss of productivity due to problems like mismatched needle/haystack parameters just isn't very competent. It's a non-issue if the developer is being paid a real salary. I'm not saying these issues aren't important enough to warrant attention, but the debate between maintaining backwards compatibility and squashing bad practices certainly isn't exclusive to PHP. and not even remotely competing with PHP. I already addressed this in my previous post. I'm not suggesting that PHP is in competition with C, that should be pretty obvious. I'm asserting that C, like PHP, is ridden with dangerous pitfalls for developers who don't know what they're doing. PHP is just easier to work with for a novice programmer. The one thing PHP has going for it is inertia And did that inertia spontaneously emerge from a vacuum? In the spirit of PHP's namesake you've devised a recursive argument to explain the only conceivable upside to using PHP.
- nupark2 14y ago
- cageface 14y agoThe difference is that in exchange for the difficulty of C/C++ you get low-level control and performance that no other language can consistently match. They are still the right tool for some jobs. You get nothing in exchange for the extra headaches of PHP.
- vectorpush 14y agoYou get nothing in exchange for the extra headaches of PHP. Of course you receive something in exchange. Whatever explanation you have for the ubiquity of PHP is the benefit one receives in exchange. Besides, my point is that headaches are not inherent to PHP. Just because a community of hobbyists and novices churn out shaky code doesn't mean that developers employing best practices will. https://github.com/symphonycms/symphony-2/tree/master/symphony/lib/core https://github.com/symphonycms/symphony-2/tree/master/sympho... Here is an example of quality PHP code. Clear and organized OO structure, useful comments, self documenting method and variable identifiers. Why is this inherently wrong?