Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
MrSaturn
Sep 8, 2004

Go ahead, laugh. They all laugh at first...
Ruby on Rails (aka Rails)


While I'm admittedly still an amateur web developer, I've been a professional programmer for years, and I've always dabbled in web development. I'm currently a senior at UConn, and I've been working on an independent study project with a professor to create a simple two tier web application (eventually for my own purposes; the project is catered to my interests).

I started out the project using javascript/ajax/php/css/sql, and got a simple semblance of a working webapp up after a month or so. Adding functionality was slow going, in part because I was new to php, and because I'm a bit clumsy with debugging web applications in general.

Well, I was reading some rogue post here in SH/SC, where some wise fella said something along the lines of "you'd never run into this problem if you were using rails, and it would have taken you 10x less time to get here". Well this prompted ol' mrsaturn to start reading.

Rails? What is rails?
Rails is really just a streamlined and simplified way to create web applications that are heavily database dependent. The syntax is simple, installation is a breeze, and it's got a decent learning curve. It can run on a windows machine or linux, as well as ol' Mac OSX.

With Rails,
  • You can have a working web applicaiton up in less than a half hour
  • You'll scarcely have to write a line of SQL code (I have yet to with my app)
  • Browser compliance is really not an issue. It just works.
  • You can easily use Ajax to spice up your pages!
  • Many plugins are available which can expand your built in rails functions.

Resources
  • http://www.rubyonrails.org/ - The home of Ruby On Rails. Find out how to install a rails server on your machine, and how to get started coding in rails!
  • http://www.ruby-lang.org/en/ - Rails is built on top of the ruby language. Ruby's elegant, simple, and powerful. Go here to learn about it's specific syntax. I suggest familiarizing yourself with Ruby, since some things won't look too apparent if you're a C#/Java programmer like I [was].

Applications that Use Rails
Here's some sample apps that use rails (I don't own any of these, they're just to show how drat cool it is)

Typo
is a web blogging service


Worth note
I'm currently working on integrating Hobo into my application. Hobo is an application builder for rails. It's basically the easiest way to get a user interface (log in/log out, etc) into your pages without having to think about it, and it works. The development team for hobo is very responsive, and helpful to my newbie woes. It's also got great ajax stuff built in, like the ability to edit fields in a record on the fly, if you're the right user. Check out their screencasts.

So yeah, I mean, I'm in love with rails. Use this thread for whatever you want - :fap: over it, ask for help, tout its abilities, or whatever you see fit. If y'all have working webapps that use rails, or want me to include them in the OP, let me know!

MrSaturn fucked around with this message at 19:11 on Aug 8, 2007

Adbot
ADBOT LOVES YOU

alpaca
Oct 5, 2003

Only the jazziest.
Hobo is located at https://www.hobocentral.net - might want to edit your link.

GOLDMAN SACHS PARTY
Sep 2, 2004

by Fistgrrl
Link should go to http://hobocentral.net/

Thanks for posting about Hobo -- I came into this thread for the sole reason of asking about an auth framework.

MrSaturn
Sep 8, 2004

Go ahead, laugh. They all laugh at first...
Fixed the link, thanks =)
Are there any experienced hobo users here? I'm currently filling up a thread in their dev forum because I can't get textile to work with it =/

ANAmal.net
Mar 2, 2002


100% digital native web developer
I'm really not a fan of Rails for the most part, but sticking to the thread topic, I will say that the logging (especially in development mode) is the most thorough I've ever seen. It's wordy as hell, but pretty much anything you would ever need is in there, provided you can grep your way to it.

Breakpoints and the Script Console are pretty neat, too. I like that they made RoR apps as easy to debug as they are to program in the first place.

Scarboy
Jan 31, 2001

Good Luck!

ANAmal.net posted:

I'm really not a fan of Rails for the most part, but sticking to the thread topic, I will say that the logging (especially in development mode) is the most thorough I've ever seen. It's wordy as hell, but pretty much anything you would ever need is in there, provided you can grep your way to it.

Breakpoints and the Script Console are pretty neat, too. I like that they made RoR apps as easy to debug as they are to program in the first place.

