Ruby programming language

This is a discussion on Ruby programming language within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I am learning Ruby language. I think C programming is much harder. Ruby is more like Perl...

  1. #1
    Registered User t3chn0n3rd's Avatar
    Join Date
    Dec 2007
    Location
    kansas city
    Posts
    25

    Ruby programming language

    I am learning Ruby language. I think C programming is much harder. Ruby is more like Perl

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    It's a bit like cooking - if you buy a ready-mix, you don't need to know quite so much, but you still need to know a bit. Higher level languages are the ready-mix of programming. There's nothing wrong with that - if you can achieve what you want in a few lines of Perl or Ruby, and it performs the task quickly enough to provide you with reasonable performance - fine. I've written web-programs in PHP, which is another similar high-level language.

    C is more complex, because the language itself is more powerful - it's the raw ingredients, so you need to know what you are doing mixing eggs with flour and milk to make pancake mix - and if you get it wrong, you get lumps and too thick mix, and the pancakes are awful. Sure you can get it wrong with the ready-mix too, but it's a bit easier to get it right because there are fewer components involved.

    With assembler, you're grinding your own flour and hatching your own chickens ...

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Katy, Texas
    Posts
    2,309
    Ruby rocks. Probably my favorite language. But, it has it's place, and in the world of speed requirements, it doesn't do too well.

    As an example, last year I wrote a Ruby script to read some large files and convert them from one encoding to another. It took 21 minutes to process the 136MB file with Ruby. It worked great, but it was too slow for the client. I wrote a C++ app to do the same thing and was able to get the processing time down to 10 second for the same file.

    But, it's a great language.
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

  4. #4
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,487
    It is also an excellent learning tool for a different programming paradigm. Much more accessible to the masses than smalltalk, perl or lisp, IMHO.

    Frankly I'm surprised as how this language evolved in such short time. If I remember correctly, it was rudely criticized by many when of its inception.

    EDIT: BTW, this should be on some other forum. Maybe Tech or GD
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #5
    Disrupting the universe Mad_guy's Avatar
    Join Date
    Jun 2005
    Posts
    258
    For the most part it isn't that bad of a language. The metaprogramming is quite nice as a feature and in certain instances invaluable. Probably one of the more interesting things IMO.

    (If you're interested in a language with similar amounts of dynamism, I cannot point you anywhere other than Io. Prototype-based objects, message based like smalltalk, differential inheritance, portable, extremely dynamic, and a lot of fun to play with. Unfortunately, it hasn't had a stable release yet so bugs are prone and you probably shouldn't write your next major commercial app since things are bound to change, but I absolutely recommend it for experimenting.)

    The major gripe I have with ruby is that the current implementation sucks in relation to speed. And I mean it really sucks. Speed is in almost every other case a negligible thing as far as I'm concerned, but a lot of pure ruby code really just performs poorly and there's no way around it other than using modules that're already written in C (which is a valid way to cut runtime by half in certain instances, don't get me wrong.) I am extremely happy with my mail client, Sup, but as a pure-ruby app, it really performs poorly on large volume mailing lists it's stated to handle well (see: linux-kernel mailing list.) I wouldn't give it up for an alternative though, because it seems to have really gotten threading and management of threads right.

    In any case, having such massive slowdowns in some instances is nothing but annoying and makes me think less of the language when the major implementation performs so badly (if you want an idea, albeit the benchmarks are somewhat flawed, look here. Ruby is next to last, trumped only by prolog (for gods sake, javascript has had some of the WORST implementations of any language, ever, and it's beating it.))

    I am thoroughly happy for Rubyists everywhere though, since Ruby 1.9 will sport bytecode compilation and that should speed things up drastically (in certain places up to 70&#37; increases from what I've heard.)

    In fact, the main reason I really don't use Ruby is because I really like my static types. A lot. The only other major dynamically-typed language I would say I like and really use is Perl. After 1.9 has made an official release and gained some ground, I'll definitely have to take a look again. Until then, check please.


    Big edit: and after reading Rails is a Ghetto after it's initial publication (which I suggest you read if you haven't, it's a very good article,) I have to say it put a major distaste in my mouth for Ruby in general when even a fragment of the community - the Rails one - can act such a way. Will I never ever write ruby because of it? Probably not, but it certainly taints the 'ruby shine' if nothing else.
    Last edited by Mad_guy; 02-11-2008 at 09:31 PM.
    operating systems: mac os 10.6, debian 5.0, windows 7
    editor: back to emacs because it's more awesomer!!
    version control: git

    website: http://0xff.ath.cx/~as/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Language - When To Use What?
    By tjinr in forum A Brief History of Cprogramming.com
    Replies: 36
    Last Post: 08-06-2006, 02:04 AM
  2. What language did they make Java in?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 07-03-2005, 04:18 PM
  3. Strange loop
    By D@rk_force in forum C++ Programming
    Replies: 22
    Last Post: 12-18-2004, 01:40 PM
  4. Language of choice after C++
    By gandalf_bar in forum A Brief History of Cprogramming.com
    Replies: 47
    Last Post: 06-15-2004, 01:20 AM
  5. Languages dying
    By Zewu in forum A Brief History of Cprogramming.com
    Replies: 31
    Last Post: 07-29-2003, 10:08 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21