4 ms·
Really don't understand the pure hatred that people have for PHP, I'm at network engineer and I don't have any desire to become a programmer because I love my j
by iSloth 12y ago
Really don't understand the pure hatred that people have for PHP, I'm at network engineer and I don't have any desire to become a programmer because I love my job, however I've wrote some very useful applications that myself and my team use on a daily basis to make networking easier for us.
For me it was simple to learn PHP and create something 'useful', basically every web server is capable of running it which makes my life a lot easier as well.
Surely the fact that someone can hack together code within a few minuets that doesn't profess to be a coder is a good thing, regardless of the language that there using?
There is no better programming language than the one you know.
- SixSigma 12y agoI'm no mechanic and I have no desire to be one but I've changed my own brake pads, surely anyone can adjust their car's brakes and many other tasks with a few simple tools and a book. I don't understand why mechanics say some cars are better than others.
- Cyclone_ 12y agoI think that was the best comment on hacker news I have ever seen.
- gmu3 12y agoIn addition to being obnoxious I don't even think your analogy is correct. Programming languages are the tools, and it makes sense a non mechanic wouldn't understand why some tools are better than others.
- iSloth 12y agoPlaying around with motorbikes is actually one of my hobbies, and I have some very nice and quite expensive Snapon tools which work wonders in the garage. However I'm certainly not going to suggest that changing your breakpads was done incorrectly because my tools cost more than what I'm assuming yours did, or that I could complete the same job a bit quicker and therefore better. Sure, if you're going to change break pads all day long for the next year I can suggest some very nice tools which might help you. But instead I'd like to say well done on changing the break pads, I'd wish more people would use the tools that they have at there disposal, show some initiative, and do the same.
- cmdkeen 12y agoThis rant (not by me) explains why[1]. PHP is full of gotchas, things that make security hard, and areas that are likely to break and be really hard to debug. There's definitely scope out there for a better effort to be made addressing the situation you raise, but PHP really shouldn't be the popular language that is is in that space. [1]: http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
- xasos 12y agoSure it may be a fractal of bad design, but it's unfair to say it has no productivity value. You can write plenty good PHP code that actually accomplishes things. (And this is coming from someone that hates PHP)
- d23 12y agoI think you're setting up a strawman. The arguments against it are numerous, but I've never seen anyone say it has no productivity value.
- deleted 12y ago[deleted]
- frostmatthew 12y ago> but it's unfair to say it has no productivity value Nobody is saying it has no productivity value. Even the "joke" isn't saying that - the Y axis isn't labelled - it's just suggesting a) productivity doesn't increase, and b) you feel much more productive than you really are.
- sebastianavina 12y agoI used PHP 15 years ago for making my first web developments. The problem with PHP is that it's like everyone's bitch. You can do whatever you want with the language. It really allows you to abuse it, and has some of the naugthiest features a language can have. On those years, if you wanted to fire a simple script, to make a SQL Query on MySQL, extract some information and output a XLS file, you could choose between PHP, Perl, Java, C, C++, VB... So PHP was the only real option. Today we have Python, GoLang, (Ruby... bla bla bla), all of them have rich libraries and have great features too, but doesnt allow you to make a GoTo Statement (avoid Global Variables, and so on...), and well, are brilliant languages (Im talking to you Python) Sidenote, I still remember fighting a day long with a bug in my code just to discover it was actually a PHP Interpreter bug, and I still remember how much the Language changed around the year 2002 when they simply stopped to be compatible (they tried very hard to transform the language from a shitty one to a decent one), today is not a naughty language as the one I used, but still I see it both as an offensive language, and with gratitude because when I was 16 and had my HostWay webpage I had two choices for my webpage: PHP or Perl, and damn PHP really introduced me to the world of programming. TLDR; Just ranting.
- deleted 12y ago[deleted]
- Fistandantilus 12y agoIt's a bit of an in-joke at this point (but PHP could really be a better language).
- imanaccount247 12y agoPHP is full of problems that lead directly to security vulnerabilities if you aren't constantly aware of them and very careful when writing your code. So when someone who doesn't know those problems (most people) "hacks together" something that "just works", it is almost always providing a backdoor into that server. Once you do learn a little, you find that every scripting language is just as easy to work with as PHP (if not easier) and much safer. So why use PHP over perl or python or ruby or even javascript? They just aren't compiling into apache for no reason.
- zapt02 12y agoDoes Perl, Python or Ruby have built-in automatic escaping and sanitization? I would not call PHP less safe than any of these languages. On top of that all three of those languages require additional setup. (Especially Ruby with RoR shudder)
- d23 12y agoGenerally speaking, tutorials in those languages recommend using the paramatized versions of the queries rather than string concatenation and manual escaping. The official docs from these more well-designed languages would have copious warnings against attempting to escape user input yourself, rather than having numerous functions baked into the language to help you do just that (e.g. `mysql_escape_string`, `mysql_real_escape_string`).
- zapt02 12y agoThe official docs will tell you how to properly handle queries, including prepares: http://php.net/manual/en/pdo.prepared-statements.php http://php.net/manual/en/pdo.prepared-statements.php Additionally, the mysql_ extension is deprecated since PHP 5.5: http://php.net/manual/en/migration55.deprecated.php http://php.net/manual/en/migration55.deprecated.php The official docs on the old mysql_ extension has large warnings advising people not to use it: http://php.net/manual/en/function.mysql-connect.php http://php.net/manual/en/function.mysql-connect.php Reading a 10 year old tutorial on W3schools isn't the best place to learn current PHP, and it's not the fault of the language. PHP has moved on, if only the haters would too.