14

I already developed some simple applications in Rails (just to test) without any knowledge of Ruby, but now I want to change my life. I'm going to start learning Ruby (and never learn Rails for some personal reasons) and focus only on it, but before doing this I need tp know some things:

  • How can I build GUI applications with it?
    • It's possible to use GTK with it?
    • Where to download?
  • Pros and cons of Ruby compared to Perl and Python?
  • Pros and cons compared to C# and other .Net languages?
  • How is the market of Ruby (without Rails) today?
  • Where to be updated with the latest news (podcasts and blogs) of the Ruby world?
4
  • 4
    Ruby was a full language before Rails, it just seems that RoR made Ruby more popular. But, as was pointed out, there seems to be little use for just Ruby, but knowing Ruby well makes you a better RoR developer. Why focus just on Ruby, why not a language that is more commonly used? Nov 29, 2009 at 3:25
  • 1
    Just FYI, this is hands down the best ruby book I have run across. manning.com/black2 Worth its weight in gold if you are interested in digging deep Nov 30, 2009 at 22:46
  • Look into WxRuby. Cross platform GUI toolkit that is native looking on whatever platform you are on. I have yet to do any coding with it, but it's on my learning todo list
    – Earlz
    Nov 30, 2009 at 23:16
  • I think it should be noted that although you write less code in ruby.. Ruby isn't compiled so ruby developers have to give away their source code for desktop apps. Which is why people consider ruby more as a secondary tool than a primary. Oct 8, 2014 at 20:38

8 Answers 8

16

How can I build GUI applications with it?
It's possible to use GTK with it?
Where to download?
Pros and cons of Ruby compared to Perl and Python?
Where to be updated with the lastest news (podcasts and blogs) of the Ruby world?

I hope you realize what the problem is with your post.


How is the market of Ruby (without Rails) today?
Ruby isn't that widespread in the professional world even with Rails being considered. Outside of Rails it's going to be rather tough to get a position using it.

0
3

It is extremely difficult to find a purely Ruby job, not that many companies know it well enough let alone have specific apps built in it. But that's not to say that the jobs don't exist, you just probably need to be a bit of an expert to do it.

But if you're really gung ho about doing pure Ruby work (and I can't blame you for it at all) I would look at the job market for automation and testing where there's no specific requirements about the language you use or at the system administration market where you're allowed to script in whatever language you want. You could always define your own market though, it's a handy thing and more and more Ruby projects are cropping up all over the place.

Ruby is strongest because of its frameworks and because there are a lot of really smart people doing it. Look into the frameworks that are available to you such as Shoes, capistrano, Rails, and see if there isn't something non-web that still appeals to you.

3

I find the most dramatic comparison is showing the terseness in ruby. Comparing this

class Foo
  def self.bar
    puts 'bar'
  end
end

Foo.bar

to

using System;

namespace Blah
{
  public class Foo
  {
    public static string Bar()
    {
      Console.WriteLine("bar");
    }

    public static void Main(string[] args)
    {
      Foo.Bar();
    }
  }
}

They both say the same thing, just one does it in 6 lines and the other does it in 17. This is not a contrived example (the contrived example is to do it in one line in ruby with puts 'bar'), generally someone will write 2-3x more code to accomplish the same task in C#.

That is the tip of the iceburg (mixins, dynamic dispatch callbacks, object individuation, duck typing, and a killer introspection api are probably my favorite things), but I find this example is the easiest to grok for someone without any real experience in modern scripting languages.

4
  • 3
    If you would have used K&R-style braces instead of Allman-style, you could save 4 lines in the C#. That's better, but yeah, it is still definitely wordier. Nov 30, 2009 at 23:39
  • 3
    And you could save an additional three lines by not including a namespace and using the K&R style of braces would bring the additional line count to only 3 if you remove the additional lines and such... By the time that you factor in Visual Studio intellisense though I doubt you really have THAT many additional keystrokes that are required.
    – Jared
    Apr 28, 2012 at 19:16
  • My problem with these types of comparison is that class boiler plate and writing to console does not make up such a large portion programming. Nov 27, 2017 at 16:44
  • You can also write your first example in one line: Foo = Class.new { define_singleton_method(:bar) { puts 'bar' } } and then call Foo.bar to write bar!
    – S.Goswami
    Sep 13, 2019 at 19:08
2

If you find it, call me

If you do find a place to get a Ruby development job, please drop me a note so I can move there and work with you. Sadly, I don't think such a place exists, though Rails jobs seem popular in my area.

Now, Ruby is currently in the top 10 (barely, as #10) in the Tiobe Index. That's remarkable for a new language and it's probably all due to Rails. Ruby has been holding steady and may beat VB someday. Ruby is well-regarded technically so it is safe to assume that some day in the future there will be Ruby development jobs. This may take a long time, and they may always be Rails or Rails-like jobs, as web applications may well continue to replace everything else.

(An OS is coming out, Chrome, that only runs web apps.)

However, Python, Perl, and PHP all beat it, so you are presumably more likely to find employment working on them, or on Java or C*. Since I can't imagine anyone willing doing straight-PHP work, it's safe to assume that all of the PHP activity is in web programming, and in that case it's even safer to assume that all the Ruby work is web app work.

2
  • You could choose a workplace that's language-agnostic, such as a bioinformatics facility. Also, see stackoverflow.com/questions/150638/ruby-off-the-rails Jun 9, 2010 at 23:18
  • Ruby is a new language? Compared to what, Fortran? Not sure if it's worth changing the answer over, still it's a bit misleading. I mean, Ruby has been around before the first C++ standard was released.
    – Cubic
    Oct 4, 2014 at 13:22
1

One option is to sneak Ruby in by stealth:

  • Use a "hard and soft" layers architecture - use JRuby to configure and assemble a custom configuration of existing Java components. After all, from the outside it all looks like Java...
  • Use Ruby for tooling and sysadmin work
  • Use Ruby for non-critical, internal apps - where nobody cares much about platforms - just that it doesn't cost too much or take much time.

The original business case for adopting Ruby on Rails in one of my previous jobs was that the Java option would take too much time - so we were allowed to explore other alternatives... That kind of pressure acted as an incentive for the business to let us consider other technologies.

0

Ruby got a lot of credibility with software engineers as an interesting language to consider when people like the Pragmatic Programmers and Martin Fowler started talking about it as a great language to think in.

I'm using Ruby as a code generation language in my rewrite of AppMaker. The decision was influenced by them and by the book Code Generation in Action.

You can use Ruby to do native GUI's with Cocoa (Ruby projects are templates available in the latest XCode, right alongside other application templates). Dynamic language support is a hot topic in the .Net space with IronRuby being supported in SilverLight for web client-side programming as well as being a significna language

It's early days and I don't think there will ever be a career market for it like C# or Java but momentum is building.

0

Take a look at MacRuby. It's an implementation of the language with a nice Ruby style interface to Cocoa.

Ruby seems to be a natural fit for Cocoa because its OO implementation is based on the same message parsing model than Objective-C.

0

I hope this doesn't annoy you all too much, but I was thrown into ruby as an intern at Yahoo! And I really loved it. Now I'm also learning rails on my own, just for fun.

What I love about ruby is:

  • Blocks!
  • Nokogiri, just because it makes my particular task at Yahoo! a lot easier.
  • The foo?() convention for bool functions
  • The []= operator and the member=() syntax
  • Calling functions without parentheses
  • attr_reader, and the like

I know a guy who changed job just to get more ruby experience. His plan is to start a consulting firm, making stuff in Ruby. Ruby rocks!

3
  • Why would you love calling functions without parentheses? That sounds like it would be devastatingly difficult to read. Nov 30, 2009 at 23:45
  • If I never used them, yes it would. But in some cases, like with attr_reader and often in rails, its just as readable without them. Dec 1, 2009 at 0:15
  • there is no such thing as a public field in ruby, so there is no confusion by leaving off the parens. Unless you just enjoy typing () all the time Dec 1, 2009 at 1:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.