Live data from Hacker News

Ask HN: Why no love for PHP?

news.ycombinator.com

61–70 of 150 posts

Re: Ask HN: Why no love for PHP?

#61
post #45

Earlier quoted context omitted.

I agree with more or less with what you said but a downside of PHP is not security vulnerabilities, that's really just a myth. I can't remember the last vulnerability which could be directly attributed to PHP as a language. Sure, there are plenty of apps containing holes but those are not caused by PHP but by not coding correctly, eg not checking input making SQL injections possible etc. Which might confirm what you…

Languages are like tools: buying a the best set you can afford is the best possible start to a project. PHP doesn't cause SQL injection flaws, but it doesn't make it any easier. How many escape functions are there ? Shall we count them ? ---------- mysql_escape_string() - Escapes a string for use in a mysql_query mysql_real_escape_string() - Escapes special characters in a string for use in a SQL statement mysqli_rea…

I think this comment sums it up nicely: http://blog.ianbicking.org/php-ghetto-comment-11.html

It basically argues that in PHP there's often an easy, insecure way to do something and a verbose, secure way to do it. With regards to SQL injection, Java is the same way; prepared statements are much more verbose and annoying than string concatenation.

Re: Ask HN: Why no love for PHP?

#62

People who are really good at their jobs obsess about their tools- artists obsess over their paint, carpenters obsess over their power tools, cooks obsess over their knives. PHP is like buying a chef's knife at Wal-Mart. You can create a 5 star dish with it, it cuts perfectly fine, but it doesn't inspire the same passion that a Shun knife does. Most restaurants in fact, don't use fancy-knives, they use just regular k…

That's fine if you're starting a project or a business from scratch. Choose whatever tools make you happy. But if you work for someone else, chances are you will be stuck using the language they use. And if you are professional, you do it. And you still try to do a good job. Like Tiger Woods switching to Nike clubs.

Re: Ask HN: Why no love for PHP?

#63

People who are really good at their jobs obsess about their tools- artists obsess over their paint, carpenters obsess over their power tools, cooks obsess over their knives. PHP is like buying a chef's knife at Wal-Mart. You can create a 5 star dish with it, it cuts perfectly fine, but it doesn't inspire the same passion that a Shun knife does. Most restaurants in fact, don't use fancy-knives, they use just regular k…

I think your analogy is great. While I agree that "most" tools will accomplish the same goal or job (Walmart knife vs Shun). I don't agree that the tool determines passion or commitment. I'm a PHP developer (just started learning python!). I work full time for a big website that is coded in PHP. I have a startup that is written in PHP. If you had a conversation about PHP with me, I'm super passionate about what I have accomplished and will accomplish in the future. I think the real problem is that the passion pool gets diluted... Let me explain...

PHP has an extremely low barrier to entry. Its a loose language (lets not argue about this right now) that someone can get their feet wet relatively quick. These developers never really learn the true power of PHP, they aren't passionate about their projects and they dont contribute back to the community. They dilute the pool of truly passionate PHP developers.

Owning a Shun knife just lets everyone around you know that you are "serious" cook. But hell, I like to cook too.

Re: Ask HN: Why no love for PHP?

#64

People who are really good at their jobs obsess about their tools- artists obsess over their paint, carpenters obsess over their power tools, cooks obsess over their knives. PHP is like buying a chef's knife at Wal-Mart. You can create a 5 star dish with it, it cuts perfectly fine, but it doesn't inspire the same passion that a Shun knife does. Most restaurants in fact, don't use fancy-knives, they use just regular k…

It's not just the experience. Languages like Ruby and Lisp tend to be a lot more concise and have more functionality than PHP, so it's more like comparing a blunt knife to a razor sharp one. You can still cut with a blunt knife, but it takes longer and is harder work.

Re: Ask HN: Why no love for PHP?

#65

Earlier quoted context omitted.

That reads to me as "Rails is a pop culture icon that only XYZ people know about." I'm not XYZ because I don't know who that is. Actually, perhaps unintentionally, you still hit the nail on the head.