Agreed, I usually tail the development log all the time and it's incredibly useful. It really does show you everything.

peak debt
Mar 11, 2001
b& :(
Nap Ghost
In my opinion you can see a lot about languages from how they solve simple problems. So, for :science: how would the following PHP code look in RoR?

php:
<?
$result = mysql_query("select * from people order by lastname asc");
if (!$result)
    throw new Exception(mysql_error());

echo '<table>';
while ($row = mysql_fetch_array($result))
{
    echo '<tr>';
    echo '<td>', $row['lastname'], '</td>';
    echo '<td>', $row['firstname'], '</td>';
    echo '<td>', $row['age'], '</td>';
    echo '</tr>';
}
echo '</table>';
?>

bitprophet
Jul 22, 2004
Taco Defender

ANAmal.net posted:

Breakpoints and the Script Console are pretty neat, too. I like that they made RoR apps as easy to debug as they are to program in the first place.

I probably shouldn't even post in this thread, not having used Rails yet (started reading Ruby tutorials the other day, though, as my new job may have me doing some Rails work) but: how are the mentioned tools different from using e.g. Firebug or the Web Developer FF extension?

I'm a Django person, so if anyone who's well versed in RoR wants to have a discussion about the differences/similarities between the two frameworks or their approaches to problems, I'd be game.

(...and will I be the only RoR user who has a dislike for the David Hanssen style of "arrogance and overstatement is awesome" showmanship? :v:)

Zeorymer
Aug 29, 2003
#include
This is great, I was just beginning to get curious about Rails and then this thread pops up.

Please, rails developers, do your best to sell me on Rails and get me really into it! I'd really like to learn it but need the motivation!

floWenoL
Oct 23, 2002

RonaldMcDonald posted:

In my opinion you can see a lot about languages from how they solve simple problems. So, for :science: how would the following PHP code look in RoR?

php:
<?
$result = mysql_query("select * from people order by lastname asc");
if (!$result)
    throw new Exception(mysql_error());

echo '<table>';
while ($row = mysql_fetch_array($result))
{
    echo '<tr>';
    echo '<td>', $row['lastname'], '</td>';
    echo '<td>', $row['firstname'], '</td>';
    echo '<td>', $row['age'], '</td>';
    echo '</tr>';
}
echo '</table>';
?>

You'd have an HTML template file with all the HTML interspersed with <? ?> (I forget the exact delimiters) to print out variables (much like PHP, except logic isn't mixed with presentation). You wouldn't write any SQL at all; the table structure is determined automatically. Your controller class would basically have something like:

