Btw, this happened to me today, the transcript it not edited at all except for the code highlighting. And yes I am drinking beer at the moment but I'm not drunk enough yet...
It mostly happens in web world of scripting languages. You want something on your website, you want it for free, so you google it, copy&paste some code and you hope it works. Often, it needs some tweaking, so you play around with it, guessing how this whole programming thing works, moving stuff around at random etc. You can hardly blame a language for allowing people to do that... you just have to remember that there's some code out there not written by developers.
With all due respect, this can happen in any language, scripting or not. Bad code happens in all languages. Bad practices happens in all languages. I've seen some elegant Java and C and some pure stupidity. Same for Perl, Python and PHP. Bad programmers happen. Blame the programmer, not the tool or the language.
No it's not. You cannot just copy some crap in Java and see if it works, you need to compile it. You need tools, you have to know how to use them. This is a barrier that will stop random people from messing with it. In PHP on the other hand, site owner can look at the code and start messing with it as they often do. That makes those languages more vulnerable to people stupidity. You are talking about incompetent developers, that's a different story.
Again, with respect... the code looks like it'll compile. It's just a colossally stupid way to output HTML. You've NEVER seen someone in a non-scripty language do something akin to this? I call bull.
PHP is exposed to more people than just incompetent developers. Sure you can do stupid things in Java, but after you deliver the product, the owner won't start copying & pasting random pieces of code to improve it for free. There are many obstacles, like source code access, tools, language strictness. With PHP, a smart person without any programming skills can change stuff. No clue about code reuse? No problem, copy & paste to the rescue, that's how you get a code like this.
It's not about bad practises, it's about easy access to source code and how forgiving the language is. This is how PHP got most of it's bad rep, because it's being used be people without programming skills. And they do it because they can, something you cannot say about Java for example.
I wonder what are you trying to achieve by ridiculing PHP community in every possible thread. We can see you're a moron, you don't have to remind us on every occasion.
I actually am amazed that they pull these things off. This code is part of a massive application and at the moment it seems to be working OK if you believe our clients. However, as is painfully obvious, having someone else than the original coder to do something with this thing is practically impossible.
I also want to stress that this post is not something I have against the language per se. PHP is dominating and will continue to dominate the world of web dev for quite some time and there are many reasons for this domination.
Comments
prodevtips replied ago:
Btw, this happened to me today, the transcript it not edited at all except for the code highlighting. And yes I am drinking beer at the moment but I'm not drunk enough yet...
whiskeyjack replied ago:
Love it. It's inevitable that this will happen in every language at some point. I've seen some Perl and Python where some twit did the same thing.
antych replied ago:
It mostly happens in web world of scripting languages. You want something on your website, you want it for free, so you google it, copy&paste some code and you hope it works. Often, it needs some tweaking, so you play around with it, guessing how this whole programming thing works, moving stuff around at random etc. You can hardly blame a language for allowing people to do that... you just have to remember that there's some code out there not written by developers.
whiskeyjack replied ago:
With all due respect, this can happen in any language, scripting or not. Bad code happens in all languages. Bad practices happens in all languages. I've seen some elegant Java and C and some pure stupidity. Same for Perl, Python and PHP. Bad programmers happen. Blame the programmer, not the tool or the language.
antych replied ago:
No it's not. You cannot just copy some crap in Java and see if it works, you need to compile it. You need tools, you have to know how to use them. This is a barrier that will stop random people from messing with it. In PHP on the other hand, site owner can look at the code and start messing with it as they often do. That makes those languages more vulnerable to people stupidity. You are talking about incompetent developers, that's a different story.
whiskeyjack replied ago:
Again, with respect... the code looks like it'll compile. It's just a colossally stupid way to output HTML. You've NEVER seen someone in a non-scripty language do something akin to this? I call bull.
antych replied ago:
PHP is exposed to more people than just incompetent developers. Sure you can do stupid things in Java, but after you deliver the product, the owner won't start copying & pasting random pieces of code to improve it for free. There are many obstacles, like source code access, tools, language strictness. With PHP, a smart person without any programming skills can change stuff. No clue about code reuse? No problem, copy & paste to the rescue, that's how you get a code like this.
It's not about bad practises, it's about easy access to source code and how forgiving the language is. This is how PHP got most of it's bad rep, because it's being used be people without programming skills. And they do it because they can, something you cannot say about Java for example.
eelmore replied ago:
*shrug* Looks like every PHP code snipped I've ever seen posted online. They're all horrid.
antych replied ago:
I wonder what are you trying to achieve by ridiculing PHP community in every possible thread. We can see you're a moron, you don't have to remind us on every occasion.
Lars Pohlmann replied ago:
I have seen worse: my code 7 years ago ;-)
prodevtips replied ago:
I actually am amazed that they pull these things off. This code is part of a massive application and at the moment it seems to be working OK if you believe our clients. However, as is painfully obvious, having someone else than the original coder to do something with this thing is practically impossible.
I also want to stress that this post is not something I have against the language per se. PHP is dominating and will continue to dominate the world of web dev for quite some time and there are many reasons for this domination.
lifewithryan replied ago:
*phew*...for second there I was worried someone uncovered some of my code *wink*, then I read the article....OUCH
That being said, I've crapped out some pretty awful PHP 4 scripts in my time...ahhh never again....
Voters For This Link (13)
Voters Against This Link (5)