Glad to be your unintentional hammer. Dane Cook is a comedian who hit it BIG, in part, due to MySpace. He's been in a couple of movies, including "Employee of the Month." He's got millions of fans, but also a sizeable group of haters, inlcuding many of his fellow comedians. He's just another in a series of people or items that hit it big, leaving many of us wondering why.

Could it be that he's hated because he steals material?

Re: Ask HN: Why no love for PHP?

#66
post #62

People who are really good at their jobs obsess about their tools- artists obsess over their paint, carpenters obsess over their power tools, cooks obsess over their knives. PHP is like buying a chef's knife at Wal-Mart. You can create a 5 star dish with it, it cuts perfectly fine, but it doesn't inspire the same passion that a Shun knife does. Most restaurants in fact, don't use fancy-knives, they use just regular k…

That's fine if you're starting a project or a business from scratch. Choose whatever tools make you happy. But if you work for someone else, chances are you will be stuck using the language they use. And if you are professional, you do it. And you still try to do a good job. Like Tiger Woods switching to Nike clubs.

professional and passionate are not necessarily (and, for most people, not usually) the same things. you can use a php framework professionally and be passionate about rails.

Re: Ask HN: Why no love for PHP?

#67
I like to code in other languages more than PHP but for the startup, that's what we use.

We use PHP because at the end of the day startups are a job, and you've got to be creating value. I find that PHP gets the (web development) job done better than anything else.

Is programming in Ruby or Python more fun? Way more fun! But in the end, all that really matters is what happens when someone points their web browser to a URL. PHP was built for this use case and the whole LAMP stack solves this problem extremely well without needing any additional frameworks on top.

Also, as ugly and awkward as the C {}; syntax is, and as much as I hate not having certain features in PHP (i.e. chaining), I think there could be something special about that syntax that has understated benefits as evidenced by the sheer fact that the most widely used languages (C++,C,Java,PHP) all use it. Maybe it's just because that's what everybody knows and not because it's better. I'm not sure.

Re: Ask HN: Why no love for PHP?

#68

People who are really good at their jobs obsess about their tools- artists obsess over their paint, carpenters obsess over their power tools, cooks obsess over their knives. PHP is like buying a chef's knife at Wal-Mart. You can create a 5 star dish with it, it cuts perfectly fine, but it doesn't inspire the same passion that a Shun knife does. Most restaurants in fact, don't use fancy-knives, they use just regular k…

It's not just the experience. Languages like Ruby and Lisp tend to be a lot more concise and have more functionality than PHP, so it's more like comparing a blunt knife to a razor sharp one. You can still cut with a blunt knife, but it takes longer and is harder work.

I would argue that PHP and the LAMP stack have more functionality than any other language by an order of magnitude when you're talking about web development tasks. For anything else, PHP is pretty much irrelevant, but when you're doing web development, it's definitely the swiss army knife.

Without a single import or require, you can send emails, query a database, download a web page, handle session data, get post variables, etc.

You've also got file access, date and time functions, regular expressions, the list goes on.

What more functionality could you need for a web app?

Re: Ask HN: Why no love for PHP?

#69
post #46

If you can develop as quickly in PHP as you can with RoR, then you are not using RoR to it's full potential.

That is quite true. Even when using frameworks, PHP code is more verbose.

Also PHP has a proliferation of frameworks, so you may come across different frameworks in different projects reducing your efficieny. Since Django and RoR dominate in python and ruby respectively, the issue doesn't arise as much

Re: Ask HN: Why no love for PHP?

#70
post #49

Coming from a Java background into a startup that was built using PHP, it's been my experience that PHP is difficult to scale. This is for two reasons: 1) PHP isn't long-lived. Every time a request comes in Apache launches the PHP processor/interpreter and runs through the entire script. This means you don't get a heap that you can use to cache things[0], you don't get the benefit of JIT compilation, and you don't ge…

Install an opcode cache and you get the pre-compilation for free. Check out APC, x-cache, etc.

http://en.wikipedia.org/wiki/PHP_accelerator

Post reply on HN