4 ms·
PHP has already proven itself time and time again. There are lots of high-traffic websites running PHP successfully. Yes, it's easy to make a simple script an
by paulhauggis 15y ago
PHP has already proven itself time and time again. There are lots of high-traffic websites running PHP successfully. Yes, it's easy to make a simple script and get it running fast, but you can also engineer complex OO applications.
One of the reasons I've stayed away from things like rails is because it puts too many layers on top of things like the database.
I've known a few developers that use Django or Rails and have no idea how things work underneath. This is a disadvantage. Especially if you need to do something like optimize a database query and to do so, you have to actually change the framework that maps SQL to an object.
- andrewvc 15y agoI've known a few developers that use Django or Rails and have no idea how things work underneath. This is a disadvantage. Seriously, that's not even an argument, it's an anecdote of dubious validity. My personal experience as a rails developer has been that most of the people I've worked with know SQL quite well, and are fully capable of writing straight SQL when required. Really though, I'm only offering a counter-point. If you truly want to make the case that NOT_YOUR_FRAMEWORK_DEVELOPERS are ignorant, please prove it statistically or find a forum other than hacker news to flame on.
- paulhauggis 15y ago"Seriously, that's not even an argument, it's an anecdote of dubious validity." I don't have to prove anything. This is why I started it out with "I've know a few developers". "NOT_YOUR_FRAMEWORK_DEVELOPERS are ignorant, please prove it statistically or find a forum other than hacker news to flame on." You are one of the problems with hacker news right now. I was merely stating my opinion. Nowhere did I say "all developers". Just because my opinions is different than yours doesn't mean I am trolling or flaming. Also, when assembly went out of style and c became popular, less and less developers knew how things worked at a lower level. It makes sense that the same thing will happen with frameworks and libraries that are at a higher level.
- dasil003 15y agoOkay what is the point of your comment then? The thing you cite as a problem has nothing to do with any framework. It's just stating that ignorant developers are a problem. There could be a discussion about the distribution of ignorant developers but you claim not to want to get into that. So what were you trying to say?
- rhizome 15y agoHow to Disagree: http://www.paulgraham.com/disagree.html http://www.paulgraham.com/disagree.html
- murz 15y agoI've never really understood this argument. Yes, it's a disadvantage to "have no idea how things work underneath". But why can't you know how things work underneath and still use the abstraction layer? You can even log the SQL queries it generates, and drop down to custom SQL queries if necessary. If you're paying attention to what's going on "underneath", what is the problem with using abstractions that remove some boilerplate?
- paulhauggis 15y ago"You can even log the SQL queries it generates, and drop down to custom SQL queries if necessary. If you're paying attention to what's going on "underneath", what is the problem with using abstractions that remove some boilerplate?" In most of the frameworks I've seen, to do so means to hack around the base framework. It's also much faster to just write the correct query in the first place rather than logging every query from the framework and trying to change them for each situation that requires optimization.
- murz 15y ago> In most of the frameworks I've seen, to do so means to hack around the base framework. ActiveRecord [1][2] and Django [3][4] both feature logging sql and dropping down to custom sql out of the box, so I'm not sure which frameworks you had to hack around to accomplish that but those are the two examples you used in your OP. > It's also much faster to just write the correct query in the first place rather than logging every query from the framework and trying to change them for each situation that requires optimization. In my experience, 90% or more of the generated queries are fine, there's just a few that need rewriting. And it's not like it takes a lot of cognitive overhead to glance at a console to see what queries are being executed while you're testing that new feature you just added. For me, it's certainly less overhead than writing all of them myself. [1] http://weblog.jamisbuck.org/2007/1/8/watching-activerecord-do-it-s-thing http://weblog.jamisbuck.org/2007/1/8/watching-activerecord-d... [2] http://api.rubyonrails.org/classes/ActiveRecord/Base.html#method-c-find_by_sql http://api.rubyonrails.org/classes/ActiveRecord/Base.html#me... [3] https://docs.djangoproject.com/en/dev/topics/logging/#django-db-backends https://docs.djangoproject.com/en/dev/topics/logging/#django... [4] https://docs.djangoproject.com/en/dev/topics/db/sql/#django.db.models.Manager.raw https://docs.djangoproject.com/en/dev/topics/db/sql/#django....
- flomo 15y agoThe problem with your statement is the equivalent developer is extremely common in the PHP world. There's tons of people who hack on WordPress or Drupal and 'have no idea how things work underneath'. It's probably the majority of people with "PHP" on their resume.
- knieveltech 15y agoI call bullshit on your Drupal FUD. You can't code effectively for Drupal without a robust grasp on basic PHP, SQL and the Drupal suite of hooks. You better have some serious OO chops too or integration with stuff like Views is going to eat your face.
- flomo 15y agoYeah, but mainly because Drupal is a pile. CCK & custom forms seems about four times more complicated than just doing it in raw PHP. So that is not necessarily taking anything away from the intelligence of the developers, only pointing out they are coding against the abstraction, not the plumbing. Still I'd bet the majority of 'Drupal developers' are just folks who know what the right modules are & some customization tricks.
- knieveltech 15y ago"Still I'd bet the majority of 'Drupal developers' are just folks who know what the right modules are & some customization tricks." My anecdotal evidence based on five years of working with the CMS indicates you'd lose that bet, but whatever.
- jasonlotito 15y agoWoah. You're not arguing his point. He's saying there are people that hack at drupal without having a clue as to what's going on. He's not suggesting that is coding effectively at all. But that doesn't mean they aren't there, searching for specific strings, and spending 5 hours with trial and error before stumbling on a correct solution.
- blindhippo 15y ago
- rickmb 15y agoAnd I use PHP in the same way Django and Rails developers do: with frameworks, ORM's and other libraries that do put abstract layers on top of things like the database. PHP fully supports these use cases and everything in between. The same is true for Python and Ruby, but their web development ecosystem gravitates much more towards single solutions (Django, Rails). Yes, that means many Django or Rails developers have a hard time developing outside the box of their framework. However, on the PHP end you often see a lack of knowledge of the tools available and a strong tendency towards "not invented here". It all comes down to making informed choices. The language doesn't make that much of a difference. Every language allows you to optimize db-access to the point of writing raw SQL queries, and no framework can stop you from leveraging the raw power of the language.
- damncabbage 15y agoHowever, on the PHP end you often see a lack of knowledge of the tools available and a strong tendency towards "not invented here". You are dead on the mark with this one. I have hopped from place to place, and have needed to explain automated deployment, dependency injection, automated testing, schema management (eg. migrations), VCS branches... In most cases some of these would be covered by half-baked in-house "solutions", and others wouldn't even be dealt with at all. In other cases the current (knowledgeable) team would still be suffering from the sins made by developers past. I eventually gave up and moved to the Ruby world where most of this stuff is taken for granted. I don't mind PHP's quirks so much anymore; it's more the ecosystem that comes with it that infuriates me.
- Newgy 15y agoI think Symfony2 may solve this issue for PHP.