From: ptkwt@... (Phil Tomson) Date: 2005-08-03T02:01:05+09:00 Subject: Re: Factors to consider for choosing Ruby? In article <1122967180.462776.134970@g49g2000cwa.googlegroups.com>, francisrammeloo@hotmail.com wrote: >Hi all, > >At work I have received an assignment where I have to parse textfiles >containing textual description of user interfaces and generate C++ code >to create the GUI. >I decided to try out Ruby for this job and I never regretted. It does >an excellent job parsing the textfiles. This is the first program I'm >doing in Ruby and I've already fallen in love :) Ahhh, another Ruby-smitten programmer. Welcome! > >Now I'd like to use Ruby more in the future and I wonder how wide the >scope of Ruby is? Ruby has proven to be an ultimate candidate for >textual problems and I'd like to know if it's useful in writing larger >applications. > >Currently I program mostly in C++ because I can do anything with it. >I'd like to do more in Ruby. > >When should I choose Ruby? When should I stick to C++? Use Ruby for programs you need to get done quickly and where performance isn't an issue. Use C++ for programs that need to run fast with schedule being less of an issue. You can mix to two as well and use C++ for the fast bits and Ruby for everything else. You can even define classes that have some methods defined in C++ (for performance reasons) and others defined in Ruby. Look into Swig (http://swig.org) for wrapping existing C++ code. You'll probably find that you can implement 80% of your functionality in Ruby and 20% in C++. That said, though, I used to be rather negative about C++, but now with a lot of the newer template programming techniques (check out the C++ Templates book or the one on template metaprogramming) as well as the advent of the Boost libraries I'm finding my forays into C++ interesting again. Phil