what exactly is ruby?

Discussion in 'Web Design and Development' started by tominated, Apr 25, 2007.

  1. tominated macrumors 68000

    tominated

    Joined:
    Jul 7, 2006
    Location:
    Queensland, Australia
    #1
    I have been wondering for a while. what exactly is ruby? All i know is that it is for the web and is 'cool'. Can someone give me a quick description, or a link to one. BTW: if it has anything to do with php, i think i am kinda stuffed (don't have a clue how it works)
     
  2. TheAnswer macrumors 68030

    TheAnswer

    Joined:
    Jan 25, 2002
    Location:
    Orange County, CA
    #2
  3. Mr.Texor macrumors regular

    Joined:
    Apr 20, 2007
    #3
    Ruby is a programming language. They compare it to perl, smalltalk, python, and some other. it's supposed to be really good. Sooooo, some people got together and created a web application framework with it called Ruby on Rails. It's suppose to be really easy and fast to create web apps with it.

    the ruby language page is here:
    http://www.ruby-lang.org/en/

    and ruby on rails was already linked :)
     
  4. iMeowbot macrumors G3

    iMeowbot

    Joined:
    Aug 30, 2003
    #4
    It's yet another interpreted programming language, what you might end up with if Perl had properly integrated OO features, or Python had brackety syntax.
    Ehhh, not really. The Rails framework has made Ruby popular there, but it's really a general-purpose language, not really a Web specialty like PHP tries to be.
    Not so sure about cool, but the Ruby community certainly has evolved itself into quite the hype machine over the years.
    Straight from the horse's mouth.
    It's not the prettiest language IMHO, but it's much less hideous than PHP.
     
  5. angelneo macrumors 68000

    Joined:
    Jun 13, 2004
    Location:
    afk
    #5
    Oh, this is interesting, I have heard so much about ruby and ruby on rails, what are your opinions about this language? So far, I have not tried it at all but I am open to new ideas. Does it really live up to it's hype?
     
  6. Nicolasdec macrumors 65816

    Nicolasdec

    Joined:
    Dec 7, 2006
    Location:
    São Paulo
  7. epochblue macrumors 68000

    epochblue

    Joined:
    Aug 12, 2005
    Location:
    Nashville, TN
    #7
    The two are remarkably different. HTML is what's called a Markup language (no real logic or control structures) and is definitely NOT a programming language, whereas Ruby is a full-on dynamic scripting language and most definitely IS a programming language. From what I understand, Ruby is pretty easy to pick up and reads a lot like English, but trust me when I tell you that it's NOTHING like HTML.
     
  8. rogersmj macrumors 68020

    rogersmj

    Joined:
    Sep 10, 2006
    Location:
    Indianapolis, IN
    #8
    It is not hard to learn the basics of Ruby (on Rails). Basic applications can be created in no time. For my first Rails app, I made an inventory tracking system in about 6 minutes.

    The harder part comes when you need to break out of the regular single-object read-write-update-delete mantra. To work most efficiently in Rails, you need to both understand Ruby and understand the shortcuts going on in the backround of Rails to properly take advantage of the framework. I'm sort of in the middle of that period now. It can be frustrating, but once you discover something it's very cool and from then on it saves you a lot of time.

    Overall, it's much faster to build using the Rails framework than PHP, for example, as long as you like keeping things organized and can follow conventions.

    And no, HTML is not a programming language. Knowing HTML helps you program about as much as knowing how to use Microsoft Word does.
     
  9. iceprincess0966 macrumors newbie

    Joined:
    Jul 13, 2006
    #9
    I've been wondering about this too. I have been writing various scripts in Perl for a little over a year, and incorporating them into websites with Mason components, but sometimes I feel like I'm miles away from being on the "cutting edge" (much less the bleeding edge) of technology because PHP is practically the standard these days, and then there's all the object-y stuff to make your sites all snazzy and glossy and interactive.

    The web development company I work for is very committed to making sure our sites still work on older (read: IE6) browsers, and with Javascript turned off, and without plug-ins. Our tech guy is also very concerned about security problems with these new-fangled things, because people are writing and implementing scripts without really knowing how they work.

    Given my constraints of making sites that work for everyone, is it worth it to try to learn the latest "language of the week", or should I stick with what I already know and get better at it instead?

    http://www.korora.com
     
  10. Lyle macrumors 68000

    Lyle

    Joined:
    Jun 11, 2003
    Location:
    Madison, Alabama
    #10
    While Rails provides developers with a framework for using "new-fangled" things (such as Ajax-based user interfaces) it certainly doesn't require that you use them. So I don't believe that switching to Rails would inherently introduce new security or backwards-compatibility related problems.

    One of the reasons that Rails has really taken off over the last few years is that web developers who are experienced with PHP and Java claim that they're much more productive when using Rails. While I can sympathize with your reluctance to invest too much time in the "language of the week", I think it's safe to say that Rails is worth your time to at least experiment with. I'm currently reading "From Java to Ruby" (by Bruce Tate) and it's written more from a manager's perspective about the pros and cons of moving to Ruby (and specifically Rails). Although he specifically calls out Java in the book's title, so far it seems that most of his arguments would apply to PHP or other legacy web development platforms.
     
  11. radiantm3 macrumors 65816

    radiantm3

    Joined:
    Oct 16, 2005
    Location:
    San Jose, CA
    #11
    Really? Ruby is very clean and the syntax is very readable. I'm not sure what your definition of a "pretty" language is, but I find ruby code to be one of the easiest to read.
     
  12. Mantat macrumors 6502a

    Joined:
    Sep 19, 2003
    Location:
    Montréal (Canada)
    #12
    First of all, I am a Ruby (and RoR) Zealot...

    Ehh.. Ruby has one of the most elegant syntax possible! Passing blocks of code can be confusing at first but it is so much powerful that once you know about it, you wonder how you lived without!

    Also, Ruby as a lot of idiomatic coding, logical default values, etc... I was coding in Java before learning about Ruby and now I deserted java because I find it ugly. Not as ugly has objectiveC, but still...

    Ruby and Ruby on rails require more thinking from the developper than other language such as PHP because the framework encourage you to think and come up with a good design. If you do so, you get A LOT of code for free, and that is why a lot of good programmers are embrassing RoR so much. You have to know about MVC, REST, OO to really appreciate RoR.

    Each language has a target audience and mantra. R and RoR are the only ones who are made to maximize programmers happiness. This sound cheesy but its true! By doing less coding more thinking you get:
    - a better design
    - less code to maintain (which increase happiness!)

    With a knowledge of database design and some scaffolding you can come up with a complete webapp in under 10mins. And 10 more and you can add autocomplete, validations, and more AJAX crazyness. Of course, a lot of the stuff will be missing, but it will be a working prototype that you can then either modify or rebuilt from scratch.

    The real challenge when learning RoR isnt as much as learning Ruby as it is to learn good application design and how/where to apply them.
     
  13. ChrisA macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #13
    Is it anythign to do with PHP? It's sort of a replacement for php but Ruby can also work outside of a web enviromment. (technically so can php but no one does that)

    The language itself, be it Ruby, Python, perl or even C is not a big deal they are all close enough and differ only in details What's different and what matters is all the "stuff" that comes with and is built on top of the language.

    For example Java. It's a simple language but you add it Java Beans and a billilon other APIs. With ruby. "rails is the big deal, ruby is the glue that conects big of it. In fact I could image a "pyton on rails"
     
  14. Lyle macrumors 68000

    Lyle

    Joined:
    Jun 11, 2003
    Location:
    Madison, Alabama
    #14
    I agree that the standard library (and the selection of third-party libraries) are a significant consideration when choosing a programming language, but that's definitely not the whole story. Another important consideration is how readable and maintainable the code is, given that an overwhelming majority of the cost of software development is spent in maintenance. As radiantm3 noted, many developers (including myself) who've worked in a variety of programming languages find Ruby code very expressive and extremely easy to read. And as Mantat pointed out, Ruby code is, generally speaking, more concise (and less code means reduced maintenance costs).

    You wouldn't be the first... :D
     
  15. Nicolasdec macrumors 65816

    Nicolasdec

    Joined:
    Dec 7, 2006
    Location:
    São Paulo
    #15
    I whant to start learing Ruby. What are good website that will teach me how to use it. also what do i need to start learning it?
     
  16. Lyle macrumors 68000

    Lyle

    Joined:
    Jun 11, 2003
    Location:
    Madison, Alabama
    #16
    Given that you're new to programming, I would recommend Chris Pine's book Learn to Program. (Although the book is a general introduction to programming concepts, Chris uses Ruby as the programming language.)

    For folks who have done some programming, start at the Ruby home page and perhaps go through the "Ruby in Twenty Minutes" quickstart tutorial found there.
     
  17. Nicolasdec macrumors 65816

    Nicolasdec

    Joined:
    Dec 7, 2006
    Location:
    São Paulo
    #17
    ok cool thanks.
     

Share This Page