Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Why PHP sucks?

Hi, as you could guess I'm learning PHP, because I work with WordPress an WP it's built with php...

t...ill know don't understand why everybody says that PHP sucks...

I know a bit of jQuery and, of course html and css...

Why everybody hates the poor php and why is so popular, though?

thanks

10 Answers

I understand developers prefer to use Ruby with Rails instead of PHP because it's easier to build web services/apps

I think it really depends on what you intend to build with the code. A interesting thing to do is to search "php vs ruby on rails 2012" on Google, so that you get a lot of different, but recent views on the topic. Use http://builtwith.com to see what technologies make up a website. Wordpress is built from php, but so are many other popular CMS's that use php (like Drupal).

Deleted User

PHP's popularity probably comes from age and ease of use. Some developers hate php because it doesn't enforce any kind of real structure. This tends to lead to problems down the road. PHP is still a great and fun language but it's time seems to be slowly fading.

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

Hey Alejandro,

It sounds like PHP is the right language for you to be learning now, based on your background (HTML, CSS, and a bit of jQuery) and based on your current platform of choice (WordPress).

PHP is not very elegant, and it's poorly designed. But that doesn't really matter to most people. It's growth was not systematically planned, so it has grown pretty organically and haphazardly. There are a lot of inconsistencies that drive computer scientists crazy but that aren't really a big deal. Like Ben said, it doesn't really enforce any kind of structure; you are free to write beautiful or horrible code.

PHP is popular because it is easy to understand and deploy once you know HTML. It is native for the web: it was created to make dynamic web pages. If you want to make an HTML file dynamic, you just change its extension to .php and add a snippet of code. Easy. (If you want to do the same thing with Ruby, you need to open up the command line and install a framework and write a route. You'll need some special host that requires you to SSH from the command line into a server to figure out how to get Ruby and all the necessary gems running -- or to use a Git command. Not as easy.)

I totally agree with you. I like and use PHP, but I'm always reading blog posts by people saying things along the lines of, 'if you want to learn web development, learn Node.js or Ruby or Python'.

And then I always ask them 'what about PHP?'

I guess those people are just design-obsessed hipsters. PHP is so easy to use and that's why it's popular. It gets the job done.

I don't really buy into the age argument, because Ruby was introduced in the same year as PHP (although Rails is newer), and Python is four years older.

You should just ignore those who tell you PHP sucks. Those who hate PHP care more about the 'beauty' and design of their code than their actual websites. The serious, results-focused web developers all realize that PHP is the best language on the net.

What about .NET?

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

I think @Charles might be over-stating it a little when he says, "PHP is the best language on the net" ... but if you want to make web-stuff, then PHP is definitely the next logical step after HTML, CSS and jQuery. Jim Hoskins summed it up nicely in another post from last week.

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

I always have mixed feelings when talking about .NET.

  • On the one hand, it has some major strikes against it. It's not free to use, which means the cost to learn it is higher, the cost to use it is higher, and the number of freelancers and hackers using it is small. It's a proprietary platform, not open source. It's not easily compatible with other platforms, and you don't have a lot of open source advocates and hackers building integrations on top of it. Most of the innovation in the platform comes from Microsoft employees, not from the community as a whole. The company making it wants you to buy everything you need for your technology stack from them.
  • On the other hand, there are a lot of good .NET jobs out there. A lot of larger companies use it and get great benefits out of the products and the support Microsoft provides.

Here's an article I read almost a year ago about corporate culture, Microsoft, and startups: link. The introductory disclaimer is really insightful:

This post is intended for engineers who are looking to start their own company or join an early stage startup. Many of the critiques I suggest do not apply to engineers who enjoy the comfort of a larger company.

I think most aspiring developers would be incredibly happy writing .NET code in the comfort of a secure job at a larger company.

Thanks a lot, guys... you have given me some interesting opinions... I guess when you actually work in a daily basis with it, you have a clearly vision, and, if you are more practical you don't care a lot about some cleaver or more well design language when the one you are using work ok.

At least for me, while I'm learning it, still doesn't see anything horrible about it (on the other hand @Randy Hot, that explanation you gave me about Ruby really scared me).

I'm a fictional writer, and from my point of view, at list in writing... it doesn't matter a lot the tools you use or the schools you have been to a writer, but what you actually can do with the resources you have.

And, at least know, don't see how PHP can make me les creative...

And by the way, that secure and confortable job writing .NET sounds horrible... I rather prefer have some risks but create something by myself