code:
people = Person.find_all(:order_by => :lastname)
(My syntax might be off, as I'm a little rusty as Rails)

and people would be visible from the template file. Someone with access to a rails install can probably type this up in more detail.

Edit:
Like this guy below.

floWenoL fucked around with this message at 00:07 on Aug 9, 2007

Novo
May 13, 2003

Stercorem pro cerebro habes
Soiled Meat

RonaldMcDonald posted:

how would the following PHP code look in RoR?

If I wanted a page that listed all people ordered by lastname, I could do this:

In app/controllers/person_controller.rb:

code:
class PersonController < ApplicationController
   def list
      @people = Person.find(:all, :order => 'lastname ASC')
   end
end
Here I am saying, "there is an action called list in the person controller, it finds all people ordered by lastname (ascending) and puts the collection in @people". In a real application you would put other actions for managing people here.

In app/models/person.rb:
code:
class Person < ActiveRecord::Base
   def age
      Time.now.year - birthdate.year
   end
end
Defining this data model assumes a table called "persons" (you can override this easily) and is what allows you to find people using Person.find in your controller (above). To make your example more interesting I've defined a simple method which will return the approximate age of the person. This assumes a persons.birthdate datetime column.

In app/views/person/list.rhtml:
code:
<table>
<% @people.each do |person| %>
 <tr>
   <td><%= person.lastname -%></td>
   <td><%= person.firstname -%></td>
   <td><%= person.age -%></td>
 </tr>
<% end %>
</table>
This view simply steps through each person in @people and renders the appropriate HTML. Notice that we are using the age method in our view. We are done. Going to http://myapp.com/person/list would render list.rhtml above. In a .rhtml template (or "view"), statements inside <% %> are evaluated, <%= %> is evaluated and echoed, and ending with -%> suppresses the final newline.

To highlight another convenience of Rails, if I have a site template, I simply put that in app/views/layouts/application.rhtml and it will wrap other views:
code:
<html>
 <head>
  <title>My Site</title>
 </head>
 <body>
  <!-- content gets inserted where you yield -->
  <%= yield -%>
 </body>
</html>
Simple.

Novo fucked around with this message at 00:18 on Aug 9, 2007

HIERARCHY OF WEEDZ
Aug 1, 2005

gently caress that HTML poo poo, Haml is where it's at.

quote:

The most basic element of Haml is a shorthand for creating HTML tags:

code:
  %tagname{ :attr1 => 'value1', :attr2 => 'value2' } Contents
No end-tag is needed; Haml handles that automatically. Adding class and id attributes is even easier. Haml uses the same syntax as the CSS that styles the document:

code:
  %tagname#id.class
In fact, when you‘re using the <div> tag, it becomes even easier. Because <div> is such a common element, a tag without a name defaults to a div. So

code:
  #foo Hello!
becomes

code:
  <div id='foo'>Hello!</div>

There's a shitload more, including this as prepending a document with the XHTML 1.1 Doctype:

code:
!!! 1.1

leedo
Nov 28, 2000

http://haml.hamptoncatlin.com/ posted:

Haml is a refreshing take that is meant to free us from the lovely templating languages we have gotten used to.
...and replace it with another lovely templating language :waycool:

HIERARCHY OF WEEDZ
Aug 1, 2005

leedo posted:

...and replace it with another lovely templating language :waycool:

Okay, outside, right now, let's go :colbert:

I'm seriously addicted to Haml and Sass. It's almost as fast as ERB, looks beautiful, saves me typing (except for element attributes, but that's trivial), and is easier to read. Sass is genius - variables in CSS should have existed from the beginning.

In any event, here are some other things I'm in love with:

http://glu.ttono.us/articles/2006/12/19/tormenting-your-tests-with-heckle - Heckle - This testing utility mutilates your code to see if it will still pass its tests. If it does, there may be something you're not testing completely. It breaks on some things (like any code that sends conditions to the DB), but otherwise is awesome to watch.

http://chneukirchen.org/blog/archive/2007/01/announcing-test-spec-0-3-a-bdd-interface-for-test-unit.html - test/spec
Beautiful, simple-language tests.
code:
	def test_validate
		assert_equal products(:version_control_book).price, @product.price
		@product.price = 0.00
		assert !@product.save
		assert_equal 1, @product.errors.count
		assert_equal "should be positive", @product.errors.on(:price)
	end
becomes

code:
	specify "should be logically valid" do
		@product.price.should.equal 29.95
		@product.price = 0.00
		@product.save.should.equal false
		@product.errors.count.should.equal 1
		@product.errors.on(:price).should.equal "should be positive"
	end
On top of that, specifications can be written in YAML and translated into Ruby code. See this post on Err the blog.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!
The Haml thing is a neat idea, but in practice doesn't everything just turn into div city? There's more than one tag in HTML for a reason.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!

shopvac4christ posted:

http://glu.ttono.us/articles/2006/12/19/tormenting-your-tests-with-heckle - Heckle - This testing utility mutilates your code to see if it will still pass its tests. If it does, there may be something you're not testing completely. It breaks on some things (like any code that sends conditions to the DB), but otherwise is awesome to watch.

What the gently caress? This seems like a lovely and backwards way of doing things. Is it impossible to do any sort of static analysis in Ruby to get actual coverage instead of changing poo poo and waiting for it to break?

Walrus791
Sep 4, 2002

Ugly, greasy retard.
I just started using Rails for a freelance web app I'm doing. I initially started the project in PHP and the time it was taking to get ANYTHING done in php was killing me, and I have a pretty good knowledge of the language. Its just the tediousness of having to tell your program EVERYTHING.

Rails is a bit better at the instant gratification that I need. The app I'm going to wind up with is going to have more features, a cleaner design, and an easier time getting new features later. I can't say I could have done that with straight PHP (dont know nothing about stuff like Cake though)

HIERARCHY OF WEEDZ
Aug 1, 2005

enki42 posted:

What the gently caress? This seems like a lovely and backwards way of doing things. Is it impossible to do any sort of static analysis in Ruby to get actual coverage instead of changing poo poo and waiting for it to break?

You mean code coverage? Like rcov?

And regarding Haml - you can use all HTML elements. Using semantically incorrect divs is the fault of the programmer.

Mrs. Wynand
Nov 23, 2002

DLT 4EVA

enki42 posted:

What the gently caress? This seems like a lovely and backwards way of doing things. Is it impossible to do any sort of static analysis in Ruby to get actual coverage instead of changing poo poo and waiting for it to break?


Yes, it is impossible. Ruby is dynamic front, side and back. Nothing can be done about this without making it into a new language altogether. Therein lies most of it's power, but it's also quite simply static-analysis-proof.

There are heuristic approaches that can analyze a few trivial cases statically, but nothing that is provably reliable.

epswing
Nov 4, 2003

Soiled Meat

RonaldMcDonald posted:

:words: take this php and write it in ruby on rails

Novo posted:

:words: no problem man

I just want to make a quick note here.

RonaldMcDonald's php code is less than 15 lines of simple, easy-to-follow php.
Novo's ruby/rails code is almost 30 lines spread across 4 files (and ends his post with "Simple." :v: ).

If you've never heard of MVC or haven't used any web frameworks before you may think that Novo is nuts. He's not. Although the ruby he posted is definitely more complicated structurally than the equivalent non-framework php, this is actually how anything larger than a very simple dynamic website should be done, with presentation (html) separate from logic (db access et al).


Edit: I know almost nothing about ruby or rails, but something that keeps me from diving in head first is...well, the concept of automated db access in general. Am I really going to let something write my sql for me? I really enjoy hammering out a nice query that does exactly what I need it to do, complete with inner/outer joins, unions, subselects, likes, ins, and whatever else is necessary with the appropriate indexes. For simple "select * from table where col=value" queries fine, do it for me, I won't mind. But for anything complex, can I take over? I know Hibernate allows me to take over when necessary. I don't yet trust the efficiency of a cruise controlled database.

epswing fucked around with this message at 02:42 on Aug 9, 2007

floWenoL
Oct 23, 2002

epswing posted:

Edit: I know almost nothing about ruby or rails, but something that keeps me from diving in head first is...well, the concept of automated db access in general. Am I really going to let something write my sql for me? I really enjoy hammering out a nice query that does exactly what I need it to do, complete with inner/outer joins, unions, subselects, likes, ins, and whatever else is necessary with the appropriate indexes. For simple "select * from table where col=value" queries fine, do it for me, I won't mind. But for anything complex, can I take over? I know Hibernate allows me to take over when necessary. I don't yet trust the efficiency of a cruise controlled database.

You can definitely write your own sql if you want to, and RoR doesn't stand in your way. You'd probably end up doing this for performance or non-portable stuff.

Mrs. Wynand
Nov 23, 2002

DLT 4EVA

epswing posted:


Edit: I know almost nothing about ruby or rails, but something that keeps me from diving in head first is...well, the concept of automated db access in general. Am I really going to let something write my sql for me? I really enjoy hammering out a nice query that does exactly what I need it to do, complete with inner/outer joins, unions, subselects, likes, ins, and whatever else is necessary with the appropriate indexes. For simple "select * from table where col=value" queries fine, do it for me, I won't mind. But for anything complex, can I take over? I know Hibernate allows me to take over when necessary. I don't yet trust the efficiency of a cruise controlled database.

Yes you can always use straight up SQL. There are actually several levels of 'low level' sql you can do - it works out very nice.

Common practice is to start out using just ActiveRecord and then optimize as needed. It works very well and you'd be surprised how little raw SQL exists in even high traffic sites. Usually adding an :include clause to a find is sufficient, and beyond that query optimization won't get you very far (or rather, that amount of work is better spent integrating memcached, which is pretty much THE way to scale no matter what language/framework you use)

Jamny
Jun 15, 2001

Flux Regulated

epswing posted:

I just want to make a quick note here.

RonaldMcDonald's php code is less than 15 lines of simple, easy-to-follow php.
Novo's ruby/rails code is almost 30 lines spread across 4 files (and ends his post with "Simple." :v: ).

If you've never heard of MVC or haven't used any web frameworks before you may think that Novo is nuts. He's not. Although the ruby he posted is definitely more complicated structurally than the equivalent non-framework php, this is actually how anything larger than a very simple dynamic website should be done, with presentation (html) separate from logic (db access et al).


Edit: I know almost nothing about ruby or rails, but something that keeps me from diving in head first is...well, the concept of automated db access in general. Am I really going to let something write my sql for me? I really enjoy hammering out a nice query that does exactly what I need it to do, complete with inner/outer joins, unions, subselects, likes, ins, and whatever else is necessary with the appropriate indexes. For simple "select * from table where col=value" queries fine, do it for me, I won't mind. But for anything complex, can I take over? I know Hibernate allows me to take over when necessary. I don't yet trust the efficiency of a cruise controlled database.

Yes, there is a Person.find_by_sql method, among other things you can do to tweak the underlying SQL queries.

In general you don't need to, as long as you use sensible indexes for the types of queries you know rails will be doing for you.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense

RonaldMcDonald posted:

In my opinion you can see a lot about languages from how they solve simple problems. So, for :science: how would the following PHP code look in RoR?

php:
<?
$result = mysql_query("select * from people order by lastname asc");
if (!$result)
    throw new Exception(mysql_error());

echo '<table>';
while ($row = mysql_fetch_array($result))
{
    echo '<tr>';
    echo '<td>', $row['lastname'], '</td>';
    echo '<td>', $row['firstname'], '</td>';
    echo '<td>', $row['age'], '</td>';
    echo '</tr>';
}
echo '</table>';
?>

You could do it like this but you're not supposed to:
code:
<% @people = Person.find(:all, :order => "lastname ASC") %>
<table>
<%= @people.collect {|i| "<tr><td>#{i.lastname}</td><td>#{i.firstname}</td><td>#{i.age}</td></tr>"} %>
</table>
If you did you would probably go to Ruby hell, especially if you showed anyone and they thought it was a good idea.

deimos
Nov 30, 2006

Forget it man this bat is whack, it's got poobrain!

epswing posted:

I just want to make a quick note here.

RonaldMcDonald's php code is less than 15 lines of simple, easy-to-follow php.
Novo's ruby/rails code is almost 30 lines spread across 4 files (and ends his post with "Simple." :v: ).


Yeah but RonaldMcDonald's code only does one thing. Novo's code is set up so that you can add another part for the page very easily.

Novo's code is:
- Readable
- Very extensible (much easier to implement pagination on Ruby than on PHP, for example)
- Lazy (select * from people, c'mon, every loving PHP person does this, EVERYONE, when they only need certain fields, it's fine when you have 10 records, but when you have 100k, not so fine.)

Not to mention Novo's code produces valid html. :colbert:

Another thing not shown is that Neither Novo's code nor RonaldMcDonald's do any database setup. In php you setup the connection, RoR takes care of that for you.

RoR saves in complexity when the application gets a bit... beefier. I would say that your average large RoR application is smaller than "grep -i 'select ' *.php" from your average smaller php application.

ElCondemn
Aug 7, 2005


RonaldMcDonald posted:

In my opinion you can see a lot about languages from how they solve simple problems. So, for :science: how would the following PHP code look in RoR?

php:
<?
$result = mysql_query("select * from people order by lastname asc");
if (!$result)
    throw new Exception(mysql_error());

echo '<table>';
while ($row = mysql_fetch_array($result))
{
    echo '<tr>';
    echo '<td>', $row['lastname'], '</td>';
    echo '<td>', $row['firstname'], '</td>';
    echo '<td>', $row['age'], '</td>';
    echo '</tr>';
}
echo '</table>';
?>

If you want to compare RoR with PHP you would need a framework of some sort, my own combination with adodb and smarty would be...

php:
<?
$db = new Query();
$result = $db->exec( 'SELECT * FROM people ORDER BY lastname ASC' );
$tpl->assign( 'result', $result );
$tpl->display( 'person.tpl' );
?>
with html template like...

code:
<table>
<% foreach key=$i var=$result %>
    <tr>
        <td><% $i.lastname %></td>
        <td><% $i.firstname %></td>
        <td><% $i.age %></td>
    </tr>
<% /foreach %>
</table>
Not exact syntax but something like that, I understand RoR is "easy" because it has the whole framework, but PHP with a framework is just as easy.

On that note, RoR is neat but it's not the solution everyone claims it is. I just don't understand the whole buzz around RoR and why it's so great.

epswing
Nov 4, 2003

Soiled Meat

deimos posted:

Yeah but RonaldMcDonald's code only does one thing. Novo's code is set up so that you can add another part for the page very easily.

I uh...maybe you didn't read my post.

TheFlyingDutchman
May 26, 2005
Skyway wanderer
Like a few people here, I am mainly a PHP programmer and as such just like handling things myself. However, hearing that you can write SQL code yourself in RoR is somewhat interesting to me.

On that note, is there any good books out there for RoR? Yes, there's the online documentation, but sometimes a book does a bit more for me. Anyone have any suggestions?

take boat
Jul 8, 2006
boat: TAKEN

legalcondom posted:

On that note, RoR is neat but it's not the solution everyone claims it is. I just don't understand the whole buzz around RoR and why it's so great.

Fewer dollar signs

TheFlyingDutchman posted:

On that note, is there any good books out there for RoR? Yes, there's the online documentation, but sometimes a book does a bit more for me. Anyone have any suggestions?

http://www.pragmaticprogrammer.com/title/rails/ is sort of the standard. I have it, but it was free for me. You might also consider the Programming Ruby book too.

floWenoL
Oct 23, 2002

legalcondom posted:

On that note, RoR is neat but it's not the solution everyone claims it is. I just don't understand the whole buzz around RoR and why it's so great.

Because Ruby is just a better language than PHP, and Rails meshes really well with the language. Notice how your PHP framework still requires you to write SQL, assign the result, and name the template manually.

The Journey Fraternity
Nov 25, 2003



I found this on the ground!

TheFlyingDutchman posted:

On that note, is there any good books out there for RoR? Yes, there's the online documentation, but sometimes a book does a bit more for me. Anyone have any suggestions?

The book on Rails is probably "Agile Web Development with Rails", by Dave Thomas. It touches on almost every aspect of the framework, but since the community likes to talk about how they'd rather "run on edge," parts of it get outdated rather quickly. You'll also find yourself reading the very sparsely documented API docs online rather often, but there's a project to spruce that up as well.

skidooer
Aug 6, 2001

Nolgthorn posted:

You could do it like this but you're not supposed to
Well, if we're going to throw MVC to the wind...
code:
class Person < ActiveRecord::Base
  Builder::XmlMarkup.new.table do |table|
    find(:all, :order => 'lastname').each do |person|
      table.tr do
        table.td person.firstname
        table.td person.lastname
        table.td person.age
      end
    end
  end
end
Also, the SVN RSS feed (http://dev.rubyonrails.org/log/?limit=100&mode=stop_on_copy&format=rss) is a beautiful thing for keeping up with what is changing. No Rails developer should be without it.

skidooer fucked around with this message at 05:59 on Aug 9, 2007

ElCondemn
Aug 7, 2005


floWenoL posted:

Because Ruby is just a better language than PHP, and Rails meshes really well with the language. Notice how your PHP framework still requires you to write SQL, assign the result, and name the template manually.

Actually I do have a query builder in my framework... that was just a basic example. I'd rather be in control of the queries though, I can imagine inexperienced Ruby developers are writing applications that will easily crumble under heavy load.

Not knowing how the framework builds these queries for you and helps you do everything is a sure fire way to write horrible code. From my understanding, a lot of the popular RoR apps override the built ins anyway. I didn't mean to make it a PHP vs. RoR argument, you say "Ruby is just a better language" without stating why. I just wanted to understand why so many people are on this bandwagon because I just can't seem to figure out why I should use this language. I've tried it out but anything that ruby does, perl does better, and the whole rails thing... PHP is more stable and not really a moving target like RoR.

edit: I can understand an argument about following proper code ethics, MVC and all of that...

floWenoL
Oct 23, 2002

legalcondom posted:

Actually I do have a query builder in my framework... that was just a basic example. I'd rather be in control of the queries though, I can imagine inexperienced Ruby developers are writing applications that will easily crumble under heavy load.

I can't see inexperienced PHP developers doing much better, frankly. In fact, you'd have the added bonus of all the security holes.

quote:

I didn't mean to make it a PHP vs. RoR argument, you say "Ruby is just a better language" without stating why. I just wanted to understand why so many people are on this bandwagon because I just can't seem to figure out why I should use this language. I've tried it out but anything that ruby does, perl does better, and the whole rails thing... PHP is more stable and not really a moving target like RoR.

First of all, you're confusing the framework (RoR) with the language itself. I've programmed Perl for years professionally and although it's not as bad as PHP, it has a lot of warts and gotchas. I'd like you to give me an example of something Ruby does that is done in Perl better. The only think I can think of is performance and just my own personal aesthetic sense. (I like how Perl looks better)

And, um, saying that PHP is "stable" is a polite way of saying it's stagnant, I guess. I don't think that's true, as I believe PHP is still being actively developed, but there's a large legacy PHP4 codebase, which definitely holds back the community. Not to mention debacles like this.

quote:

edit: I can understand an argument about following proper code ethics, MVC and all of that...

Ruby/RoR makes it easy. PHP does not. Simple as that.

floWenoL fucked around with this message at 06:21 on Aug 9, 2007

ohgodwhat
Aug 6, 2005

floWenoL posted:

Ruby/RoR makes it easy. PHP does not. Simple as that.

You keep comparing apples and oranges. Ruby is not an MVC framework, just like PHP. RoR, and PHP along with the several well developed frameworks like CakePHP, Symfony, and CodeIgniter make MVC development easy. Ruby itself does not make it easier, just like PHP itself does not.

floWenoL
Oct 23, 2002

ryanmfw posted:

You keep comparing apples and oranges. Ruby is not an MVC framework, just like PHP. RoR, and PHP along with the several well developed frameworks like CakePHP, Symfony, and CodeIgniter make MVC development easy. Ruby itself does not make it easier, just like PHP itself does not.

I knew I should have clarified that. Ruby makes "following proper code ethics" easy. Rails makes "MVC" easy. Why PHP sucks as a language has already been covered namy times. The multitude of competing MVC frameworks, in my opinion, does not make MVC easy in PHP as the PHP programmer has to evaluate multiple frameworks to figure out what he needs, and PHP makes jumping in and just coding very easy, which is not necessarily a good thing.

I don't think I compared apples and oranges in the rest of my post.

Taliesin
Aug 15, 2002

Shake it Baby!
What's that one blog about RoR where the guy is also a writer?

The Journey Fraternity
Nov 25, 2003



I found this on the ground!

Taliesin posted:

What's that one blog about RoR where the guy is also a writer?

why the lucky stiff, maybe?

crazysim
May 23, 2004
I AM SOOOOO GAY

The Journey Fraternity posted:

why the lucky stiff, maybe?

That guy makes crazy stuff like this and this but wow is his stuff brain mashing when he gets off the serious note.

Adbot
ADBOT LOVES YOU

peak debt
Mar 11, 2001
b& :(
Nap Ghost

crazysim posted:

That guy makes crazy stuff like this and this but wow is his stuff brain mashing when he gets off the serious note.

Running random eval()s from the Interweb is a good idea c/d?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply