The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Maybe... But they are not really losing out, as the free download will be all over the social networks now, so everyone who wasn't aware of either Sitepoint, or the book, will be now, so it's a gain in some respects.

Consider it free publicity is how I look at it, which isn't a bad thing, in the way Sitepoint have went about it. But would I have bought the book? No, as I don't do Ruby on Rails, more so than that Sitepoint's books don't have any influence or appeal

Well, not really. What is the definition of framework? I think PHP is a framework, in that it provides many things out of the box, exposed to the devloper. In PHP, you can do $_GET['id']. You can't do that with *Ruby*. But you can with Rails.

Without loading any extra extentions, you can even connect to a database with PHP mysql_connect(...). You can't do that with *Ruby*, but you can with Rails.

PHP peeps say, "PHP was designed for the web, RUBY was not!"

PHP peeps say, "Oh, and don't compare PHP to RAILS, because PHP is not a framework so it's not fair!"

I say, whatever. What's the point? Why are PHP peeps so defensive when it comes to Rails? Just have some fun and create some applications.

A framework is a set of cooperating classes that make up a reusable design for a specific class of software. A framework provides architectural guidance by partitioning the design into abstract classes and defining their responsibilities and collaborations. A developer customizes a framework to a particular application by subclassing and composing instances of framework classes.

... [a framework] dictates the architecture of your application. It will define the overall structure, its partitioning into classes and objects, the key responsibilities thereof, how the classes and objects collaborate, and the thread of control. A framework predefines these design parameters so that you, the application designer/implementer, can concentrate on the specifics of your application. The framework captures the design decisions that are common to its application domain. Frameworks thus emphasize design reuse over code reuse, though a framework will usually include concrete subclasses you can put to work immediately.

In other words, a framework provides inversion of control, giving you a high level structure and leaving you specific places to tailor the behavior. Unlike a library, which is just code you can call, a framework calls your code as well. This is what rails gives you, but not php.

Originally Posted by mwmitchell

I think PHP is a framework, in that it provides many things out of the box, exposed to the devloper.

PHP offers a lot of web related functionality, but you are left to handle the high level code, which is why it's not a framework.

I think the key element here is structure. PHP provides a ton of bundled libraries and functions out of the box, but no structure whatsoever. It leaves the entire handling of all the data to you, doesn't define any responsibilities of different pieces of your system, etc. This is what makes PHP NOT a framework, regardless of how much other stuff it comes with.

PHP is a framework, written in C (just as Rails is framework written in Ruby). You can write low-level code to extend the framework in C (just as you can do it in Rails, using Ruby), and you can write high-level code to utilize the framework in it's own syntax which is also called PHP (and in Rails, you do that using Ruby).

Did you read that page? It just links off to other pages, and the one on software frameworks says: "A software framework is a reusable design for a software system (or subsystem). This is expressed as a set of abstract classes and the way their instances collaborate for a specific type of software."

Lots of other languages offer the same things, the difference being that they're bundled as part of their standard libraries instead of directly built into the language.

Originally Posted by mwmitchell

I have yet to see a "framework" that handles the "high level" code for me! I'm still writing the "high level" code in Rails by the way.

I meant high level in terms of hierarchy of control. Rails sits higher in the hierarchy, and delegates control to the classes you write.

Originally Posted by BerislavLopac

PHP is a framework, written in C (just as Rails is framework written in Ruby). You can write low-level code to extend the framework in C (just as you can do it in Rails, using Ruby), and you can write high-level code to utilize the framework in it's own syntax which is also called PHP (and in Rails, you do that using Ruby).

By that logic, all programming languages are frameworks; you can easily replace the words PHP by Ruby, or Perl, and the paragraph is just as true. And even if I agreed with you (which I don't), it still wouldn't mean the you can directly compare PHP with Ruby on Rails.

PHP is a framework, written in C (just as Rails is framework written in Ruby). You can write low-level code to extend the framework in C (just as you can do it in Rails, using Ruby), and you can write high-level code to utilize the framework in it's own syntax which is also called PHP (and in Rails, you do that using Ruby).

I agree with those who say setting up Ruby on Rails is a real nightmare, I noticed this issue about a year or so ago when I tried it out - and I thought "Hang on, I thought this was supposed to make things easier, not harder" -- but having said that, there are some ideas that Rails does that I really like, and I like the agile nature of the framework, but unless it becomes easier to install, and manage I don't think I'll be touching it. Not just yet, anyhow.

In response to Rails being a "nightmare" to install... that's your opinion and also very relative. How easy does something neeed to be before it's a "nightmare"? Can you install PHP, Apache, Mod PHP any easier than you can Ruby, Gems and Rails? If it is that hard for you, maybe you should keep trying because it's always good to solve difficult problems. You'll probably find that it actually had nothing to do with Rails, but probably your system.

For people still wondering what frameworks are, they are like Hollywood agents. You don't call them, they call you. Rails and CakePHP are both frameworks: they call your controllers when they find a match in their routing files. PHP isn't a framework, although it is a Domain-Specific Language for web development.

Heh. The main reason I chose this username is there's no chance people will find me with a Google search, so I'm free to discuss my world-domination plans here. Of course, I love Ruby, and that played a big factor in my choice too.

Now, professionally speaking, I never switched from or to PHP. The language that puts bread on my table is Java. From that standpoint, I think Rails was the best thing that could ever happen to the PHP community. Thanks to it, people now have solid frameworks like CakePHP and Symfony, and even when they don't use them, they think about separation of concerns and other concepts that weren't receiving their due attention in the past.

On the other hand, I agree that the growth of Ruby as a web development is being hampered by the lack of a lightweight, "FTP it and forget it" deployment alternative. When you are used to having dedicated servers and wrestling with big Java servers, that doesn't look like a huge concern. But when you see it from the other side, the $10/mo hosting account, like I have in the past months in my hobby projects, that's huge. I don't think Rails will ever go in that direction, but I'm confident that another framework will show up at some point to fill that gap. It's just too obvious.