Slashdot Mirror


Rolling With Ruby On Rails

Bart Braem writes "The Ruby community is abuzz about Rails, a web application framework that makes database-backed apps dead simple. What's the fuss? Is it worth the hype? Curt Hibbs shows off Rails at ONLamp, building a simple application that even non-Rubyists can follow."

282 of 406 comments (clear)

  1. Interesting, but VB.NET is better by Anonymous Coward · · Score: 2, Funny

    Ruby doesn't have FlexGrid ocx which basically makes it useless for database apps.

    1. Re:Interesting, but VB.NET is better by MindStalker · · Score: 1

      Ok from my googling FlexGrid is a framework that automatically adjust data elements alignment/scrollbars/size etc to fit certain formatting.
      I've never used it so I have no idea how good it is, but I'm sure there are similar things, in other languages. But to say that a database app is useless without it is just plain silly.

    2. Re:Interesting, but VB.NET is better by MindStalker · · Score: 1

      Sadly I posted before the +1 funny mod. Guess I shoulda waited. :(

  2. Re:Ruby by belg4mit · · Score: 1

    Outside of the Ruby community itself it's probably best known within the Perl community, since Ruby is inspired by Perl.

    --
    Were that I say, pancakes?
  3. Re:Ruby by leonmergen · · Score: 1, Redundant

    What is ruby

    Yes yes, burn me +1 redundant... :-)

    --
    - Leon Mergen
    http://www.solatis.com
  4. Nice framework... by Anonymous Coward · · Score: 2, Interesting

    Looks good, nice to see some competition in the database backed web applications category for Java/PHP/Perl. However, I'm dubious about the claim that it's "ten times" faster than Java. It may be a bit faster, sure, but the amount of code doesn't look hugely less than what you might write to create a simple application using one of the many JSP/Servlet frameworks available.

    1. Re:Nice framework... by leonmergen · · Score: 2, Insightful

      Besides, if you do things The Right Way, when programming in OOP, the design takes a huge part of your time... and I don't really see how Java or Ruby differ in that...

      --
      - Leon Mergen
      http://www.solatis.com
    2. Re:Nice framework... by Anonymous Coward · · Score: 2, Insightful

      Wow, you obviously haven't used Rails. It *IS* much faster than Java. Hell, anything is much faster than Java.

      When you add something to Java (a new controller let's say), you have to configure it in a big XML file (with most if not all of the frameworks). Or a new template. Or a new model object. In rails you don't have to do any of that, it dynamically finds it! You literally *fly* in Rails (partly because of Rails, partly because of Ruby).

    3. Re:Nice framework... by tundog · · Score: 2, Insightful

      In rails you don't have to do any of that, it dynamically finds it!

      Thats a great concept as long as everything goes as planned. But wait until it 'dynamically finds' the wrong thing. Try debugging that nightmare. (Think VB Script + Option Explicit).

      --
      All your base are belong to us!
    4. Re:Nice framework... by Eric+Giguere · · Score: 1

      It's not that big a deal, really. I wrote a custom web application framework for an iAnywhere product that did exactly what Rails is doing, but in Java. Basically it mapped the path in a request to a set of classes. The mapping was determined at runtime through reflection. Worked well, you could do some neat stuff using inner/nested classes. The parent always got first crack at a request, so it could do filtering before the child was called and also of the child's results.

      The disadvantage of doing this stuff dynamically, of course, is that it takes more time to execute, so you have to do caching to simplify things.

      For the curious, the details of what I did are available online in the product documentation. Eric

    5. Re:Nice framework... by DevNull+Ogre · · Score: 2, Informative

      The "ten times" claim is about development time, not run time. You didn't take it a step further, you took an orthogonal leap.

    6. Re:Nice framework... by Paradox · · Score: 3, Interesting
      Sir, may I ask you exactly how you're going to get your Java framework of choice to connect, comprehend, and dynamically bind to a SQL table in only 2 lines of code? Because that's what you're going to have to do to beat Rails in code count. For instance, if we have a table called "Clients". It has lots of fields.

      If we want to link it to Rails, we'd use the following code:

      class Client < ActiveRecord::Base
      end
      Yeah. That's really it. And you can specify relations with a simple micro-language in the class declaration (that's based out of ruby syntax). Once you've done this, you can write code like this:
      my_client = Client.find( 26 ) # Find by primary key
      my_client2 = Client.find_by_manager_id( 12 ) # Find by some field

      # This code prints out each client's id and name
      Client.find_all.each do |c|
      puts "#{c.id}: #{c.name}
      end
      And Rails makes the action mappings just as simple. I'd eat my old shoes before I'd believe that there is some lurking JSP/Servlet framework that has evaded my sight (and everyone's sight, really) that can do better. I know Java's limitations pretty well.
      --
      Slashdot. It's Not For Common Sense
    7. Re:Nice framework... by njcoder · · Score: 1
      This is similar to Java DAO and to an extent EJB though EJB's have a lot more complexity due to being remotely accessible. You can wrap EJB's in a DAO framework.

      While DAO isn't dynamic, there are a good number of DAO generators that will build your classes and interfaces based on your database schema. Then your database access becomes pretty simple. You call up your daofactory to get the sepcific dao object then make the calls to it just as in your example.

      I wrote a dao generator for some projects that create a jdbc implementation for postgresql. It's been a big time saver.

      All this is, is a framework for accessing a database. There are similar frameworks for Java, like Hybernate. They are just not part of the Java spec.

      Good OO design really makes DB access simple. Most well written projects only have one class that actually has jdbc specific code. All other classes that handle the business logic will subclass or call this class.

    8. Re:Nice framework... by Jerf · · Score: 3, Insightful

      I'm actually a Python partisan (like the philosophy and user base better), but the same basic thing applies to Ruby too: If your first criterion for evaluating a tech like this is "Is it written in Java/C++/Visual Basic?" or whatever other legacy language you're thinking of, you've already lost.

      Learning Python or Ruby and using it will pay off in mere weeks vs. Java, C++, Visual Basic, and most other things like that. Pay off might be a month for C#, but only if you use C# like an expert to start with. (Also, if you use C++ like a mega-expert, but even then, to use it that way you lose with the staggering quantity of typing that takes... and I mean keypresses, not object typing!)

      Ruby and Python have done everything they can short of directly downloading themselves into your brain. You have to expect to exert some effort to reap the benefits. And like I said, it pays off in mere weeks, so opportunity-cost-wise, you lose big for delaying it.

      (Note "you" here may be your company, if you only program professionally. In that case, you personally may not have any choice, but the company is still losing big.)

    9. Re:Nice framework... by swimmar132 · · Score: 1

      Rails is not just a framework for accessing a database.

      There's also ActionPack (http://ap.rubyonrails.org/), which is the View and Controller of the MVC pattern (ActiveRecord being the Model part).

      The integration between the two frameworks is what makes Rails so impressive.

    10. Re:Nice framework... by Taladar · · Score: 1

      Lets just say the Java Developers (the ones developing Java, not with Java) didn't take the time to do OO in Java The Right Way (TM).

    11. Re:Nice framework... by Jerry · · Score: 2, Insightful
      Learning Python or Ruby and using it will pay off in mere weeks vs. Java,


      That is my experience, too.

      I attempted to build an inhouse app using Java and JDev against PostgreSQL. Where I needed to add functionality always ended up in a method which included the phrase "Generated DO NOT EDIT". I spent six months learning Java (including a class, which emphasized text editors for making gui objects. Gui by the blind ???) and attempting to build the inhouse app. I gave up in frustration.

      I decided to try Python and use Boa_Constructor against PostgreSQL. Ten weeks after I began I had learned both Python and Boa_Constructor, and had competed the app. It was 10X faster than the Java app against the same database, had all the features I had wanted to use, including reports, was easier to maintain, and MUCH easier to deploy.

      I liked the fact that ALL the files in your Python/Boa project are ASCII files and Subversion does an excellent job of version control on them. Also, the apps looks and feels the same on Linux as it does on Windows, and I had to change less than a dozen lines to make it so.

      --

      Running with Linux for over 20 years!

    12. Re:Nice framework... by Jerf · · Score: 1

      emphasized text editors for making gui objects. Gui by the blind ???

      Try again with Python sometime. It's actually a kick-ass idea and I've long since stopped using graphical GUI constructors, but trying to do it in Java would be a nightmare; I wouldn't want to do that and it was probably a bad idea to teach it there.

      The idea is that you generate your GUI from metadata of some kind (and you can almost always find some relevant metadata), and after you get good at it, while the graphical builders can still throw down a skeleton faster than you, you'll kill them in laying down a complete, usable GUI. Oh, and consistent, which they don't have a prayer of acheiving without super-human discipline or super-human management and quality control.

      And if you have a wide variety of similar, but not quite identical things to edit, where they build a form for each and you generate a GUI off of the object description itself somehow, you'll even kill them on that point.

      GUI builders have their place, but they are more like training wheels than swiss army knives.

      (The only slightly annoying thing in wx is the ID issue, since you're going to be generating a lot of widgets. I used an ID generator to give out guaranteed unique IDs, but ISTR they had a better solution in the later versions. Unfortunately, I have no idea what it was or what it was called, so I can't give you any other better hints.)

    13. Re:Nice framework... by wackysootroom · · Score: 1

      I've used Python/Boa for applications too. It simply rocks compared to Java/Swing.

      One question -
      What did you use for reports? I'm still stuck with Java (jasper reports) for reporting.

    14. Re:Nice framework... by JamesOfTheDesert · · Score: 3, Insightful
      Besides, if you do things The Right Way, when programming in OOP, the design takes a huge part of your time... and I don't really see how Java or Ruby differ in that...

      Um, yes and no. If your point is that there is a certain amount of abstract thinking required before you write any code, then yes, they will share a comon process. But, after coding in a language for a while, you tend to start thinking in the terms and abstractions the language facilitates.

      So, in perhaps the common case, Java designers will soon be thinking in terms of factories and adaptors and filters and all sort of entities that are often required in Java but which are extraneous in an agile language.

      And the time spent on those extranous objects is not time spent adressing the actual problem, but time wasted working around or through the demands of Java.

      --

      Java is the blue pill
      Choose the red pill
    15. Re:Nice framework... by MightyMartian · · Score: 2, Funny

      Hoo boy! He're we go. Another shot across the bow in the never ending OOP Wars of Religious Supremacy. Back away ten paces, ready your Smalltalk and C++ code and come out firing.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    16. Re:Nice framework... by JamesOfTheDesert · · Score: 1
      It's not that big a deal, really. I wrote a custom web application framework for an iAnywhere product that did exactly what Rails is doing, but in Java.

      Well, you're right in a way, it's not a big deal, as certainly one can do this in almost any language.

      It's just much harder do, and do right, in Java, on a repeatable basis, for any given development team (though Groovy may make this sort of thing simpler).

      --

      Java is the blue pill
      Choose the red pill
    17. Re:Nice framework... by killjoe · · Score: 1

      In a j2ee based environment you have to type maybe 100 times more code then ruby on rails. So the java guys have a lot of tools like ant and IDE plug ins to xdoclet to generate that code for them. Still the number lines you have write are maybe 20 to 50 times as much. I won't even count the number of tokens due to java being strictly typed.

      Still though you get more with j2ee. You get scalabitly, queques, fine grained transaction control, ability to publish your business logic as soap, corba or rmi objects, ability to divide up your code and run it on multiple containers etc.

      If you need any of that ruby on rails (or any other project using python, ruby, perl etc) falls flat.

      In ruby simple things are simple, complex things are not possible.

      In java simple things and are overly complicated and hard but complex things are possible if you want to endure relentless pain of dealing with the j2ee architecture.

      --
      evil is as evil does
    18. Re:Nice framework... by iabervon · · Score: 1
      Java's limitations mean that you need to write:
      my_client = Client.get().find(26);
      my_client2 = Client.get().find(Client.MANAGER, 12);

      for (ClientDetail c : Client.get().findAll())
      write(c);
      That is, a class can't inherit type-specific code in static methods, so you need a singleton. It's a pain, but only 5 lines per model type. Also, you can't autogenerate methods and have to use constants for fields. But this is an advantange, because you can then write:
      for (Client c : Client.get().getQuery().
      add(Client.MANAGER.by(Manager.NAME.
      orderBy())).
      add(Client.NAME.is(STARTS_WITH, "John")))
      write(c);
      (Which, obviously, prints out all of the clients whose name starts with "John", ordered by the name of their managers).

      I'm not fond of the way most of a Rails app is in the database schema, which is generally harder to version control effectively and has to be manipulated with a separate tool. I also don't think that the JSP-like view mechanism is all that good, because you're tied to making it a web app and you have to write a mixed-syntax file. That's probably why they're only getting a 10x development speed gain over J2EE, which is not really saying much given just how bad most frameworks are.
    19. Re:Nice framework... by ZedmanAuk · · Score: 1

      C/C++ programmers used to make this exact argument in favor of C/C++ over Java. Java has evolved to allow almost all of the complex things that C/C++ has. Ultimately Ruby will too.

      --
      -ZA
    20. Re:Nice framework... by jschottm · · Score: 1

      And you can specify relations with a simple micro-language in the class declaration (that's based out of ruby syntax).

      Could you point me toward where I can find documentation on handling normalization? Doing a site search with google on the documentation site turned up nothing.

    21. Re:Nice framework... by killjoe · · Score: 1

      I don't doubt it. The problem might be that in order to do all that your framework might have to be complex.

      --
      evil is as evil does
    22. Re:Nice framework... by hostyle · · Score: 1

      Nothing to see here. Dude, have a look at perl someday. All this sh!t has been done already. Why do people keep re-inventing the wheel? We don't need new languages or frameworks. We need programmers to act sensibly and use the right language/framework for the job at hand. Think outside the box. -- Watch the downmodding speed world record start right here

      --
      Caesar si viveret, ad remum dareris.
    23. Re:Nice framework... by batkins · · Score: 1

      Whoa, whoa. "Complex things are not possible" ? Ruby and Java are both Turing-complete. Exactly what complex things can Java do that Ruby can't?

      Your arguments are straight red herrings. SOAP, CORBA, and RMI are irrelevant for most web applications. Even if they weren't, Ruby has libraries for SOAP and CORBA. It also has DRb (Distributed Ruby), which is equivalent to RMI but easier to use.

      I call bullshit.

    24. Re:Nice framework... by killjoe · · Score: 1

      The ruby soap implementation does not support marshalling complex objects. Also in j2ee you get all that "for free" meaning when you write your bean it's trivial to publish it via soap. In ruby you'd have to do some work. Don't forget transactional isolation and built in queing too.

      Sure if you wanted to you might be able to cobble something together that works half as good as j2ee but it's still a cobbled together framework.

      It might be interesting to see if the ruby guys can put together something like that but they sure have not yet.

      --
      evil is as evil does
    25. Re:Nice framework... by davegaramond · · Score: 1

      By your argument, we don't need Perl, or C. Just use assembler and machine language.

    26. Re:Nice framework... by Lodragandraoidh · · Score: 1

      There is also the Zope framework - which has an embedded http server, ftp server, ZODB (zope object database), and has python embedded as the scripting language (so you are not limited to DTML/TAL for calculation intensive things in your display code - and you can build apps which are called externally to harness the power of the OS - or not if you want more control of what a user can do.

      The system has a built-in access control mechanism which is completely configurable by the user. All configurations are managed via a GUI interface via web browser (again with access controls - which also allow you to assign subsections of the site to certain people to administer, while blocking other sections from other admins/developers) - no command line configuration files - other than basic startup configs; everything else is in the database itself.

      Object database is very easy to use - and fast to search; build a datastructure in python, then apply it to the ZODB APIs to load it into the object database. That's it. The database/http server recognizes various file types - so you can upload and download binary datatypes and launch supporting applications (pdf, word, cvs etc..)automagically.

      The system also has database plugins that give you the capability to talk to traditional relational databases - but I only use that for legacy databases, I use the ZODB exclusively for my own deployments.

      Scalability is ensured via running Zope as a Zeo server (module to do this included - just a configuration change and restart to take effect) - Zeo allows multiple servers to syncronize their databases in realtime, as well as providing the ability for external applications to manipulate the database directly (for automation purposes). This allows you to do such things as put an SLB infront of a cluster of Zeo servers for High Availability; you could also use it to syncronize local servers (lets say you have an office in California, and another in Virginia - each team would access their local server for faster access - and less network traffic across your longhaul circuit - yet allowing changes to be almost immediately available to both sites).

      You can also run Apache/Squid infront of the Zope servers to provide better security and faster access for end users.

      There are a whole host of solutions that have already been built as python products and are easily installed/removed to/from an existing system. I am running plone - full featured CRM, zwiki - zope wikiwiki web, silva - XML authoring and publishing system, and the list goes on and on (this in addition to my own custom applications - all seamlessly integrated).

      The list goes on and on...

      I am sold on Zope - and am making it work on various projects in the real world. You might try stepping outside the old Java/relational database mode and give an object database a whirl - its pretty cool.

      (one of the things that most impresses me with the database is that its return time from complex searches has been flat from spin-up of the original to having gigabytes worth of data - 5 seconds or less in all cases. It is really amazing).

      --

      Lodragan Draoidh
      The more you explain it, the more I don't understand it. - Mark Twain
  5. Played with it by tenchiken · · Score: 4, Informative

    And did a quick application with Ruby on Rails already. If you are confortable with Perl, you may find this easier to deal with then Python and it's love of whitespace. The object model is much more developed then either python or perl, but it still retains much of the flexability of the other two systems.

    Ruby has already inspired a few efforts to duplicate the technology in Java and in .NET. Since the core technology behind RoR is open classes, and the ability to add accessors and functionality on the fly, the other languages just don't cut it.

    The usual warnings apply. Implicit code is easier 90% of the time, but that other 10% is painful to debug. With large projects you can prototype fast, but maintaining may be much more difficult.

    1. Re:Played with it by tigeba · · Score: 1

      "Ruby has already inspired a few efforts to duplicate the technology in Java and in .NET. Since the core technology behind RoR is open classes, and the ability to add accessors and functionality on the fly, the other languages just don't cut it."

      I can't speak about .NET, but the ability to add methods on the fly has been available in Java for quite some time, and the metadata features added in 1.5 enhance this by providing a language hook for tools that do this (as opposed to using XML config files). This is essentially how the popular and mature persistence framework Hibernate works (and the upcoming EJB 3.0 which is essentially Hibernate ).

      The examples seemed very simple and straightforward, but I didn't care for them putting the queries essentially on the pages, since I find that very tedious and error-prone in the long run. I would assume Rails would make it
      easy enough to have methods which do the queries for you and simply return collections to be used on the page.

      I see they have added support for a few more databases recently. Still no Oracle however :)

    2. Re:Played with it by swimmar132 · · Score: 1

      Oracle is coming very soon!

      What do you mean by "queries essentially on the pages"?

    3. Re:Played with it by rainman_bc · · Score: 2, Interesting

      Kind of off topic, but I still have a hard time wrapping my head around the idea of passing code blocks to functions... It's really a strange way of doing somethings IMO...

      Not that it's bad, it's just an interesting programming paradigm, and one that would take some getting used to.

      Rails seems like an interesting. Am I correct in think it's like mixing mod_ruby with an app framework?

      --
      09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
    4. Re:Played with it by Merk · · Score: 5, Informative

      Once you get used to the idea of passing blocks of code around, you'll love it, and won't be able to go back to Python... er... I mean, won't be able to go without it.

      The canonical example is the iterator. Given an array pets containing ["dog", "cat", "fish"]:

      pets.each { |pet| puts pet }

      Will return
      dog
      cat
      fish
      If you want to print out the uppercase versions

      pets.each { |pet| puts pet.upcase }

      Or if you want to add some text:

      pets.each { |pet| puts "I love my pet #{pet}" }

      Big deal, right? Not much different from a for loop. But blocks are amazing when dealing with things like a database. You can put all the setup, teardown and error-handling code in a method that's hidden from the user, and all they have to do is pass in the block they want the DB object to execute:

      require 'dbi'

      DBI.connect('DBI:Mysql:test', 'testuser', 'testpwd') do | dbh |

      puts "inserting..."
      sql = "insert into simple01 (SongName, SongLength_s) VALUES (?, ?)"
      dbh.prepare(sql) do | sth |
      1.upto(13) { |i| sth.execute("Song #{i}", "#{i*10}") }
      end

      puts "selecting..."
      dbh.select_all('select * from simple01') do | row |
      p row
      end

      puts "deleting..."
      dbh.do('delete from simple01 where internal_id > 10')

      end

      Unfortunately, slashdot eats my indentation, but fortunately, Ruby not being as picky about whitespace as *some languages*, that doesn't matter. Note that all that code is wrapped in a DBI.connect() call, which connects before it starts executing the block, and disconnects after. There's no "close" call required, it's all wrapped up for you.

    5. Re:Played with it by Jesus+2.0 · · Score: 1

      Believe me, you get used to it really quickly. It's great.

    6. Re:Played with it by rainman_bc · · Score: 1

      Thanks so much for that - like I said it's neat, but hard to wrap your head around... You've bade it a bit easier.

      I've been writing in VB for a long time, so the dot notation, and the lack of semicolons have made it a good candidate for the transition. That was the only thing that was driving me nuts...

      Hope you get modded up - that was probably one of the most informative Ruby posts I've seen.

      --
      09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
    7. Re:Played with it by RahoulB · · Score: 1

      all the best things about ruby (and java and object programming and AOP) all come from Smalltalk.

      So why not just use Smalltalk?

    8. Re:Played with it by tigeba · · Score: 1

      I did not grok the example properly, it looks like the finder(s) are safely tucked away behind the controller, which is good.

    9. Re:Played with it by Anonymous Coward · · Score: 1, Insightful
      Blocks are great for anything where you need to factor out code that goes around other code (Smalltalk and Lisp programmers are getting bored already, I know, I know).

      For instance:

      Automatically show a busy cursor in a readable, exception-handling-safe way:
      def busy_cursor
      begin
      busy_cursor_on
      yield
      ensure
      busy_cursor_off
      end
      end

      busy_cursor {
      do_something
      do_something_else
      foo_bar_baz
      }
    10. Re:Played with it by Taladar · · Score: 1

      Perhaps you might want to have a look at http://www.rubycentral.com/book/ which is a good ebook to learn Ruby.

    11. Re:Played with it by raxx7 · · Score: 2, Interesting

      # I don't know Ruby but I hope I understood your code correctly..

      import MySQLdb as mysql

      db = mysql.connect(db="test", user="testuser", passwd="testpasswd")

      cursor = db.cursor()

      print "inserting..."
      for i in range(1,13):
      songName = "Song #%d" % i
      songLenght_s = str(10 * i)
      cursor.execute('INSERT INTO simple01 (SongName, SongLength_s) VALUES (%(songName)s,%(songLength_s)s', vars())

      print "Selecting..."
      cursor.execute("SELECT * FROM simple01")
      for row in cursor:
      print row

      print "Deleting"
      cursor.execute("DELETE FROM simple01 WHERE internal_id > 10")

    12. Re:Played with it by Wolfkin · · Score: 1

      If there's an error in the code wrapped in the connect(), which isn't handled inside that code, is the connection still properly closed before the error is handled outside the connect()?

      --
      Property law should use #'EQ, not #'EQUAL.
    13. Re:Played with it by Merk · · Score: 1

      I'm not completely familliar with the DBI code, I haven't used it in a long time, but it's a really good example of how things should work. I imagine it's written something like:

      def connect(db_str, user, password)
      __begin
      ____dbh = parse_db_str_and_connect()
      ____yield dbh
      __rescue DBError
      ____$stderr.puts "D'OH!"
      __ensure
      ____dbh.disconnect
      __end
      end

      Hmm, slashdot won't do the indentation right, but that's what I'm aiming at. "ensure" is like "finally" in Java. It's always called, so in this case, it makes sure the dbh is always properly disconnected. The errors would probably be handled more cleanly than that, but I hope you get the idea. I found a site with more info on using the DBI that might answer your question better.

      Psst. Python people -- how do you get slashdot to properly indent your python code snippets?

    14. Re:Played with it by zapadoo · · Score: 1

      But Love of Whitespace (tm) is what makes Python terrific... ;-)

      Initially I was afraid of whitespace, and now I can't imagine a language that did not enforce its use. Whitespace makes code readable, and makes it possible for me to maintain other peoples code long after they have left with a minimum of head bashing against the desk.

      But enough about Whitespace, I wanted to comment on Rails - I had a good look at it - very cool stuff. However I'm not willing to switch languages and Python has very bool web-stuff too, so I don't need to.

      I have not used ASP or PHP in years now - have long since switched to Python and a lesser known but growing in community web framework called Quixote.

      See: http://www.mems-exchange.org/software/

      Quixote (and related framework helper Dulcinea, and object database Durus) make quick work out of data driven web applications, particularly if your thought process is more "Programmer developing web application" rather than "Web GUI developer needing to intergrate some data pieces". Highly recommended.

      Durus is a relation in some ways to Zope's ZODB, but infinitely simpler -- you can understand the unerpinings of Durus with a simple readthrough of the code.

      Check out the stuff even if you don't use Python - its very useful software that doesn't believe in magic. If you have the time to invest, Quixote, Dulcinea and Durus make a terrific combo that will give you all sorts of pre-done app components and get you going quickly, more than saving the up front learning curve time invested in the end.

      And if object db's aren't your think, nothing in Quixote prevents using Postgres or any common SQL DB with a tool like SQLObject (been there, done that). I come from a long background of SQL driven apps but now will question whether I need them and use an ODB like Durus where it makes sense. Its a real treat to be able to do this:

      class SomeThing(Persistent):
      ____ foo = None
      ____ children = {}
      ____ def add_child(self, child):
      ________ children[child.key] = child

      class Child(Persistent):
      ____ someotherstuff = foobar()

      ... And that's it -- regular python. No db code, everything is saved to the Durus object db, attribute changes etc - I don't have to think about it.

    15. Re:Played with it by the+quick+brown+fox · · Score: 1
      You can pass Ruby blocks to "lambda", which gets you most of the rest of the way there.

      def make_adder(k) lambda {|x| k+x}; end

    16. Re:Played with it by grumbel · · Score: 1

      Its nothing special really, its more or less just syntactic sugar for passing anonymous functions/function pointers around and that is something that you can do and do in quite a few other languages too (Scheme[lambda], Lisp, C++ [STL], Python, ... and even C [qsort]). Ruby just does it in a less typing intensive way, but the basic idea is not so much different then what you do in other languages.

    17. Re:Played with it by zapadoo · · Score: 1

      I dont find ruby any more clear to read than python.

      Ruby:pets.each { |pet| puts pet }

      Given an array (list) pets in python pets = ['dog','cat',[snake'], the python equiv:

      for p in pets: p
      'dog'
      'cat'
      'snake'

      Upper case:
      Ruby: pets.each { |pet| puts pet.upcase }

      Python:
      for p in pets: p.upper()
      'DOG'
      'CAT'
      'SNAKE'

      SQL Example? I prefer higher level abstractions than "row" but you can do that too, with examples similar to what you've given but more readable in my opinion (due to python, not me).

      Better yet is a higher level abstraction like SQLObject (ignore the ____ whitespace pretender...)

      class (SQLObject):
      ____ _table = 'person'
      ____ firstName = StringCol(length=255)
      ____ lastName = StringCol(length=255)
      ____ ... etc

      ____ def format_name (self):
      ____ return '%s %s' % (self.firstName, self.lastName)

      Don't have your schema setup? No problem, just call

      Person.createTable()

      Have an existing schema? No problem don't define any data attributes and tell SQLObject to create them for you.

      All very cool...

      Or, move to an object database like Durus or ZODB and skip SQL altogether, where possible.... I posted a note in this thread elsewhere.

    18. Re:Played with it by ashot · · Score: 1
      python has list comprehensions (sort of stolen from haskell..) which are much more intuitive than the Ruby syntax:
      >>> pets = ["dog", "cat", "fish"]

      >>> [x.upper() for x in pets]
      ["DOG", "CAT", "FISH"]

      >>> [x.upper() for x in pets if len(x) < 4]
      ["DOG", "CAT"]
      --
      -ashot
    19. Re:Played with it by Merk · · Score: 1

      Intuitive to you maybe. I prefer the OO syntax.

      irb(main):001:0> pets = ["dog", "cat", "fish"]
      => ["dog", "cat", "fish"]
      irb(main):002:0> pets.each { |pet| puts pet.upcase }
      DOG
      CAT
      FISH
      => ["dog", "cat", "fish"]
      irb(main):003:0> pets.each { |pet| if pet.length < 4 then puts pet.upcase end }
      DOG
      CAT
      => ["dog", "cat", "fish"]
      irb(main):004:0> pets.each { |pet| puts pet.upcase if pet.length < 4 }
      DOG
      CAT
      => ["dog", "cat", "fish"]
      irb(main):005:0> pets.sort.grep(/^...$/).collect {|pet| pet.upcase }.each {|pet| puts pet }
      CAT
      DOG
      => ["CAT", "DOG"]

      But anyhow, the point wasn't whether Rython's list comprehensions or Ruby's block-based iterators were better, it was that Ruby blocks allow you to do pre and post block operations, like opening and shutting a DB connection.

    20. Re:Played with it by ashot · · Score: 1

      I don't see whats so great about that. You could just "for in" through a list comprehension and do the same thing..

      --
      -ashot
    21. Re:Played with it by MenTaLguY · · Score: 1

      Blocks are more general a facility than list comprehensions. Basically, blocks are basically a syntactically sugary lambda, with some very convenient argument-passing aspects.

      --

      DNA just wants to be free...
    22. Re:Played with it by Superfluid+Blob · · Score: 1

      Read Martin Fowler on closures - it's a very good introduction to the topic, and uses Ruby as the example language.

    23. Re:Played with it by Superfluid+Blob · · Score: 1
      Think of Ruby as Smalltalk with a Unix accent.

      This is a useful thread about the differences between the two languages. This is probably the best post I've seen on the topic, from someone who's used both languages intensively.

    24. Re:Played with it by duncangough · · Score: 1

      What's the difference between that and list comprehension?

      And why is it so good if it reduces the readability of your code?

      I was with you up 'till:

      pets.each { |pet| puts pet.upcase }

      Lightning Pool

    25. Re:Played with it by some+guy+I+know · · Score: 1
      Unfortunately, slashdot eats my indentation
      Use <ecode> tags and spaces for indentation.
      For example,
      <ec ode>DBI.connect('DBI:Mysql:test', 'testuser', 'testpwd') do | dbh |

      puts "inserting..."
      ...</ec ode>
      (with "ec ode" replaced by "ecode") produces
      DBI.connect('DBI:Mysql:test', 'testuser', 'testpwd') do | dbh |

      puts "inserting..."
      ...
      --
      Those who sacrifice security to condemn liberty deserve to repeat history or something. - Benjamin Santayana
  6. why onLAMP? by geoffspear · · Score: 1

    Look all of you LAMP users... You can do the same thing using Ruby that you can do with whichever P in LAMP you prefer (PHP, Perl, or Python)! Can we change our name to onLAM{P,R} now?

    --
    Don't blame me; I'm never given mod points.
    1. Re:why onLAMP? by Anonymous Coward · · Score: 1, Funny

      Can we change our name to onLAM{P,R} now?

      How about LAM3R?

    2. Re:why onLAMP? by cmallinson · · Score: 1

      People obviously will not use Ruby, as they would then have LAMR app.

    3. Re:why onLAMP? by chromatic · · Score: 1

      R is just a P with a moustache.

    4. Re:why onLAMP? by KutuluWare · · Score: 1

      Sure, because everyone in the tech industry is just dying to say "Personally, I'm a LAMR".

      --K

    5. Re:why onLAMP? by dfetter · · Score: 1

      Among the better-clued, LAMP stands for Linux, Apache, Middleware, PostgreSQL :)

      --
      What part of "A well regulated militia" do you not understand?
    6. Re:why onLAMP? by kilimangaro · · Score: 1
      You can do the same thing using Ruby that you can do with whichever P in LAMP
      Wow i can do the same thing !
      So why should i switch to Ruby from my well documented, stable, available, safe and greatly supported favorite P ?
      --
      "Insanity in individuals is something rare, but in groups, parties, nations, and epochs it is the rule." - Nietzsche
    7. Re:why onLAMP? by Taladar · · Score: 1

      The could just use PostgreSQL and Ruby and have a LARP app.

    8. Re:why onLAMP? by Thuktun · · Score: 1

      You can do the same thing using Ruby that you can do with whichever P in LAMP you prefer (PHP, Perl, or Python)! Can we change our name to onLAM{P,R} now?

      PHP: [making introductions] Ruby, Perl. Ruby, Python.
      PYTHON: Does your name not start with 'P'?
      RUBY: No, an 'R'.
      PYTHON: That's going to cause a bit of confusion. Mind if we add a 'P', just to keep it clear?

      (Apologies to Python. No, the other one.)

    9. Re:why onLAMP? by IpalindromeI · · Score: 1
      --

      --
      Promoting critical thinking since 1994.
  7. REST Web Services w/Client-side XForms by Baldrson · · Score: 1, Insightful

    Rails is a big deal from the stand point of a world where Java frameworks are considered state of the art. However, the big breakthrough with Rails will come when a Rails-based REST web services generator presents the database schema to a client-side ECMAScript XForms/templating solution.

    1. Re:REST Web Services w/Client-side XForms by ahem · · Score: 1, Funny

      You know, the parent probably isn't a troll, but it sure reads like one to me. I guess I'm just too far away from the state of the art over here. I've lost my buzzword compliance.

      --
      Not A Sig
  8. Seems kind of windows-oriented by paroneayea · · Score: 1

    I don't mean this as a "let's bash Windows" kind of argument. It is just that, if you aren't running Windows, you'll have to make a lot of adjustments in reading this article. Just a heads up. If you are using Windows though, looks like this could be very useful. If not, it could probably still be of use anyway.

    --
    http://mediagoblin.org/
    1. Re:Seems kind of windows-oriented by happyemoticon · · Score: 1

      I think they're just using the windows stuff as a sales pitch to Windows people. It says, "In most frameworks, this part of the application can grow pretty messy, tedious, verbose, and error-prone. Rails makes it dead simple!" That's marketing language. The toughest job is convincing non-technical managers. They will often look at something without a simple GUI installer like something from the dark ages. To them, presentation conveys product maturity and professionalism.

      Let them chew on RoR on their WinXP boxes, while the real work gets done on servers. As far as making "adjustments," I don't want to be a gentoo snob, but all I did was emerge ruby && emerge mysql. And just to throw my hat into the LAMP debate, I am not a professional web programmer, but I find php's cobbledtogetherness and inConSisTent function_names quite aggravating and weird, and I'm sure aforementioned bosses do too.

    2. Re:Seems kind of windows-oriented by B3ryllium · · Score: 1

      Inconsitency is the fault of the developer, not the language. Anyone with sufficient discipline in the programming dark arts can persevere no matter how cobbled-together the language is.

      (I say this as a PHP developer, and in particular, one who always ends up using inconsistent function names :))

    3. Re:Seems kind of windows-oriented by happyemoticon · · Score: 1

      PHP is pretty cool, I'll have to admit. I'm not trying to start a war. I use it. I do OK as long as I have a nice thick reference manual next to me, but I'd rather not have to look up quite so many functions. These words you speak of, "discipline" and "persevere[nce]," aren't really in my forte. It's the same reason I don't like Java very much: accomplishing a simple task (oh, I don't know, like BufferedReader= new BufferedReader(new FileReader(new File(name))) vs open(FILE, "$filename";) requires you to spend five minutes with the manual if you don't know it off the top of your head.

      Maybe this is just one of those learning curve things which is totally transparent once you become a coding god, or maybe you've just learned to live with the pain.

    4. Re:Seems kind of windows-oriented by JLyle · · Score: 1
      It is just that, if you aren't running Windows, you'll have to make a lot of adjustments in reading this article. Just a heads up.
      You're of course correct that a lot of the information in this tutorial is presented from a Windows user's point of view. For me, this was a nice difference since most of the other documentation you'll find (including the copious amounts at the Ruby on Rails home page) is decidedly Unix-centric. (Or Mac OS X-centric, to be more correct.)
    5. Re:Seems kind of windows-oriented by the+quick+brown+fox · · Score: 1

      The creator of Rails uses Mac OS X.

    6. Re:Seems kind of windows-oriented by Lordrashmi · · Score: 1

      If you don't want to remeber function names or exact order of arguments get an IDE that will auto(suggest|complete) for you.

  9. Useful Ruby Online Resources (categorized) by Anonymous Coward · · Score: 5, Informative

    A categorized collection of ruby links can be found here in a nicer format:

    http://www.rubygarden.org/ruby?RubyOnTheNet

    Interactive ruby resources:

    irc://irc.freenode.net/ruby-lang - the #ruby-lang channel is popular. More info at RubyOnIRC

    http://www.ruby-forum.org/bb/ - a forum for ruby novices to ask questions

    news://comp.lang.ruby - the ruby newsgroup

    Ruby websites:

    http://www.ruby-lang.org/ - ruby home

    http://www.ruby-doc.org/ - ruby docs and online reference

    http://www.rubyforge.org/ - rubyforge ruby projects

    http://raa.ruby-lang.org/ - ruby application archive

    Ruby Code Examples and Snippets:

    http://pleac.sourceforge.net/pleac_ruby/ - ruby pleac

    http://www.rubygarden.org/ruby?RubyOnlineCookboo k - ruby cookbook

    Popular ruby and ruby-related projects:

    http://rubyinstaller.rubyforge.org/wiki/wiki.pl - ruby installer for Windows

    http://rubyforge.org/projects/rubygems/ - rubygems ruby package manager

    http://www.yaml.org/ - ruby 1.8 includes built-in yaml support

    http://www.rubyonrails.com/ - web framework in ruby

    http://rubyforge.org/projects/instiki/ - wiki in ruby

    1. Re:Useful Ruby Online Resources (categorized) by geoffspear · · Score: 2, Funny

      Thanks. That should help if google gets slashdotted and we can't find information on our own.

      --
      Don't blame me; I'm never given mod points.
    2. Re:Useful Ruby Online Resources (categorized) by teebo · · Score: 1

      Why's (Poignant) Guide to Ruby

      http://poignantguide.net/

    3. Re:Useful Ruby Online Resources (categorized) by nkh · · Score: 1

      And don't forget Hobix, a blogging software written by the same guy. You can install it with a one-liner: ruby -ropen-uri -e 'eval(open("http://go.hobix.com/").read)'

    4. Re:Useful Ruby Online Resources (categorized) by Merk · · Score: 1

      And while you're mentioning _why_'s stuff, there's also the RedHanded Ruby blog:

      http://redhanded.hobix.com/

  10. Code, Snort, Code, Snort by MrAsstastic · · Score: 3, Funny

    Back where I am from, using rails all night to code a project can land you in trouble with the law, drain you financially and mentally, and leave you with a nosebleed. Best stay away from this nonsense.

  11. Ruby still needs ISP support by Anonymous Coward · · Score: 5, Interesting
    The biggest drawback to RubyOnRails is that you wont find it installed on very many webhosts.

    I given it a testdrive, and RubyOnRails is an amazingly fast and powerful way to develop webapps, but even so, it's been around for a while and still 99% of webhosts only stick to tomcat & PHP/MySQL, so that's what I code for. Even Python w/o Rails has more ISP support.

    My question is: When will RubyOnRails get "popular enough" to make inroads? I'm looking forward to it, because it means I can be way more productive and get a head start on all the other PHP "solution providers" out there.

    1. Re:Ruby still needs ISP support by Aredridel · · Score: 2, Informative

      http://theinternetco.net/offers/ruby

      Ready, installed, and waiting.

    2. Re:Ruby still needs ISP support by JackRuby43 · · Score: 2, Informative

      so does Modwest (a great host and supporter of Open Source)

      http://www.modwest.com/

    3. Re:Ruby still needs ISP support by rollerbob · · Score: 1

      The hosting service Textdrive has support for Rails and I'm sure many more will pop up.

    4. Re:Ruby still needs ISP support by swimmar132 · · Score: 2, Informative

      And, if you get hosting at TextDrive, they'll give half of your money to supporting RubyonRails development!

    5. Re:Ruby still needs ISP support by JimRay · · Score: 3, Informative

      You might try TextDrive

      Fantastic tech support, lots of support for opensource projects, a full ruby on rails implementation. These cats kick ass.

      Lurk on the forums for a day or so to get a feel for things, it's not a bad place to call ~/

      --
      My other computer is your Windows box
    6. Re:Ruby still needs ISP support by egoots · · Score: 1

      I cant quite tell if the parent is joking or not, but...

      The current release of Ruby is 1.8.2. This (and mod_ruby or fastcgi) is the relevant part from an ISP host perspective.

      The current release of the Ruby on Rails framework is 0.9.4.1

    7. Re:Ruby still needs ISP support by poboxbot · · Score: 3, Informative

      True and true.

      There's one host that looks promising: http://www.textdrive.com/ -- It's run by Dean Allen (wrote TextPattern), David Heinemeier Hansson (wrote Rails), Matt Mullenweg (wrote WordPress), among others.

      Not astroturfing -- I co-lo elsewhere, and almost wish I was willing to do the virtual host thing again to try it out.

    8. Re:Ruby still needs ISP support by badboy_tw2002 · · Score: 2, Informative

      I saw that, and the philosophy of giving half their income back to the project is _awesome_. What a way to fund an OSS project, and especially cool in this case because they can convert people (like me) with websites for small clubs or groups that would like to try Rails but don't have an ISP that can do it. One question about all this though, how long has the company been around? Are they kind of fly by night? I could see a real nightmere if they collapsed and you were left swinging without any place to run your webapp.

    9. Re:Ruby still needs ISP support by egoots · · Score: 1

      Have you worked through this?

    10. Re:Ruby still needs ISP support by the+quick+brown+fox · · Score: 1

      I use a virtual private server, specifically so I can install whatever software I want. And only $20/month for unlimited domains.

    11. Re:Ruby still needs ISP support by ubernostrum · · Score: 1

      TextDrive was started by the guys behind Textpattern, as a dedicated hosting service which would be friendly to Textpattern and its users.

      Financially they're quite well off because of the initial marketing scheme; instead of going to vulture^H^H^H^H^H^Henture capitalists, they offered lifetime hosting to early adopters for an up-front $200 fee. As I recall, they raised about $40k in a couple days doing that.
  12. Re:Ruby by ggvaidya · · Score: 2, Funny

    That's actually "-1, Redundant", but as of right now, your post is precisely at "1, Redundant"! Good call! :D

  13. Ruby On Rails by ezmobius · · Score: 2, Interesting

    This framework is very nice. If your looking to get away from the sometimes mess of php web development, then this is a great choice. Ruby is a very expressive and powerful language that is very easy to read and code. And also very easy to make wrappers for c libraries. The rails framework does make it _very_ fast to develop MVC web apps with a small amount of intuitive code. And the rubyonrails mailing list is very active and friendly.

  14. Pay for MySQL front? by mebollocks · · Score: 1

    You have to pay for a front-end to MySQL ? The world's most popular open source database doesn't have a free front-end? em... sorry, I just didn't know this and am exclaiming out loud... please move along.

    1. Re:Pay for MySQL front? by mangu · · Score: 1
      The world's most popular open source database doesn't have a free front-end?


      Yes, it does, try phpMyAdmin

    2. Re:Pay for MySQL front? by MasTRE · · Score: 1

      > You have to pay for a front-end to MySQL ? The world's most popular open source database doesn't have a free front-end? em... sorry, I just didn't know this and am exclaiming out loud... please move along.

      As long as we're off-topic here.. The world's most popular interface to a filesystem, mysql, does have quite an excellent, free, open source front end: phpMyAdmin. However, Curt Hibbs, the author of this highly Windows-centric article, chose to go the eye-candy route for maximum brownie points with highly impressionable, brain-dead users. I had to exercise active restraint to not hate on Ruby/Rails because of this.

      --
      Must-not-watch TV!
  15. Re:Ruby by ReeprFlame · · Score: 2, Funny

    Figured that may be the case. Rubies and Perls are all gems!

  16. It's just a pity by Metteyya · · Score: 4, Funny

    I like Ruby, even before I got to know Rails. The only thing I regret is that LAMR sounds really bad.

    I develop webpages with LAMR - imagine saying something like that ;).

    1. Re:It's just a pity by arkanes · · Score: 1

      Use PostgreSQL instead of MySQL and you can re-factor it to LARP!

    2. Re:It's just a pity by Garion911 · · Score: 1

      Even worse:

      LAMROR

      --
      Slashdot is like Playboy: I read it for the articles
    3. Re:It's just a pity by the+unbeliever · · Score: 1

      And LARP isn't lame in and of itself? ;)

      (thinking of other definitions here)

    4. Re:It's just a pity by OblongPlatypus · · Score: 1

      Good thing you didn't go for Erlang, that'd simply be LAME.

      --
      -- If no truths are spoken then no lies can hide --
    5. Re:It's just a pity by legirons · · Score: 2, Funny

      "imagine saying I develop webpages with LAMR ;)"

      The alternative being serious, professional names like Plone, Drupal, and Zope?

    6. Re:It's just a pity by ghmh · · Score: 1

      >And LARP isn't lame in and of itself? ;)

      >(thinking of other definitions here)

      Like Live Action Ruby Programming?

  17. Okay, so what else does it do? by Xugumad · · Score: 1

    That's great if all I want to do is maintain a database through a web interface. I don't. Most of my work involves complex modification of that data, or calculations based on it.

    Does Rails help with that?

    Don't get me wrong, I've got some simple PHP lying around this could replace brilliantly, but first impressions are it doesn't help with the really complex stuff.

    1. Re:Okay, so what else does it do? by swimmar132 · · Score: 4, Informative

      Perhaps the documentation for ActiveRecord will help answer your question?

      http://ar.rubyonrails.org/

      You can automatically retrieve data from the database in the form of an object, do manipulations or calculations, display it, modify it, then do a save() method on the object and it'll go right back into the database.

    2. Re:Okay, so what else does it do? by swimmar132 · · Score: 1

      The ActiveRecord classes are simply a way to get data from the database and transfer it to an object.

      You can do whatever business logic you want after you get the objects.

  18. Re:Good for "recipe" queries but little else by Minam · · Score: 4, Informative

    You might want to tell that to Basecamp, 43 Things, and Tada Lists, since they obviously have no idea that Rails isn't good for anything of that magnitude. Might also mention it to all the thousands of people that use those sites, daily, and to the handful of developers who built and deployed those sites in a fraction of the time and cost of other web solutions.

    Then again, maybe you shouldn't...

  19. Rails is just the tip of the iceberg by Paradox · · Score: 4, Informative

    Rails is an incredibly good framework for Ruby, that really shows off its power and makes it easy to get a web application going, but it's not all that Ruby has to offer.

    Ruby is full of incredible libraries and frameworks like this, especially where text processing and web development are concerned. It's because Ruby has such a rich set of features.

    Anyone who likes Rails should dig deeper. Heck, Ruby's standard library comes with some amazing things. Ruby also has a framework called RubyGems,
    which is very much like Perl's CPAN integration or CommonLisp's ASDF framework.

    --
    Slashdot. It's Not For Common Sense
  20. HTML by Run4yourlives · · Score: 1

    I notice Ruby's spitting out a lot of html (full forms etc.)

    Does it validate as standards compliant?

    1. Re:HTML by swimmar132 · · Score: 1

      Hi,

      Rails provides CRUD (Create, Retrieve, Update, Delete) helpers if you want to use them. They're aren't necessary by any means, they just provide an easy, extremely quick way (one line of code) to create forms that will let you operate on a database table.

      I'm not sure if the code that it generates is standards-compliant, but I'd imagine that it is.

  21. So great, so slow by madshot · · Score: 1

    wow.. the power of /. You anounce the web link, everyone tries to hit it.. and it shows just how underpowered their database applications are (or how slow their i-net connection is).. Don't know about you.. but the website appears to be almost /.'ed. maybe in a few more minutes it will be 100% unresponsive.

    --
    Obama = Socialism.
    1. Re:So great, so slow by swimmar132 · · Score: 1

      The linked websites are all loading fine for me...

  22. But... But... There's IIS! by MooseByte · · Score: 3, Funny

    "If you are using Windows though, looks like this could be very useful."

    Only if it can match the stability and security of IIS that we've come to depend on. Otherwise it's just another shoddy product built by communists for communists.

  23. "Build a better LAMP!" by StandardDeviant · · Score: 1

    As a coworker said: "Build a better LAMP: Linux Apache Middleware Postgres!" ;) [Where "middleware" could be anything more robust than your typical php sleazeware.]

  24. Have you ever programmed a web app before? by Paradox · · Score: 5, Informative
    Well, most of the article is setup. But I do agree the article is less than a stunning demo of rails. Instead, you might want to fire up the video at www.rubyonrails.com which walks you through a 10 minute application build.

    It's extremely cool to watch someone set up a working webapp that fast.

    But I have to take issue with:

    Take a look at this example. It's incrediblyl complicated and all it does is display a horrible little form that lets you query cookbook recipies!
    Half of the darn article is setting up MySql and installing Ruby and Rails from scratch on a windows machine. Do you have any idea how much harder this crap is to write in other frameworks? You'd have to write at least 2x as much code. No one has an Active Record class as good as Rails'. You'd double the code count just doing the SQL linkage!

    It's one thing to be unimpressed, but it's another to know jack shit about the domain and say it's all worthless. Anyone who's ever made a web application will appreciate it.

    --
    Slashdot. It's Not For Common Sense
    1. Re:Have you ever programmed a web app before? by draven · · Score: 2, Informative

      Dude.
      That's just not true. Class::DBI lets you set up your application just as easily as Active Record. Try looking at some Maypole application examples to get a clue.

      --
      -- Marcus Ramberg
  25. Re:Good for "recipe" queries but little else by Xugumad · · Score: 1

    Are there any complex, open source, examples? Just, I'd love to see how doing these things with Rails affected the amount of code needed...

  26. Re:Good for "recipe" queries but little else by Tobias+Luetke · · Score: 2, Insightful

    This is not insightful. If you want to see how well it scales look all all the production grade applications out there. The source to hieraki is freely accessible.

    Rails is NOT your run the mill proof of concept framework. Its the next level of programming environment right now and here. Available for you to download under MIT license. The people who use it make applications magnitudes faster than the people who aren't. Single people can be as productive as whole teams.

    There hasn't been an improvement in productivity like this in recent programming-history.

    And don't just put down what you don't understand, give it a try.

    Your attitude will just get you boring jobs.

  27. FAQ: Why isn't Ruby more popular than ...? by Anonymous Coward · · Score: 1, Informative

    Ruby is a relatively new programming language from Japan that is rapidly growing in popularity. In Japan it has already overtaken Python in popularity and has started to gain a loyal following in other countries.

    Before year 2000, there were no English-language books about Ruby. Now we have a fast-growing English library including Ruby in a Nutshell, Programming Ruby 2nd Ed., Teach Yourself Ruby in 21 Days, and more.

    The lack of English documentation was what held Ruby back in popularity. With that problem now largely addressed, it has started to gain popularity rather quickly in the USA.

    Ruby was designed by Yukihiro Matsumoto, a.k.a "Matz". It is a pure OO language but has time-saving features which make it useful for one-liners like Perl. If you like being highly productive, having fun programming, and want your code to make sense a year later, then give Ruby a try.

  28. Re:Good for "recipe" queries but little else by swimmar132 · · Score: 1

    Insightful?

    Lets see you do the same thing cleanly with a MVC pattern in any other language/framework in as little effort as you can with Rails.

  29. How does this compare to other stacks? by darekana · · Score: 2, Interesting

    Any comparisons to Hibernate stacks, Struts, Zope3, CherryPy etc?

    1. Re:How does this compare to other stacks? by dash2 · · Score: 3, Informative

      or indeed Maypole?

  30. Re:Good for "recipe" queries but little else by Minam · · Score: 3, Informative

    Consider Hieraki, or RForum, or any of the other projects listed at the bottom of The Ruby-on-Rails docs page.

  31. FlexGrid? by ackthpt · · Score: 5, Funny
    Ruby doesn't have FlexGrid ocx which basically makes it useless for database apps.

    FlexGrid? FLEXGRID?!?!

    Implementation of FlexGrids is responsible for extreme stress, male pattern baldness, genital warts, dry heaves, infertility, webbed toes, seeing spots, loss of super powers, carpal tunnel syndrome, diarrhea, dandruff, dispepsia, gas, fingernail rot, yellowy wax buildup, stink foot, Plantars warts, incontinence, communism, crusty boogers, arthritis, bursitis and and cooties. The only treatment is 500mg of Dammitol, fiftytwo times a day.

    You, sir, are a maniac.

    --

    A feeling of having made the same mistake before: Deja Foobar
    1. Re:FlexGrid? by hotbutteredhtml · · Score: 1

      Come on now...don't hold back. Tell us how you really feel.

      --
      how 'bout I give you the finger....and you give me my phone call.
    2. Re:FlexGrid? by hostyle · · Score: 1

      You wouldnt happen to know of a GUI-based database control for parsing Slashdot comments like yours would you?

      --
      Caesar si viveret, ad remum dareris.
  32. Rails is awesome by swimmar132 · · Score: 4, Interesting

    I've almost finished developing a real estate site using it. First time using Rails.

    In PHP or other related language, probably would've taken me about 80 hours or so to develop the site. In Rails, I've spent maybe 15 hours or so total on it. And I'm charging $8k for the site. Admittedly, that doesn't include time working on the graphics or design of the site, just the backend, search, etc.

    So if you look at it from one perspective, I went from making $100 an hour to $533 an hour using Rails!

    1. Re:Rails is awesome by iamthemoog · · Score: 1

      And when you get run over by a bus, who'll be able to maintain / update your site? Is there a large enough base of Rails users such that your client can find another developer?

      Not trying to knock what you've done, but if I were your client, I might be happier knowing my site was written in a more common language...

      --
      No Norm, those are your safety glasses; I'll wear my own thanks...
    2. Re:Rails is awesome by swimmar132 · · Score: 2, Interesting

      Considering that I've written less than 500 lines of code (not counting html or css), I'd guess pretty much anyone could get up to speed with it in less than a day, even with Rails experience.

      Hell, I probably only spent two days studying Rails prior to creating the site.

    3. Re:Rails is awesome by Anonymous Coward · · Score: 2, Insightful

      Oh please, not this fallacy. Just put an ad out for a Ruby programmer. Do you really think there are only about 5 or 6 in the world or something?

      And what makes you think Java or PHP or whatever is magically maintainable because the language is familiar? It takes me at least a week to get comfortable with another developer's layout, structure, conventions, etc. It might as well be a different language anyway.

      Besides, any good programmer could learn Ruby in a weekend. It's a *simple* language.

    4. Re:Rails is awesome by manjunaths · · Score: 1

      I have heard so much about ruby, I am going to try just that, it is saturday morning here, I am going to try and learn ruby in the next two days.

      --
      Slashdot: Tabloid for the nerds. Stuff that doesn't matter.
    5. Re:Rails is awesome by PurpleWizard · · Score: 1
      Trouble is defining "learning complete".

      I did probably become able to use C in about two days. Fifteen years of use later and it was somewhere along that stretch that I would say I became competent in C. ("Competent" of course still being subjective and my conception of that is probably higher than most but not as high as some; as I am competent to write code for things like braking systems and engine contollers where mishaps matter.)

      I was writing things in Ruby almost immediately. Could I program in Ruby (make use of the "Ruby way") after a couple of days? No.

      Part of that is of course learning the magic condensed into some of Ruby's constructs and the object oriented manner of it takes longer (with coming from a different way of working). I haven't tried to use it in a large way but I'm sure as I attempt to build serious applications in it it will take more than two days before I consider I can program as Ruby rather than in Ruby.

  33. It's not so bad, Rails is unit tested very well by Paradox · · Score: 4, Informative

    Firstly, Rails's ActiveRecord class is very simple Ruby code, so it's naturally bug-resistant.

    Secondly, the author knows that ActiveRecord could be a source of problems, which is why it's got dozens of unit tests, covering nearly every line of code.

    Thirdly, even with all that bugs can and will sneak through, which is why ActiveRecord can, upon command, write a detailed log of its attempt to dynamically bind and create the classes you want. The logging is at the message-passing level of Ruby, which is nearly as atomic as you can get (you could hack the interpreter to go further, but that'd be pointless).

    The dark ages of hideous bugs in dynamic code are gone my friend. We have the tools and techniques to make code of this type both safe and maintainable. Don't be afraid of it.

    --
    Slashdot. It's Not For Common Sense
  34. What about SCGI? by Craig+Ringer · · Score: 2, Interesting

    Personally, I'd like to see SCGI deployed more widely. Then we could drop the requirement for mod_ for many apps, and make it much easier to deploy frameworks and languages on hosting providers.

    I've been really impressed with SCGI for my own work (a Quixote + Python based web app).

    1. Re:What about SCGI? by egoots · · Score: 1

      I am not sure about SCGI, but FastCGI can be used for Ruby

      In fact, Ruby on Rails seem to suggest using Webrick or mod_ruby for development, but then switching to FastCGI for production (and greater speed)

  35. Looks like Oracle's HTML DB... by 42.5 · · Score: 1

    Only harder and less user-friendly. I'm sure for java programmers this seems easy. My typical audience is Excel users who know practically nothing about programming.
    Oracle HTML DB Quick Tour.

    --
    Non illegemati carborundum est!
  36. Hibernate by grahamsz · · Score: 1

    Hibernate does take care of this nicely, but certainly not with 2 lines of code :)

  37. Re:Good for "recipe" queries but little else by stuntpope · · Score: 1

    There hasn't been an improvement in productivity like this in recent programming-history.

    Explain how this framework is orders of magnitude better than, say, Zope (which I'm most familiar with of the web app frameworks). I skimmed through the Hibbs' demo and wasn't so wowed. I thought it was cool that the framework takes care of the ORB-ing through 'generate' commands and then automatically picks up the changes to the table structure, but Rails isn't alone in making the brokering easy. I might give it a try, but it's yet another framework, and yet another language for me, without (to me) the amazing benefits you claim for it.

  38. Yes, but... by Paradox · · Score: 1

    Yes, the code is standards compliant. But that's not saying much, the scaffolding feature is so basic it's not saying much.

    In general you do not use those scaffolds in the production app. They're placeholders for you as you program your actions, and in that regard they're very useful.

    --
    Slashdot. It's Not For Common Sense
  39. Re:Good for "recipe" queries but little else by Anonymous Coward · · Score: 1, Insightful
    MODS!!! This isn't "insightful", it's "uninformed".

    It's funny. I was just discussing the bygone days of visual programming the other day. It faded into obscurtity with good reason in the late 80's.

    This isn't "visual programming". What the HELL are you talking about. The article had a lot of visuals, maybe that threw you off!

    This is more like dynamic programming in Lisp from the 60's and 70's, come back with a web app slant. I was just discussing with *my* friends how lame Java and other languages are because you can't factor out chunks of code the way you can in Lisp or Ruby.

    Being able to set up a bunch of boilerplate in just one line is *useful*. Then you go back and fill in the blanks. This is what programming is supposed to be like!

    Take a look at this example. It's incrediblyl complicated and all it does is display a horrible little form that lets you query cookbook recipies!

    Okay, I call your bluff. Write a similar article writing a similar app in your favorite language and framework. Post it here in a slashdot comment. Go on, we'll wait. Remember, you have to start from scratch on an empty Windows box, install the framework, the database, and the web server, and create a simple *readable* *well-factored* app.

    There's no reason for either Ruby or Rail (nice name) today.

    You must be a hard-core Lisp or Scheme programmer. Otherwise you're talking out of your butt. I moved to Ruby a couple years ago and it blew my mind. My programs are short, readable, easy to test, and just as powerful as Java or Python (maybe not quite as *fast* but just wait, Ruby is still v1.x).

    It's not useful for anything bigger than a 'hello world' application.

    Well, as others have pointed out, there are Rails apps that are bigger than "hello world". So your statement is wrong.

    I know, I know. You spent all this time learning JavaSomething or PHPSomethingElse and now somebody's pointed out something that renders all that effort a waste of brain space. I understand. It's the same as folks who cling to MySQL when there's PostgreSQL or who still write CGI apps in C++ because they don't want to drop this cool library they wrote or they still use Perl for OO programming because it took 2 years to figure it out and they don't want to start over. You're in denial. You know you can do everything you need in your favorite framework, so you won't let yourself believe you can do the same, faster, in something else.

  40. Empire Builder? by ackthpt · · Score: 2, Funny
    Thats interesting. Never heard of Ruby before but it seems very useful especially with the DB integration.

    Rabid Empire Builder (and Euro Rails, British Rails, Russian Rails, Iron Dragon, Lunar Rails, India Rails, Australia Rails, Nippon Rails, etc.) fan that I am, I saw the title and thought immediately that Ruby Rails was the next game from MayFair which would somehow bridge programming and empire building at the same time. Alas..

    you rolled a 1, ha!, didn't compile!

    --

    A feeling of having made the same mistake before: Deja Foobar
  41. Ruby on Rails is very good but... by jadeforrest · · Score: 1
    The demos I've seen of RoR are very impressive, but I think web frameworks take a long long time to mature. You'll be able to do lots of fun things with RoR, and in a couple of years it may be a great platform, but compare it to a more mature platform, and you'll see there are tradeoffs.

    See What is OpenACS for an example of a web framework that's been around for about a decade, has had millions of dollars spent on its development, and can do almost anything you want. The downside to something like OpenACS is it is more complicated and there is definitely more cruft.

    1. Re:Ruby on Rails is very good but... by rffrff · · Score: 1

      actually there are guys that used openacs that switched, look out on google for theyr comments on this

    2. Re:Ruby on Rails is very good but... by jadeforrest · · Score: 1

      Just because someone has switched doesn't change my essential argument that there are tradeoffs. I'm very familiar with the guy who switched, and what he says the benefits are.

  42. One Click Instalation by davi_slashdot · · Score: 2, Funny

    1. Download the latest One-Click Ruby Installer for Windows (shown in Figure 1). As of this writing, the latest is ruby182-14.exe).
    2. Double-click on the downloaded executable and follow the installation instructions. Unless you have some special needs, just press Enter to accept all of the defaults.

    Believe me guys, no hype at all :-).

    1. Re:One Click Instalation by trevick · · Score: 1
      1. Download the latest One-Click Ruby Installer for Windows (shown in Figure 1)....
      2. Double-click on the downloaded executable and follow the installation instructions....
      Sounds more like a two click Ruby installer to me.
  43. TMTOWDI by ryantate · · Score: 4, Insightful

    Perl has its own rapid application development framework, Maypole. Here are some screenshots from a Perl.com article where Simon Cozens sets up an online sales catalog in 11 lines of code. (Here's a followup article, and the Maypole home page.)

    These systems all demo well because the developer gets to decide what functionality to demo, and it not coincidentally happens to be the functionality the framework was designed to easily support. The real test of the system comes when you want to do something the designer did not anticipate, and you find out how flexible the system is and how sensible the designer's instincts are.

    With these environments I think time will tell, with most developers watching the few willing to take the risk of investing the time needed to learn the framework and how to customize it extensively.

  44. Re:Good for "recipe" queries but little else by swimmar132 · · Score: 1

    Visual programming? What the hell is visual about it?

  45. This demo is mediorcre. You might want to check... by Paradox · · Score: 1

    There are a lot more demos on the Ruby On Rails Website, and it's documentation section.

    You're a Zope fan, which means you're a Python fan. Probably the only language that can compete with Python on even terms is Ruby, and the languages are extremely similar.

    I'd highly recommend you check it out. The language should be close enough to Python to learn in a day or two, and Rails is really powerful. It's different from Zope-no doubt about it-but that doesn't mean it's bad.

    --
    Slashdot. It's Not For Common Sense
  46. Re:Good for "recipe" queries but little else by Xugumad · · Score: 1

    While I don't think it would fit most of the stuff we do, well enough that I'd want to rewrite it (to start with, we'd have to redesign the database...), reading some of this makes me want to do other things that I've always written off as not worth the time it would take.

    Which is kinda scary.

  47. Coldfusion ... by webmilhouse · · Score: 1

    is still a whole lot easier. What could be easier than cfquery for non-technical programmers? And you can get the BlueDragon CFML parser for free, so you don't have to shell out money to Macromedia.

    --


    In this house we obey the laws of Thermodynamics!
    1. Re:Coldfusion ... by hyperstation · · Score: 1

      "non-technical programmers"

      one of the reasons for all of the awful code and implementations in the world is because of languages like CF that make programming possible for people who don't know better.

  48. Real-life applications launched on the Rails by Webster132 · · Score: 2, Informative

    Ruby on Rails is growing at an astounding rate right now, which is not at least due to the growing number of real-life applications that has been build upon it. Including:

    Basecamp -- The original Rails application from which the framework was extracted. A hosted project management application that combines weblog, todo lists, milestones, file storage, and more to keep everyone on the same page in a project.

    43 Things -- The "What do you want to do with your life?" application that lets you enter the 43 things that you're currently looking to achieve in life. You can blog about doing it, find others doing the same, and give advice to people who are doing things you've done.

    Ta-da List -- The todo list component of Basecamp factored out into a free mini application. Uses XMLHttpRequest and other JS techniques to keep the interface super snappy. Sharable todo lists for every occasion.

    And those are just a small sample of all the public applications out there on Rails. On top of that, there's a wide range of e-commerce, content management, business intelligence, intranet systems, and more being build inside a lot of organizations.

    Exciting times!

  49. But is the SQL any good? by slamb · · Score: 1
    It is impressive to produce that working (although spartan) website with a single line of code. But...

    Last time Ruby on Rails came up, someone mentioned this example showing off their object-relational mapping. I observed then that it makes way too many queries because the SQL it produces isn't very good. (And too many queries means a lot of slowness, especially when your database server and your webserver aren't on the same machine.)

    It's not as obvious here because all of the queries are behind the scenes, but I suspect the same sort of crappy SQL is driving this example.

    1. Re:But is the SQL any good? by swimmar132 · · Score: 1

      If you find that the application is making too many SQL queries and is bogging down performance, then ActiveRecord (the database part of Rails) lets you create custom SQL queries.

      So what's the problem?

    2. Re:But is the SQL any good? by swimmar132 · · Score: 1

      Yes, for most sites, Rails is fine. So, how is that a weakness? By not committing the zero'th and first great blunder, would the ORM layer be as simple and flexible to use?

    3. Re:But is the SQL any good? by egoots · · Score: 1

      The ORM layer is a weakness I think, the author is clearly not interested in understanding the relational model and has admitted as such in the mailing list. He commits the The First Great Blunder.

      A bit off topic, but the first great blunder that you refer to is not exactly universally accepted as an irrefutable truism. That being the case, this doesnt seem to a major barrier to me. My understanding is that the ORM layer is based on the ActiveRecord pattern which is described by Martin Fowler in his book Patterns of Enterprise Application Architecture.

    4. Re:But is the SQL any good? by slamb · · Score: 1
      If you find that the application is making too many SQL queries and is bogging down performance, then ActiveRecord (the database part of Rails) lets you create custom SQL queries. So what's the problem?

      I'm concerned that either of the following would occur:

      • Even writing the SQL manually, I'd be unable to do it properly because of imposed constraints. Specifically, it's not good enough to just replace each of their queries with manually written ones. You need to restructure some of the surrounding code so each query asks a bigger question. Fewer queries, more goodness.
      • I'd derail the system. Frameworks like this cut the code down to ridiculously few lines if you do things in their preferred way. But often if you need to go a little outside that, you end up writing as much code as you would have without the framework, if not more. You just end up needing to understand an additional layer of complexity that doesn't actually help you.

      The ACL example put such a bad taste in my mouth that I probably won't ever take the effort to see if these are true.

  50. Somebody mod this up by dreamchaser · · Score: 1

    I just used my last mod point this morning. PLEASE somebody mod this post up.

  51. Yeah, that's been worked on... by Paradox · · Score: 1

    The most recent release of Rails supposedly cleans up a lot of issues, including some with the SQL generation.

    It also implements caching at a variety of levels, to further speed things up. The most recent releases of rails are dramatically faster than prior.

    --
    Slashdot. It's Not For Common Sense
  52. LAMP? by prockcore · · Score: 1

    Anyone else find it strange that the author didn't use 3 of the products in "LAMP"?

    Didn't use Linux, used Windows,
    Didn't use Apache, used WEBrick,
    Didn't use PHP/Perl, used Ruby.

    Shouldn't this article be on ONWwmr.com?

    1. Re:LAMP? by Merk · · Score: 1

      Is that what LAMP means? I'd always wondered.

      Tis true, that this demo didn't use any of the above, but it can. Ruby works much better on a POSIX platform than Windows, but it does work very well on Windows. Linux is no problem. It works fine with Apache, either as CGIs or using mod_ruby. It doesn't use PHP/Python/Perl, that's true, but someone else suggested that the P in OnLAMP was for Postgres, which works great with Ruby.

      In the end though, you do have a point.

    2. Re:LAMP? by emurphy42 · · Score: 1
      someone else suggested that the P in OnLAMP was for Postgres
      At best, that's stretching things. LAMP traditionally represents OS, web server, database, and programming language (in that order): hence Linux, Apache, MySQL, (Perl or whatever).
  53. Re:Good for "recipe" queries but little else by Tobias+Luetke · · Score: 1

    People regularly tell us in the channel how they ported their 4k PHP project to 400 lines of rails code over the weekend. Give it a try, its fun.

  54. But you're missing an important implication by Paradox · · Score: 1

    What's cool about Rails, and why this dynamic approach is so desirable, is that it can change on-the-fly.

    Yeah, you heard me right. Your web app can be depolyed, and you can modify the tables. Need to add a new field? Just do it. You can also (on-the-fly) make new test actions to play with these parts of the database. Of course, deleting or renaming a column can cause a problem with existing code, but Rails still gives you more than most competitiors in this regard.

    Being able to debug a web application without bringing it down or re-deploying it is a powerful feature. Code generators are all good, until you need to do something fancy which requires custom code. In Ruby, all that stuff is done dynamically (oh, and cached, of course) when it needs to be done. It's a lot more conveniant than code generation.

    --
    Slashdot. It's Not For Common Sense
    1. Re:But you're missing an important implication by Tassach · · Score: 2, Interesting
      Your web app can be depolyed, and you can modify the tables. Need to add a new field? Just do it. You can also (on-the-fly) make new test actions to play with these parts of the database.
      You call that a feature. I call that a symptom of an inherent design flaw.

      The whole Ruby-on-Rails framework seems predicated on the idea that the application (and hence everyone on the internet) has unfettered access to the database. There's no way in HELL I'm granting an untrusted user (someone on the internet) permission to directly update or delete my tables. Hell, I don't even want them to be able to SELECT at will -- they get ONLY do what I explicitly tell them they can do. This is done via stored procedures.

      If you care about your data AT ALL, you filter all user access through stored procedures. If the untrusted user account has no permissions to touch the tables directly, and only has execute permission on a limited set stored procedures, it's impossible for them to mount a successful SQL injection attack. Defense in depth is a Good Thing. Furthermore, stored procedures allow you to implement very fine-grained row- and column- level access constraints, and they allow you to do robust data integrety checks at the database layer, where they belong.

      The phrase "stored procedure" doesn't even seem to be in the R-o-R developers' vocabulary. This causes me to immediately discard it as a tool for serious work. It may be OK as a rapid prototyping tool, and it might be acceptable for a non-critical system which will only be exposed on an intranet, but I can't see it using it for any public-facing mission-critical system.

      It looks like a nice toy, and perhaps even a useful one, but it's still a toy.

      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    2. Re:But you're missing an important implication by swimmar132 · · Score: 1

      Different tools for different needs. Lots of production sites use Rails succesfully.

      You can determine access to the database through the ActiveRecord objects. Probably not in stored procedures though.

      If you do need stored procedures, you don't need to use ActiveRecord (which is the ORM part of Rails).

    3. Re:But you're missing an important implication by Earlybird · · Score: 2, Interesting
      • The whole Ruby-on-Rails framework seems predicated on the idea that the application (and hence everyone on the internet) has unfettered access to the database.

      Rails does not assume this. Rails only does what you let it; if you write data-reading code, the connection must have read access to the DB, and if your code updates the data, the connection must have write access.

      You how structure and delegate this access is up to you.

      • The phrase "stored procedure" doesn't even seem to be in the R-o-R developers' vocabulary. This causes me to immediately discard it as a tool for serious work.

      Rails does not rely on stored procedures because the SP is not a relational construct -- it's an imperative language construct. Rails relies on relations, and it relies on introspection features in the database to automagically map tables to classes and rows to objects.

      You can certainly invoke stored procs from Rails. While Rails abstracts data access, you still have direct access to the database if you need it. But this means bypassing the nice object-relational mapping sugar that makes Rails such a productive framework in the first place.

      You could certainly extend Rails's mapper (which is called ActiveRecord) to let users specify the extra metadata needed to map stored procedure calls to objects.

      And lastly, ActiveRecord is not required to use Rails. You could replace it with something equally simple; ActiveRecord is just 5,000 lines of Ruby code plus another 3,500 for the database adapters.

      • It looks like a nice toy, and perhaps even a useful one, but it's still a toy.

      I'm going to counter your arrogant, childishly intolerant trolling with a sensible counter-argument. It's a difference in philosophy -- monolithic database apps vs. distributed ones.

      Some developers like to keep the database pure -- let the database worry about the data and provide a few basic operators to access and manipulate the data. Then on top of that you layer whatever data-management engine you want. These developers consider stored procedures a bit dirty because it couples the logic more tightly to the data, and introduces portability problems.

      Of course, stored procedures have benefits, too, such as centralizing the core logic so that it can be accessed through the database CLI from any component in any language. That kind of model is powerful and useful, but is growing weaker as databases become increasingly loosely coupled.

    4. Re:But you're missing an important implication by 1_interest_1 · · Score: 1
      Hi Joe,

      I was reading your homepage and found something a little amusing, please allow me to quote:

      If you are using Netscape 4, this page probably looks like shit. That's because NS4's support of CSS (Cascading Style Sheets) blows. The section headers are SUPPOSED to be a blue bar going from margin to margin. This works in every browser except NS4. I havn't figured out how to work around this bug yet - it's annoying, but not annoying enough for me to waste time fixing it. While ugly, Netscape users can still read the page, and I'm not so anal-retentive that I'm going to lose sleep over the fact that someone might not see my pages EXACTLY the way I indended them to be seen, which is the whole point of the web. Good HTML degrades gracefully on less-capable browsers. Of course, you ARE still using Netscape 4, you should really upgrade to a non-broken, standards-compliant browser.

      Emphasis is mine. Just wanted to point out that the rest of your page looks like shit in Safari, and well to be honest, just about every browser out there. I suppose it would look okay in Lynx, but even then I doubt it.

      Thanks, have a nice day.

    5. Re:But you're missing an important implication by jadavis · · Score: 1

      I disagree. An developer's use of OOP is not an all-or-nothing proposition, and there's no reason it should be. Some ideas lend themselves to OOP, and another idea in the same application might lend itself toward procedural programming.

      --
      Social scientists are inspired by theories; scientists are humbled by facts.
    6. Re:But you're missing an important implication by beef3k · · Score: 1

      I'm not very familiar with web development at all, but does this adress some of your concerns? http://manuals.rubyonrails.com/read/book/8

    7. Re:But you're missing an important implication by Tassach · · Score: 1
      It's good to see that they're aware of SQL injection, but the fact that they have to give special instructions on how to code defensively in order to avoid SQL injection attacks merely underscores the my assertion that the archicture is fundimentally flawed from a security perspective.

      To make an analogy, it's like buffer overflows in C/C++. Sure, it's possible to write C/C++ code which doesn't have explotable buffer overflows -- the techniques to avoid them are widely known and well documented. However, even extremely talented, security minded programmers STILL wind up making classic mistakes.

      If you're worried about buffer overflows in your system, you could take two approches: you could implement it in C/C++ and adopt a very rigorous set of development procedures with extensive code reviews and testing, or you could use a language which is not vulnerable to buffer overlows. Which method do YOU think is going to require less effort and have a greater chance of succeding? Likewise, if you're worried about SQL injections, which is a better approach: one which requires you to not make any mistakes, or one which which won't let you make the mistake in the first place?

      If even the hacker gods can't use the tool securely 100% of the time, what chance do we mere mortals have of doing so? The answer is, none at all. Therefore, sound engineering practice dictates that we take our human limitations into account and use tools and techniques which will mitigate the damage caused by those mistakes which we will inevitably make.

      Here's another thing to consider: even if we can guarantee that our code is 100% free of exploitable holes, we still have to deal with the possibility that some other vulnerability (say in the operating system or the web server) will allow an attacker to compromise the public server. If all the security is on the web server, we've created single point of failure which will cause the entire system to be subverted.

      An attacker who rooted the web server would be able to find out the database connection information, and would then therefore be able to connect to the database with the same permissions as the web application uses. If the web application has permission to read, update, and delete all tables, so does the attacker. If, however, we follow the principle of least privilidge, the public account only has permission to execute a limited set of well-designed stored procedures. This way, having direct access to the database doesn't allow the attacker to do anything that he wouldn't be able to do via the application.

      Furthermore, we should practice defense in depth, which means putting in in redundant security features, compartmentalizing the application logic between the web server and the database server, and putting the components on seperate physical machines. This limits the damage which can be done if any single component fails. The fact that this architecture gives us better scalability is a free bonus.

      A good engineer always asks himself "If THIS component fails, how will the entire system react?" Using an monolithic security model in a mission-critical system is bad engineering. A software engineer who designs an application which can be compromised by a single line of bad code is just as negligent as a civil engineer who designs a suspension bridge which will collapse if a single cable breaks.

      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    8. Re:But you're missing an important implication by Jicksta · · Score: 1

      Someone mod this flamebait. While I'm a strong advocate for web standards, I certainly don't throw cheap blows at someone for writing a page that doesn't look like the zen garden.

      This guy is just a jackass.

    9. Re:But you're missing an important implication by 1_interest_1 · · Score: 1

      Hate to break it to you buddy, but your site sucks too. Personally, I feel that the Zen Garden is *way* overrated as well.

      P.S. - Love the photos on your site, happy 17th.

    10. Re:But you're missing an important implication by Tassach · · Score: 1
      Stored procedures are a disaster for OO design. It's hard enough to do good OR-mapping without adding a procedural layer in-between.
      Well, I've been devloping OO-database systems for something like 16 years. My experience is exactly the opposite: stored procedures make the Object-Relational mapping EASIER, not more difficult.

      Under this approach, each OO method (as well as constructors & destructors, where appropriate) maps one-for-one to a specific corresponding stored procedure call. This isolates your application from the details of the database, which means you can completely change the database schema and the object layer will never know the difference as long as the SP interfaces remain the same.

      The application doesn't need to know if the properties for ObjectX are stored in one table or normalized across 5 tables -- it only needs to know how to create, retrieve, and modify the record(s) and fields(s) which correspond to it's properties.

      Yes, it's more work to do it this way than using a tool which automates the O-R mapping (like Ruby on Rails). The advantage is that you get a more robust and secure system with better scalability and maintanability.

      Perhaps what you mean is that using stored procedures makes it more difficult to jump in and start banging out code without doing good design up front. That is entirely true. I consider this a feature, not a bug. Doing good design and thinking things out first saves you trouble in the long run.

      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    11. Re:But you're missing an important implication by Tassach · · Score: 1
      Granting access vertically (columns) is easy to do. Limiting access horizontally (rows) is hard to do.

      Let's say you have an Inventory table, which has ProductID, DepartmentID, Name, Cost, SalePrice, and NumberInStock. Your security requirements are:

      1. An inventory clerk can see all fields except Cost, and can only update NumberInStock, and cannot add or delete records
      2. A department manger can see everythign, change SalePrice and NumberInStock, can add new products, but cannot delete anything
      3. Clerks and managers are only allowed to see records for their department. They should not be allowed see or alter anything in another department
      You can satisfy requirements 1 and 2 through traditional grant statements, however it's more difficult to limit their access to specific rows this way. If they only have rights to rows which match a specific WHERE clause, you either have to use a stored procedure or a view to limit their access. Since you can't give a view an argument, in this example you'd need a different view for each department, an SP which takes an argument (like a session id) which lets you determine what department to use.
      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    12. Re:But you're missing an important implication by Jicksta · · Score: 1

      While we're trashing sites, let's see your's...

      God damn, I actually bought a Ruby book about a month ago, but after seeing the response on this thread, I'd sooner feed it to my dog than join a community full of absolute assholes.

      I'd encourage anyone else to do the same. Let's let this "overrated" technology die like it was meant to.

  55. And "Rails" is yet another buzzword! by Baldrson · · Score: 1
    I wonder whether there are any metrics you could apply to rate the signal-to-noise ratio of a given word. For example, "XML" is virtually all noise given the fact that its basically just a syntax for named parenthesis but it is used in so many contexts you could get the idea that it is everything from a programming language just a fancy form of HTML.

    Of Rails, XForms and REST web services, REST web services is probably the noisiest of the terms but it is so limited in scope that there probably isn't too much to worry about.

  56. The World vs Ruby on Rails. by sanityspeech · · Score: 1

    I understand that WebObjects, J2EE, LAMP and Ruby-on-Rails are competing web application platforms. I am primarily interested in the latter pair as they are freely available.

    Nevertheless, I would appreciate it if anyone with experience with two or more of these platforms could shed some insights on the strengths and weaknesses of the platforms.

    1. Re:The World vs Ruby on Rails. by zardo · · Score: 1

      I have experience with J2EE and LAMP and I'm pretty excited about rails. The problem with J2EE and LAMP is the ORM tools weren't very easy to use. PHP has a project called propel, which is almost identical to the apache torque project, and similar to hibernate, and it is not as easy to use as activerecord. Rails is built on top of the ORM framework, the form elements tie into your database objects quite easily. On top of all that, Ruby has a much more powerful OO implementation than PHP and Java (and it blows Perl entirely out of the water). It makes it really easy, and almost unavoidable to write well designed applications without much extension of the base classes.

  57. For Python, CherryPy is another simple framework by MarkWatson · · Score: 2, Interesting
    I played with Rails and liked it, but I am now trying to cut down on the number of programming languages that I use (trying hard to just use Java, Python, and Common Lisp) and even though it was fun working through a Ruby tutorial, I think that I am going to give Ruby a pass, at least for now.

    For Python, I have been experimenting with CherryPy which is a fairly low level web application framework, but is easy to use for publishing web services using XML-RPC, generating dynamic HTML (it does not have a template language but works with a few Python HTML template packages), etc.

    Anyway, CherryPy "seems just about right" - light weight and easy to use - definitely does not have the capability of Rails though.

  58. Ramping up . . . by Badgerman · · Score: 1

    This seems nice and fast, but the sad fact is Ruby doesn't have the ISP support or userbase of the "P"'s.

    So, when will they create a competitor to this? Or have I missed it already . . .

    --
    "The Sage treasures Unity and measures all things by it" - Lao Tzu
  59. Use XUL instead of HTML? by frostfreek · · Score: 1

    I wonder how hard it would be to get Rails to spit out XUL to the (mozilla) browser, instead of HTML?

    I doubt it would be that hard, and would let you do some snappy interfaces.

    1. Re:Use XUL instead of HTML? by rffrff · · Score: 1

      well, you can spit out xml stuff using the xml builder stuff. people are actively using it to produce RSS ATOm and this kind of things, so probably you can use XUL code

    2. Re:Use XUL instead of HTML? by frostfreek · · Score: 1
      To answer my own question, in the controller you simply need to specify (eg.):

      def list

      response.headers["content-type"]="application/vn d.mozilla.xul+xml"

      end


      and then write the view template in XUL!
  60. Flowgram by Doc+Ruby · · Score: 1

    That's a great under-the-hood framework. I want to draw client/server diagrams across both the presentation/logic and logic/data tiers, and compile my WWW/App/DB flowchart into HTML/Executable/SQL code.

    --

    --
    make install -not war

  61. Development time by cardmagic · · Score: 2, Informative

    I originally built Web Collaborator in 8,000 lines of PHP over a couple of months. In about 16 hours, I had completely rebuilt it from scratch in the Ruby on Rails framework with 1,000 lines of code.

    I have since created sites like The Conjuring Cabaret and S5 Presents, both with astonishing simplicity and rapid development. Rails gives me short-cuts for almost everything I ever want to do with web development.

  62. Do you know what makes me laugh? by WillerZ · · Score: 1

    The hoops you have to go through to get simple SQL stuff done in Python/Perl/Ruby.

    I have yet to see one of these "rapid-prototyping" languages in which SQL is as easy to use as it is in C, COBOL or PL/I. You see, in a proper language, one just writes:

    EXEC SQL sql-statements

    in the middle of one's code, and stuff gets done. Okay, so there are a few hoops to jump through to make sure the EXEC SQL translator knows about your variables; but it isn't difficult.

    Now, a question: do PostgreSQL, MySQL et al support this, or is it still the big boys (DB2, Oracle and friends') back-yard?

    Phil

    --
    I guess today is a passable day to die.
    1. Re:Do you know what makes me laugh? by swimmar132 · · Score: 2, Insightful

      Writing SQL statements smack dab in the middle of one's code is generally a bad thing. You want to get the code that talks to the database separated out from the rest of the application.

    2. Re:Do you know what makes me laugh? by Paradox · · Score: 2, Insightful
      Well, Rails does lots of things behind the scenes. A simple piece of code like this Object-Relational-Mapping statement:
      class Column < ActiveRecord::Base
      end
      does at the very least, the following:
      1. Pluralizes "Column" into "Columns"
      2. Finds the table "Columns" and requests its schema.
      3. Maps every column into methods.
      4. Provides logging for all SQL sent, all actions undertaken, and also allows for use of the ruby debugger on otherwise external ops
      5. Provides search and iteration methods that you'd otherwise have to write on your own
      6. Caches data for performance
      That's an awful lot of bang for your buck with just 2 lines, especially now that it's loggable and debuggable. I'd say that alone makes it better than inlined SQL.
      --
      Slashdot. It's Not For Common Sense
    3. Re:Do you know what makes me laugh? by Just+Some+Guy · · Score: 1
      You see, in a proper language, one just writes:

      EXEC SQL sql-statements

      Very impressive, but no one uses REXX anymore.

      --
      Dewey, what part of this looks like authorities should be involved?
    4. Re:Do you know what makes me laugh? by raxx7 · · Score: 2, Insightful

      PostgreSQL at least does.

      Anyway, SQL embebbed in Python/Perl/Ruby is so simple there's nothing to gain from a SQL precompiler except static checking.

    5. Re:Do you know what makes me laugh? by Anonymous Coward · · Score: 1, Interesting
      I "sort of" agree with you.

      Database expressions should be embedded in the language just like arithmetic is. I.e., we do:
      x = y + 3
      Rather than
      x = MathServer.send("ADD %s to 3", y.value)
      But the problem is that SQL SUCKS. It takes something mathematical (relational algebra) and turns it into weird semi-procedural code.

      Instead of:
      customers_with_orders = Customers JOIN Orders
      we have
      customer_with_orders = DB.fetch('SELECT * FROM
      Customers INNER JOIN Orders
      ON Customers.customer_id = Order.customer_id');
      That shit makes me laugh. Who wants to embed that or even use it!

      So when the day comes when we replace SQL with an actual relational language, I'll be happy to see it embedded in the language. Until then I'm content to HIDE that ugly junk.
    6. Re:Do you know what makes me laugh? by 5n3ak3rp1mp · · Score: 1

      There are ways around doing that. See other sibling replies to yours...

  63. Scripts by Merk · · Score: 1

    Smalltalk is great and all, but it's not so easy to write a "hello world" script in Smalltalk, at least in my limited experience. This isn't a problem with Smalltalk, it's just that the two were intended for different things.

    Ruby shares its OOness with Smalltalk, but the environment and runability of it comes from Perl. It's much more of the standard "write a script, then pass the script to the interpreter" kind of a language.

    1. Re:Scripts by roard · · Score: 1

      are you kidding ? Here's a hello world in Smalltalk:

      Transcript show: 'Hello World !'.

      Effectively, that looks extremely complex. You send a message "show:" to the object Transcript, with a string 'Hello World!' as a parameter.

      Btw, you can use Smalltalk for scripting (although I personally didn't tried it ;-) -- try GNU Smalltalk.

      But better, you should have a look on Squeak, and to be on-topic, you *absolutely* need to try Seaside if you're interested by extraordinary technologies to create websites. Ruby On Rails is quite nice, but I was blown away by Seaside. It's inspired by WebObjects, and it's really fantastic (as it leverage the fact that it uses Smalltalk ;-)

      Definitely a good idea to check, imho..

    2. Re:Scripts by Merk · · Score: 1

      If you like seaside, take a look at Borges. I'm pretty sure it's a reimplementation of seaside in Ruby (and think it might have been done by the same ppl who did seaside).

      How do you run that Hello World app in smalltalk? Do you need to have the environment running, and have to type it into an interpreter window, or can you have a script starting with a "shebang" line that looks like the following?

      #!/usr/bin/smalltalk
      Transcript show: 'Hello World!'.

      I've tried Squeak, and that's the part I couldn't figure out. If all I want is a script, a little executable program I can have sitting on its own in a "/home/me/bin" directory on my machine, can I do that?

  64. Re:Ruby by leonmergen · · Score: 1

    Haha, yes, true... I was actually thinking of modding me redundant, thus adding 1 redundant point, which would result in a decreased overall score...

    ... or I should just admit I was just lazy to use the Preview button and quit making up silly excuses :)

    --
    - Leon Mergen
    http://www.solatis.com
  65. More Praise by zorander · · Score: 1

    Checking in as a rails user.

    This thing is the best I have seen in web frameworks. The productivity is stunning. Seriously, I spend more time on site layout than I do on actual backend (and this site has quite a bit of backend). Very few of my functions are more than a few lines long and rails does a better job of discouraging coupling than any framework I've seen.

    ActiveRecord is the best out there. For those criticizing it's reflection/defaults approach to configuration, be aware that everything is predictable and where it isn't right for you, all defaults can be overridden simply and easily (just pass in an options hash to your associations (or validations, or anything really), for instance)

    As for hosts, I've heard good things about textdrive. Keep in mind that you can get a decent VPS for $14.95 a month...that means root access so you can install/compile anything you want. I've been with adiungo for a while now and they've been good to me. I haven't put rails up on the server yet, but it's really only a matter of time. Since I have the gcc toolchain on that server, I know that I can do it one way or another...

    Go forth and check out rails!

  66. RoR vs. XSLT? by schvenk · · Score: 1

    I'm a user interface designer, and as such do a lot of HTML-based interactive prototypes or mockups for Web apps. I've been using XSLT combined with XML sample data files: The XSLT allows me to build up XML-based widgets for complex but common elements and then quickly create pages using them. For that it's great, but it can be a bit cumbersome in other respects. So I'm wondering: Is there any way to integrate RoR and XSLT? Use Ruby on Rails for some of the back-end stuff but keep my XSLT widgets for the front end? Or, alternatively, is there some equivalent platform for my XSLT widgets in RoR?

    1. Re:RoR vs. XSLT? by Paradox · · Score: 1

      Well, Rails is based around two classes, ActiveRecord (which handles your ORM stuff) and ActionPack, which handles your application's structure and mapping events and generating content.

      Nothing really ties your output to html, so yes, you just as easily output anything you like. Most Rails applications output RSS feeds, which is just an XML out feed. Depending on your XSLT recources, you may need to jump through some hoops to make it work just right, though.

      --
      Slashdot. It's Not For Common Sense
    2. Re:RoR vs. XSLT? by schvenk · · Score: 1

      Hmm...sounds doable. I would need to learn more about RoR to understand the details, but one would think that between the Web server config and the Ror config you'd be able to pipe the RoR output through the XSLT processor before sending it to the client.

  67. Zope? by Trixter · · Score: 1

    How is this easier than Zope? Zope isn't smalltalk, but it does inherit (pun intended) OOP from Python and other sources.

  68. "Generator" by Baldrson · · Score: 1
    The Rails "scaffold" macro doesn't "generate any code", at least not statically, but it does generate a bunch of functionality. There's no reason to get hung up on the word "generate" here. A REST-based webservice presenting the database to a clinent-side front end gets to the heart of a lot of architectural problems by offloading the server and consequently offloads server development time.

    That also means your edit/test/debug cycle is a lot tighter because you aren't going back to the server to reconfigure your front end all the time.

    I know, a lot of people are used to the idea of having to have the server do all their markup expansion, templating, etc. If they think that gives them a web application faster then they can stick with it and die professionally.

  69. Is that your python reimplementation? by Merk · · Score: 2, Insightful

    If so, it seems to leave the db handle, and the cursor handle dangling. That was the main point I was making, is that when wrapped in a block, these things are cleaned up for you when you're done. Other than that though, this is basically a good Python translation of what the Ruby code was doing (although the Ruby version is database-independent, I imagine Python also has a DB abstraction layer).

    Btw, how'd you get the indentation right? Manually inserting &nbsp; entities?

    1. Re:Is that your python reimplementation? by raxx7 · · Score: 1

      Ah, I didn't get that part of your code. I'd have to add a couple of try: except: blocks to explicitly .close() the cursor and connection in case something bad happened or rely on garbage colletion to do it for me.

      Python has a DB-API, but you have to import the modules. For MySQL it's MySQLdb, for PostgreSQL it's pyPgSQL.PgSQL (or a couple of others). Of course, modules being objects themselves you can play arround with as much as you like.

      I just used Plain Old Text. But &nbsp works too.

    2. Re:Is that your python reimplementation? by the+quick+brown+fox · · Score: 1
      Ah, I didn't get that part of your code.

      "That part" was the whole point. You can create abstractions that embody the try/finally (or many other kinds of flow control logic), which is not possible (or at least, not convenient) in languages that do not have anonymous functions.

      Imagine if, for example, Python didn't come with a built-in language construct for list comprehensions. You couldn't easily add a "list comprehension" function, whereas it'd be very easy in Ruby (and several other languages).

    3. Re:Is that your python reimplementation? by raxx7 · · Score: 1

      Yes, I understood it after your other post. :)

  70. Good alternative for php/perl, but for j2ee? by size1one · · Score: 1
    It seems to me that Ruby & Rails would be a good alternative for php or perl which lack a good MVC framework. Rails will definatly save time when compared against these languages because MVC is key for large complex web-apps. However the example was very very simple and I am at this point not convinced that a Ruby app will have more extensibility and sustainability than a well written J2ee app.

    That they have created automatic mappings between objects and a relational database is nothing that shows Ruby to be superior. This feat can be done with java just as easily. That they do mappings automatically actually makes me hesistant because it does not give you the control over your objects and database that you would have, and possibly need, using OJB or Hibernate.

    The time savings show in the demo are only realized when doing the most simple things. As soon as you wish to customize your views, which will definatly happen to pretty it up, you have just as much work as in other langauges.

    1. Re:Good alternative for php/perl, but for j2ee? by swimmar132 · · Score: 1

      You can create automatic mappings between objects and a relational database in Java with a total of two lines of code? That's news to me. But if you can't, then that would mean that you can't "just as easily" do the same in Java, right?

      Customizing views is dead simple in Rails. I don't see how it's diffcult.

      Granted, the example that the guy gave was REALLY basic. There's lots of others on the Rails site.

    2. Re:Good alternative for php/perl, but for j2ee? by size1one · · Score: 1

      You misinterpreted. I'm talking about the ability to create a comparable product in Java or another language. The rails concept can be ported to any other language and give you the ability to write mappings just as easily.

      Code generators are nothing new and definatly do not make Ruby or Rails stand out.

  71. Re:Good for "recipe" queries but little else by Xugumad · · Score: 1

    Assuming linear scaling, that would mean porting our 85k line Java project to 8.5k lines, and taking around 3 weeks. I'll skip thanks.

    Although we do have a "mere" 13k line project that's up for rewriting anyway, and has always seemed like it should be doable in less, which I may take a stab at when I have more time.

  72. Speed? by aliens · · Score: 1

    I can't seem to find much info on the speed of this framework. I'll probably end up writing up a similar benchmark like I use with PHP DB abstractions. Just curious if anyone has looked into it.

    Oh and is there a Ruby Gem like PEAR:Cache?

    Sorry I'm a lil lazy today.

    --
    -- taking over the world, we are.
    1. Re:Speed? by aliens · · Score: 1

      Excellent, very cool stuff indeed considering I'm going to be rewritting our app in the coming months from a mess of my PHP4 and legacy PHP code I inherited.

      After spending a good while relearning my OO Heuristics for using with PHP5, it might make more sense to try Ruby since we're not on a shared host.

      Thanks for the reply AC.

      --
      -- taking over the world, we are.
  73. Continuations by Avumede · · Score: 1

    I wonder if Rails uses Ruby's support for continuations, to build a continuation based webserver. There are a few, like plt-scheme's webserver, and Seaside for Smalltalk.

    In fact, I've compared both of those in a article on my blog (sorry for the self-promotion). It would be cool if Rails can do this too...

  74. For those of you watching at home... by 5n3ak3rp1mp · · Score: 1

    This web app framework uses the same "model-view-controller" paradigm that the Cocoa dev environment on OS X uses (and which has also been lauded). FYI

  75. Nope. by Paradox · · Score: 2, Informative

    Not necessary.

    Besides, Ruby doesn't have real continuations. Their continuations are based of longjmp() C call, so it has some limitations that real continuations don't have.

    --
    Slashdot. It's Not For Common Sense
  76. Bringing Dynamic Web Pages To The Masses by zoomba · · Score: 1

    Ok, looking at that example I was blown away with how simple it was from a programming perspective. Now, I've done work in PHP, and I'm now starting on ASP.NET, and the simplicity of Rails is impressive. Now, I know a lot of you are poo-pooing it for a number of reasons for not being technologically robust/complex enough to deserve real geek attention/doesn't walk your dog for you, but think about this from another direction.

    How much easier has building a dynamic web page become for a non-geek? MUCH. With minimal programming, and a basic knowledge of HTML, the average web builder can now do something that just a short while ago was needlessly complex and arcane.

    Yes, if you're doing any production web app work, you won't rely on the default scaffolds or whatnot, you'll just use them as placeholders/test devices to later replace with more robust code. But if you want to make a quick and dirty "blog" on your web space, or make an online recipie book for mom to use, you no longer need to have a stack of manual print-outs or books telling you how to do it.

    With a little more refinement, I think this will do for dynamic pages what the WYSIWYG editor did for web pages in general. (This is based on the assumption that the average user is now more technically saavy than they were 10 years ago when the WWW was blosoming)

  77. To quote the developer... by Paradox · · Score: 1
    I found this quote on the Rails Development Weblog.
    Three levels of caching: I implemented page, action, and fragment caching for the Action Pack in Rails so I could be able to use it in Ta-da. And it's working exceedingly well. Lots of pages went from 50-70 req/sec to 400-1100 req/sec due to caching.
    As another data point, consider that www.rubyonrails.com and its wiki are both Rails apps themselves, and are still running along gamely despite the slashdotting they're receiving.

    That may also answer your PEAR::Cache deal (as I understand PEAR::Cache anyways). But Ruby doesn't need a framework to cache method calls. Making caching function calls is kind of a learning excercise. It's covered in the old, online version of Dave Thomas's "Programming Ruby" book. Specifically, in this chapter. Search for "class and module defintions" and read on. It's really quite interesting how easy it is.

    --
    Slashdot. It's Not For Common Sense
    1. Re:To quote the developer... by aliens · · Score: 1

      Thank you for the reply, this is very interesting, the Ruby syntax is a bit strange to me at the moment but is certainly a lot of fun to look at.

      --
      -- taking over the world, we are.
  78. Where's the Host!!! by SwimsWithTheFishes · · Score: 1

    Here: http://www.textdrive.com/

    They say half the fees go to the Ruby on Rails project and that:

    "We have no photographs of our CEO strutting past server racks, or of women in telephone headsets ready to take your call, but we hope you'll consider joining us all the same."

    Dang no women.

    --
    *click**beep**beep* Scotty, One to Mod up!
  79. Offtopic - Ruby by Turn-X+Alphonse · · Score: 1

    Offtopic but I'm looking for a little help here.

    I've look into Ruby before (a friend said it's agood newbie language), I've read a few tutorials and get the general concept and how it works, but I lost the URLs and such for these things, so I'm asking for some help with it.

    Wheres a good tutorial site? (multipule if possible)
    Any books worth reading?
    General resources sites?
    Good community sites with help or IRC channels?

    Thanks in advance to everything.

    --
    I like muppets.
    1. Re:Offtopic - Ruby by Paradox · · Score: 2, Informative

      Ruby has an amazing community, almost everything you could want is online.

      Check out www.rubycentral.org, which has an online ruby book (for 1.6, but it's a place to start). It will take you to all the other sites.

      I highly recommend getting in on the mailing list, ruby-talk. It's very interesting.

      --
      Slashdot. It's Not For Common Sense
    2. Re:Offtopic - Ruby by objo · · Score: 2, Informative

      Dave Thomas' Programming Ruby book - aka "The PickAxe" is all you will need. He just released the second version of the book and it will be enough to do anything you want. rubyforge.net is also a great are for projects.

    3. Re:Offtopic - Ruby by Anonymous Coward · · Score: 1, Informative

      Wheres a good tutorial site? (multipule if possible)

      why's (poignant) guide to Ruby A very cartoonish introduction to Ruby and programming in general. This one hides complexity of the language at first, but goes into more detail later. It uses interesting analogies and stories to keep the whole thing interesting. Has been praised all over the place. Programing Ruby, The Pragmatic Programmer's Guide annotated version The first edition of the definite Ruby programmer's in-detail book. I learned Ruby using this and enjoyed doing so. Make sure to try out lots of code in IRB while you read it. This version has been annotated so you can easily find places where the language changed since the first edition was released. The second edition is better than ever and you will have to pay for it. Many people happily did so, even if they already had a physical copy of the book. RubyDoc A short and fast introduction to Ruby. Teaches you how to learn by yourself, using IRB, Ruby's amazing interactive code interpreter. Introduction to Ruby Another relatively rapid introduction. Not too much to say about it, but it looks straight-forward. A little Ruby, a lot of Objects While this is more of an introduction to OOP in the world of very dynamic languages, it uses Ruby to express its samples. Definitely worth a read to see just how easy things like meta programming are done in Ruby.

      Any books worth reading?

      Programming Ruby: The Pragmatic Programmer's Guide, Second Edition I already hinted at this in the above list. Definitely worth getting, has all the details. You can either buy this from your local evil overlord mega corporation or directly from the Pragmatic Programmers who are also offering a PDF version on their site. The Ruby Way This goes a long way to explain how to do specific programming tasks in Ruby. It's a slick read and the code sample will usually show insightful ways of using to the language in powerful ways in detail.

      There's more than these, of course, but these will definitely get you started.

      General resources sites?

      Ruby-Doc Collects lots of documentation of Ruby on one single site. RedHanded Coming from the same guys who brought you the poignant guide to Ruby this is already guaranteed to be a very interesting read. One of the nicest Ruby weblogs there are right now. Also have a deeper look at his Links sidebar, it contains lots of good stuff. Ruby Application Archive Contains lots of interesting Ruby libraries. A nice place to start research. Has been largely superseded by RubyForge These guys offer free Ruby project hosting. You get everything from a bug tracker to CVS access and automatic gene
  80. Preparing to get Railed by orderthruchaos · · Score: 1

    From a security POV, this article scared me. I don't really expect it to teach how to harden a MySQL server, nor a WEBrick server created through this system, but didn't anyone else feel the urge to vomit when he said to leave the administrator password on the MySQL server blank?

    1. Re:Preparing to get Railed by sp3c1alK · · Score: 1

      Everytime someone leave an admin password blank, somewhere a SANS handler dies.

  81. Re:Ruby by JamesOfTheDesert · · Score: 1
    The "Ruby = Perl + Smalltalk" meme works best as a marketing soundbite than a proper description.

    There are elements of many languages in Ruby, including Python, Lisp, Perl, Smalltalk, and I forget what else.

    --

    Java is the blue pill
    Choose the red pill
  82. All the cool kids are doing it by asdren · · Score: 1
  83. Amazing how more and more people copy WebObjects by tyrione · · Score: 1

    Gawd damnit Apple! Re-release the Cocoa frameworks for WOF already!

    Seeing all these copycat technologies that claim superiority through extensive frameworks is becoming quite nauseating.

    Especially when they don't hold a candle to WOF/EOF Cocoa with its ObjC_WebScript, EOF Frameworks, so on and so forth. All Ruby pundits can mod me down all you want but this shit doesn't hold a candle to stuff I first learned back in 1996.

    Here is to seriously hoping Apple gets focused in the Enterprise--the lack of focus is why I left a year after the merger from NeXT.

  84. Plurals? by Leadhyena · · Score: 1
    I really like the active record idea, Rails seems to have really hit on something cool. However, couldn't they have standardized on just suffixing an S to get the database name instead of english rules of plurals? How many people would remember the plural of fungus (fungi) or Addendum (Addenda) and is the proper plural of forum (Fora) chosen over the commonly accepted forums? What about words used commonly in their plural form, like media, data, and alumni; will we be forced to use medium, datum, and alumnus to reference them? Also, what if the word doesn't have a plural in the database you connect to, like trqk_imr or some other Informix-length-enforced name? Would you use hairs or hair to store the values of hair?

    This just seems like a troubling idiom for Rails to take on, and it would have been more prudent if they had a more consistent convention than the ever changing rules of the English language.

    1. Re:Plurals? by swimmar132 · · Score: 1

      If you don't like how it pluralizes names, you are free to change it. Takes a line of code to specify the name you want to use.

  85. Re:Amazing how more and more people copy WebObject by TapestryDude · · Score: 1
    I wouldn't hold my breath. The serious NeXTHeads (myself included) moved on to Java and have tried to recreate that environment in J2EE land. I've built Tapestry, Andrus has built Cayenne, etc.

    However, I do suspect that the NeXT crew is on its way to Ruby land at some point. I think it would be a blast to build an even better framework than Tapestry in Ruby. But that's not on my current TODO list ... in fact, what is, is to build technology that better differentiates Tapestry from JSF (and Tapestry from WOF).

    --
    Howard M. Lewis Ship -- Independent J2EE / Open-Source Java Consultant -- Creator, Apache Tapestry and HiveMind
  86. Things overheard on the bus by JamesOfTheDesert · · Score: 1
    ... but [XML] is used in so many contexts you could get the idea that it is everything from a programming language just a fancy form of HTML.

    '90s: "Developer? Oh, yeah, I program in HTML."

    '00s: "Developer? Oh, yeah, I program in XML."

    --

    Java is the blue pill
    Choose the red pill
  87. Re:Good for "recipe" queries but little else by dtolton · · Score: 1

    I am a python programmer, and I have spend quite a bit of time with Zope. Zope is nowhere near as efficient as Rails. Zope has a ton of configuration files, and a lot of little nit picky details to deploy objects. I was really impressed to see how easy it is to crank out a database back ended site with Rails. Don't even try to compare putting out a Zope web site that uses the Z Database. Try actually connecting to a production grade RDBMS from Zope, it is *not* easy.

    --

    Doug Tolton

    "The destruction of a value which is, will not bring value to that which isn't." -John Galt
  88. weird directory structure by drew · · Score: 4, Informative

    i've tried rails a little bit, and jsp before that, and wasn't particularly impressed with either. is there a reason all web frameworks require a weird directory structure? rails seems better then jsp because it doesn't require an arcane descriptor file, but it still requires you to use a funky directory structure, which means the structure of your application doesn't seem to correspond in any meaningful way with your web site structure.

    why can't someone build a decent framework that follows the simple "directories are directories and files are pages" model used by asp, php, cgi, etc.

    and what's with the database naming conventions? the author kind of brushes it off at the end with this statement: "Even if you have to use a legacy database that does not use the Rails naming conventions, you don't have to give up the productivity advantages of using Rails--there is still a way to tell Rails explicitly what table and column names to use." personally I would not use those conventions no matter what database i was using, nor would any decent database developer or administrator i have ever known.

    at any rate, at work i program in whatever language they tell me- currently asp+jscript, before that php. for personal projects, my current favorite is perl's HTML::Mason. all the benefits of php (and then some) without the awful language conventions.

    --
    If I don't put anything here, will anyone recognize me anymore?
    1. Re:weird directory structure by swimmar132 · · Score: 1

      I'm not exactly sure why you think Rails directory structure is weird. I think it's pretty good.

      For those who don't know... a typical Rails structure is: /app /app/models /app/model/a_model.rb /app/controllers/ /app/controllers/a_controller.rb /app/views /app/views/a_view/ /app/views/a_view/a_particular_view.rb /public /public/stylesheets /public/images

    2. Re:weird directory structure by swimmar132 · · Score: 1

      Good point about the controllers, but views don't have "_view" appended onto them. The name of the view is the same as the corresponding action/method in the controller.

      I'm not sure why the controllers have "_controller" appended onto their filenames. Models don't have "_model" appended. Hm.

    3. Re:weird directory structure by drew · · Score: 1

      i think it's weird because as far as a can tell there is no correlation between the directories and files in you application and the URL requested.

      in a typical web setup, you have a document root. files in that document root may be images, html or xml files, or files that are to be processed by the webserver. requests for /foo.html correspond to the file foo.html in that directory. likewise, requests for foo/bar.html correspond to the file bar.html in the foo subdirectory. from time to time, there are good resons to break this model and create "virtual files" which don't really exist in the file structure, which most web programming languages allow you to handle easily, but even then, the web server and programming language still maintain the concept of a path to a file.

      rails and jsp both seem to me to break this model for no good reason, and in the process, make the cases where you might want to create "virtual" files or directories not possible.

      --
      If I don't put anything here, will anyone recognize me anymore?
    4. Re:weird directory structure by rubyfreak · · Score: 1
      I can't tell for sure since I didn't design it, but the reason is probably that each "foo_controller" file contains a FooController class. Either that or to avoid confusion with file names, since many "FooControllers" have a corresponding "Foo" model class. If controllers and models would have shared the same file names, one could make "require 'foo'" cause different things by unwittingly tinkering with the load path. Views, OTOH, are a bit different as they aren't plain Ruby files (and therefore not loaded using "require").

      But the filename conventions aren't that important anyway - Rails developers normally let Rails create the controller and model files by itself by invoking the "script/generate controller ..." or "script/generate view ..." commands from the root level of the app.

    5. Re:weird directory structure by andreas1245432 · · Score: 1

      Seperating the code structure from the website directory structure is the whole point of the MVC concept. The webserver doesn't need to deliver files with DB access code or configuration files.

    6. Re:weird directory structure by drew · · Score: 1

      I understand that, to a point- however, i don't see that it's necessary to do it in a way that places arbitrary limits on your website directory structure and prevents you from mixing static content in with your dynamic content. it also, if i am understanding how it works correctly, prevents you from using 'virtual files' to do something like:

      product_info/dingbats.html
      instead of:
      product_info?product=dingbats

      wouldn't it be easier to just put the model (or controller maybe, i'm still a bit unclear on some aspects of MVC) as a file the doc root and make templates/ and conf/ directories? this way, besides not being restricted in your website directory structure or your ability to place static files on the sites, you could also have a little flexibility in how you manage your templates- for example, on some projects i have worked on, we stored the templates in a database and used special tools to manage them, something which wouldn't even be an option with ruby on rails.

      --
      If I don't put anything here, will anyone recognize me anymore?
    7. Re:weird directory structure by andreas1245432 · · Score: 2, Informative
      It doesn't prevent you from mixing static with dynamic content. You can put any kind of static files in the "public" directory, which is the document root for the server. Only when a request cannot be satisfied directly from the document root it is forwarded to Rails (with mod_rewrite); Rails then extracts the information which controller/action is responsible for handling the request from the URL. For example if you request "/forum/list" from the server and there isn't a file with this name in the "public" dir, Rails calls the action "list" in the controller "forum". (The template file for this controller would be in "/app/views/forum/list", but you can easily override the template path, render a template from the database, return plain text, the content from a file or redirect to another page.)

      This also offers some nice possibilities for caching: save the result from the dynamic "/forum/list" request to a file called "/forum/list" in the "public" directory, and the web server won't bother Rails with this request at all, but will deliver the file directly. If the list content is expired, delete and recreate the file. Rails also provides methods to automate this.

      I suggest you just try the tutorial; I'm sure you will find that Rails is extremely flexible and doesn't set any limits to your development style.

    8. Re:weird directory structure by drew · · Score: 1

      alright, i'll have dig into it a little, i suppose. the last time i tried it out, i was following along with a guide similar to this one, and about two thirds of the way through i decided it was reminding me too much of things that bothered me about other platforms i had worked with in the past. i hadn't seen anything in this article which challenged any of my initial observations, either, but i would love to be proven wrong...

      --
      If I don't put anything here, will anyone recognize me anymore?
    9. Re:weird directory structure by Zangief · · Score: 1

      I think that the main reason, is that, with a fixed directory structure, there is another thing you don't have to configure or program.

      The whole point of frameworks is making development easier. If you had to create a complex "directory.xml" file, to tell the framework where each thing is, and it would be a hassle. Instead, you can just put things where you where told to, and concentrate on business logic.

    10. Re:weird directory structure by goynang · · Score: 1
      why can't someone build a decent framework that follows the simple "directories are directories and files are pages" model used by asp, php, cgi, etc
      Er, because when my site has got about a thousand or so pages that gets a little bit tedious. Go do some Googling on Model 1 vs Model 2. Just because you don't get/need it doesn't make it bad or worthless.
  89. Or you can just use first-class functions. by jgardn · · Score: 1

    Or you can just do it the way Guido intended and pass in first class functions. You don't need special notation to pass around references to functions or even bound methods.

    --
    The radical sect of Islam would either see you dead or "reverted" to Islam.
    1. Re:Or you can just use first-class functions. by the+quick+brown+fox · · Score: 1

      Yeah, if only Python had anonymous functions...

    2. Re:Or you can just use first-class functions. by the+quick+brown+fox · · Score: 1

      There's nothing significant whitespace would get you, either, except perhaps terseness.

  90. Re:There's that bloody MVC again by swimmar132 · · Score: 2, Informative

    In Rails, the model is responsible for getting/putting data from/to the database and creating objects used by the controller.

    The controller is responsible for manipulating the objects from the model.

    The view is used to display controller data and to send user data back to the controller.

    It works very well.

  91. Java's answer to Rails: Groovlets! by badmammajamma · · Score: 1

    Groovlets! Groovy, an open source scripting language based on Java, has a component called groovlets which lets you do the same kind of thing except I think groovlets would actually be quicker. Personally, I wouldn't use Rails or Groovlets for serious production work but for rapid prototyping, I'd use groovlets in a heartbeat. Here's some links:

    http://groovy.codehaus.org/
    http://groovy.codeh aus.org/Groovlets

    Pretty slick stuff.

    --
    Any man who afflicts the human race with ideas must be prepared to see them misunderstood. -- H. L. Mencken
    1. Re:Java's answer to Rails: Groovlets! by chadfowler · · Score: 1

      Groovlets, though a refreshing way to not have to risk getting any Java on your clothes, don't at all provide the features of Rails. They are synonymous with Java servlets, which is pretty much the bare metal request/response paradigm, accessible as an API.

      The Ruby equivalent to Groovlets is WEBRick's Servlets. Rails can run on top of this, but it provides a much higher level of abstraction.

    2. Re:Java's answer to Rails: Groovlets! by badmammajamma · · Score: 1

      What difference does it make? Rails doesn't have the scalability of Java J2EE anyway. In my mind, it is at best, .NET level of usefulness. Which means it's great for prototyping and small apps with no concern for a large user base.

      --
      Any man who afflicts the human race with ideas must be prepared to see them misunderstood. -- H. L. Mencken
  92. class Client < ActiveRecord::Base by brlewis · · Score: 1

    What do you do if your app connects to more than one database? How does Rails find the right "Clients" table?

  93. Re:Good for "recipe" queries but little else by stuntpope · · Score: 1

    Zope has a ton of configuration files? You mean etc/zope.conf in your Instance home? Also, I have several production Zope apps connected to PostgreSQL, the setup involved installing the driver (psycopg), then adding LD_LIBRARY_PATH to my Zope startup script. For other production sites, the ZODB works fine. One of my apps uses ZODB for most storage, and LDAP for the user store. Does Rails give me user authentication, session management, LDAP connectivity, a security/roles management API out of the box, or do I have to roll my own?

  94. Re:Good for "recipe" queries but little else by rubyfreak · · Score: 1
    Well actually, that is just about the same thing as I'm doing right now. At work we have a huge web-based administrative app with a feature set that over time increased beyond what I consider manageable, and a DB structure that's been tinkered with so much that it has ended up being nothing but a mess. I.e., the normal state of most intranet apps :)

    Finally, I got fed up with having to fix bugs and add new features, so now I'm in the process of redesigning the entire DB and replacing the old app with a new Rails-based one. So far I'm extremely impressed by the results - after just a few days of development I've recreated a considerable part of the previous app's functionality, but with only a fraction of the code. And the resulting code is _so_ much cleaner! I can't speak for everyone, of course, but for us the rewriting was definately worth the time. And I've been having a lot of fun in the process, too!

  95. Re:class Client ActiveRecord::Base by supavillain · · Score: 2, Insightful

    You can overwrite the default database connection method in individual classes.

    From http://rails.rubyonrails.com:

    "Connection to multiple databases in different models

    Connections are usually created through ActiveRecord::Base.establish_connection and retrieved by ActiveRecord::Base.connection. All classes inheriting from ActiveRecord::Base will use this connection. But you can also set a class-specific connection. For example, if Course is a ActiveRecord::Base, but resides in a different database you can just say Course.establish_connection and Course *and all its subclasses* will use this connection instead.

    This feature is implemented by keeping a connection pool in ActiveRecord::Base that is a Hash indexed by the class. If a connection is requested, the retrieve_connection method will go up the class-hierarchy until a connection is found in the connection pool."

  96. Hard to tell anything.... by a_karbon_devel_005 · · Score: 1

    For the professional programmer, it's tough to tell ANYTHING from this article.

    These trivial example type articles aren't anywhere close to the real domain of much of business software/webapps. Everything in this example is from one simple table with little/no error checking or formatting. Once you start getting into the nitty gritty of things where an entity uses multiple tables and has dynamic and/or very strict error/format checking... will this type of framework actually help you at all?

    Can't tell from this article, unfortunately.

    1. Re:Hard to tell anything.... by andreas1245432 · · Score: 1
      Once you start getting into the nitty gritty of things where an entity uses multiple tables and has dynamic and/or very strict error/format checking... will this type of framework actually help you at all?

      It will... but I agree that it's hard to tell from the simple examples.

  97. Just what I was looking for ... by hostyle · · Score: 1

    please let me know when Ruby on Rails can add one and one together faster than any similar scripting langauge

    --
    Caesar si viveret, ad remum dareris.
  98. Cool but not 10x by mixmasterjake · · Score: 1

    I like the idea, but speeding up my development by 10x I don't think is realistic. Perhaps if i had to start from scratch and make a table editing page. But, no developer who is working full time starts from scratch. I have a bag of tricks just like everybody else. Using datagrids, components, personal code libs, code generators, etc, i can have a basic UI for all tables in a database in a few seconds in any language i want. the harder, more time-consuming part is combining all of it into a usable application. sometimes the framework can help with a simple structure, but becomes a burden with complicated relationships and things that don't directly map to the table fields.

    Its the same problem with ORM solutions. the easy stuff is easier, but the harder stuff can be even harder.

    --
    TODO: come up with a clever sig
    1. Re:Cool but not 10x by ArtStone · · Score: 1

      Isn't this kind of just a classic example of the 80/20 rule?

      Sure you can get a nice prototype out very quickly - but as soon as you hit the 20% of the task that can't be done within the model of the framework, you get to start doing the other 80% of the work.

      Hopefully people estimate their contract based on the 80% of work and not the first 80% of results.

      --
      Final 2006 "Proof of Global Warming" US Hurricane Count -> 0
    2. Re:Cool but not 10x by mixmasterjake · · Score: 1

      exactly.

      --
      TODO: come up with a clever sig
  99. Can't Jack into my database by Free_Trial_Thinking · · Score: 1

    Everything went fine until page 3 of the tutorial when I try to access http://127.0.0.1:3000/recipe/new

    It tells me this error:
    Mysql::Error in Recipe#new
    Access denied for user: 'gregory@localhost' (Using password: YES)

    I want it to log on with user gregory with a password. I set up everything in the database.yml file but still no avail? Any ideas?

  100. Re:There's that bloody MVC again by Zangief · · Score: 1

    Because it makes sense, in web development at least (I'm not into Java Swing).

    In web development, generally you have some webpages, that can call some methods that change something in a database. You don't need a complex OO hierarchy, You just need to know that, from page A you can call methods mA and mB, and depending on results, you can go back to page A, or page B or C.

    So MVC is just natural.

    I can't talk for other frameworks, since I have only worked with struts and spring. But you never touch this "monolithic" controller, since it comes with the framework, and it's simple, yet flexible.

    You normally just create a xml file which has the info on which methods are asociated with which views. Most of the application flow is in said xml, so your business logic is pretty insulated.

    You still need some basic controllers, since the big controller just gives you raw requests, or, at best, a java bean, so it may need some transformation before it goes to business logic, or back to the view.

    In conclusion, MVC is just the natural way to do web development.

  101. WebObjects can do that with no code. by MacDork · · Score: 1
    Sir, may I ask you exactly how you're going to get your Java framework of choice to connect, comprehend, and dynamically bind to a SQL table in only 2 lines of code?

    You have to write code? WebObjects can handle a basic task like that with no code. Have a look. I mean, I guess if you want to count the project templates, there's code in there somewhere. It's very simple really: Create a project, select a model file, and build immediately. You don't even have to know any SQL. EOModeler will create the tables for you. Relationships are cake: just a string of names.connected.with.dots. Serve it up with a web browser or a Java WebStart client. Oh, and the developer version is free, just like the rest of Apple's developer products.

    Having said that though, this Rails thing sounds pretty nice too. It should be a real boon for those among us who already know a little bit about Ruby.

    :-)

  102. Re:For Python, CherryPy is another simple framewor by idlemachine · · Score: 1
    I think that I am going to give Ruby a pass, at least for now.

    As much as I love Ruby, the Python libraries just seem to be, at present, a lot more immediately useful to me than the Ruby ones.

    Knowing that Matz is working on 'Rite', intended to be 'Ruby 2', has helped me hold off. (Although perversely, GvR discussing Python3000 hasn't had the same effect.)

    But whichever language you choose, you've got to have some respect for a designer whose motto is "I work very eagerly to be lazy" :)

  103. Nicely written tutorial but what about Unicode? by JuliaNZ · · Score: 1

    I hadn't realised that Ruby/Rails has very weak Unicode support. I worked my way through the (excellent) tutorial and discovered that when you enter any unusual characters (e.g. something really dastardly like "café"), either Ruby or the Rails framework silently drops that character and everything after it on the floor.

    I thought at first that it must have been MySQL's fault but a few experiments show that MySQL 4.1 will happily store and retrieve high-order characters.

    This would seem to limit Ruby/Rails a bit for real-world stuff, wouldn't it? I assume you can still go and develop your own classes that handle UTF-8 correctly but that cuts down the appeal a bit.

    There's some nice ideas in there, but I think I'll stick to Python and the very nice CherryPy 2.0.

  104. Not that big of a deal by SlightOverdose · · Score: 1

    From what I can gather, Ruby on rails is essentially two things-

    1. a Model-View-Controller framework
    2. an object-relational mapping framework.

    I've build similar functionality in most languages I've worked with. I've recently built a php5 framework in about 20 hours work that seems to do everything RoR does (albiet it's not as nicely polished).

    So other than the fact that Ruby (Being similar in philosophy to python) is much nicer than most other languages, can anyone explain whats so great about this framework (i.e. what sets it apart from every other MVC and O-R mapping out there).

    (This post is not intended to attack RoR- As the lead developer at a small software development company I'd seriously like to know).

  105. Oh hey, a WO developer by Paradox · · Score: 1

    Wow, I'm surprised to find a WebObjects developer responding. I figured the few remaining WO developers were all hiding ina Y2K bunker somewhere wondering if it was safe to crack the hatch yet, or something. :)

    Seriously though, Rails does things differently from the typically NeXTSteppish way that WO approaches the problem. And there is code, but it's generated, which is the same case with Rails. You didn't think you normally wrote those little two lines did you? Of course not. You generate it and only modify it if you need something special.

    But WO is probably one of the only web development frameworks that I can think of that comes anywhere close to Rails.

    --
    Slashdot. It's Not For Common Sense
  106. Wait for your messiah before mouthing off. by Paradox · · Score: 1

    All this sh!t has not been done already. Until Perl 6 is ready for primetime, it's nothing compared to Ruby or Python. Perl 6 looks very promising, but I can develop Rails apps today, and have them up-and-running in just 10 minutes.

    Maypole doesn't even come close to matching Rails. I have all kinds of respect for Perl developers, because I was one. But like you said, "We need programmers to act sensibly and use the right language/framework for the job at hand."

    Ruby and Rails are those frameworks for now.

    --
    Slashdot. It's Not For Common Sense
  107. Re:There's that bloody MVC again by fforw · · Score: 1
    You normally just create a xml file which has the info on which methods are asociated with which views. Most of the application flow is in said xml, so your business logic is pretty insulated.
    I never really understood the reasoning for defining the application flow in an XML descriptor.

    Insulation or separation is nice but against what do you want to insulate your application flow?

    You normally want to prevent the web documents itself managing the application flow thus leading to an incomprehensible mess of cross invoking documents.

    Then why not define the application flow in code?

    --
    while (!asleep()) sheep++
  108. Re:There's that bloody MVC again by fforw · · Score: 1
    [...] Note that views were strictly one-way in this model -- all program logic was done through the controller, which had to be aware of all the views being used in order to generate the right inputs. In other words the Model was the program state, the view was procedures for displaying model objects, and the controller did absolutely everything else.

    How on earth this antiquated model stuck and transferred to web applications is beyond me. It shares almost nothing in common, except for a very under-specified "controller" class that has the very simple job of "doing everything except rendering". MVC is about as meaningful as "client/server" these days.

    As an author of such a MVC webapplication toolkit and runtime engine I asked myself similar questions in the early design phase. But my answers to these questions seem to be different from yours:

    It is not true that the traditional Views were "strictly one-way". Where do you think the controller got its events from? Buttons and other controls embedded in the views.

    The Controller of a webapplication receives the requests the user makes, associates the stateless requests with a session, interprets the semmantics of the specific request in the webapplication and send the appropriate view back to the client. Sounds to me very similar to the classic MVC.

    MVC is primarily used in web application descriptions to distance them from a purely page-based structure. I highly doubt that this waters down the MVC term to the level of "client-server".

    --
    while (!asleep()) sheep++
  109. Re:There's that bloody MVC again by Zangief · · Score: 1

    While I'm not very fond of using XML for everything, here it can be useful (although not totally necessary).

    You normally want to prevent the web documents itself managing the application flow thus leading to an incomprehensible mess of cross invoking documents.

    Then why not define the application flow in code?


    For the very same reason, so you don't have to follow your flow through an incomprehensible mess of cross invoking code. Of course, for small applications, it just a hassle. You can keep the flow in few source files. I myself did it in my last project, where there were only 7 pages, and everything was like "from page A to B, to finalPage", "from page C to D, to finalPage".

    But once your application grows, it will be nice to have the flow centralized, so you can know, just looking at one file, where do you go from one page to the other.

  110. Re:You're just dumb... by renoX · · Score: 1

    OK, your version is better than his Perl version, but it's still far less readable than his Ruby's version..

  111. Ruby and Python look almost the same in this case. by shampster · · Score: 1

    Here was the ruby version:

    class Foo
    attr_accessor :a, :b
    def add() a + b end
    end

    f = Foo.new
    f.a = 1
    f.b = 2
    puts f.add

    Here's the python version:

    class Foo:
    def __init__(self):
    self.a = 0
    self.b = 0
    def add(self):
    return (self.a + self.b)

    f = Foo()
    f.a = 1
    f.b = 2
    print f.add()

    ... pretty similar, no?

    And for those of you who like things compact:

    class Foo:
    def __init__(self): self.a = self.b = 0
    def add(self): return (self.a + self.b)
    f = Foo()
    f.a, f.b = 1, 2
    print f.add()

    --
    aXV1cTswMDR5dS9wc2gwYnFxew
  112. Its possible to install Ruby without root access by inventric · · Score: 1

    It would be great if more ISP had Ruby preinstalled, but it is possible to install Ruby/Rails without having root access to your webhost. As long as they have CGI, and Apache configured right. I have posted a tutorial on how to setup Ruby/Rails at my host, www.nicewebhost.biz.

    This was my first Slashdot post ever. I hope I didn't break every rule.