Factors to consider for choosing Ruby?

  • Thread starter francisrammeloo
  • Start date
F

francisrammeloo

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 :)

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++?

I realise this question is hard to answer, but I will be thankful for
any helpful hints.

Best regards,
Francis
 
B

Brad Wilson

------=_Part_4415_25698444.1122973674658
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Ruby can be used pretty much anywhere where you'd use C++ today. In my mind=
,=20
it's better at some things than others. I wouldn't hesitate to use it for=
=20
utility apps, like you're doing. I'm also extremely fond of Rails for makin=
g=20
web apps. However, I will rarely choose Ruby to make GUI applications,=20
mostly because I'm not familiar with any of the typical GUI toolkit binding=
s=20
(like Gtk).

As you implied, what you choose will depend a lot on what you're comfortabl=
e=20
with. If you want to write web apps with Ruby, you'll probably want to=20
investigate Rails. Once you become comfortable with it, will you choose it=
=20
over some other tool? Maybe. :)

=20
When should I choose Ruby? When should I stick to C++?

------=_Part_4415_25698444.1122973674658--
 
D

david

Cit=E1t Brad Wilson said:
However, I will rarely choose Ruby to make GUI applications,=20
mostly because I'm not familiar with any of the typical GUI toolkit bin= dings
=20
(like Gtk).
=20

Eww, Gtk ;P My quirk is mainly the fact wxRuby isn't quite up to speed wi=
th
lessay wxPython, and all the other toolkits are guilty of my pet peeve -
emulating widgets even when native ones are available. Which always ends =
up in
a plethora of problems, ranging from looking incredibly ugly (and yes, th=
at
matters a lot) to rendering badly - text overflowing when the person who =
tried
to recreate the native look-and-feel sort of didn't think someone would e=
ver
change the default font size.

Otherwise, I wouldn't say scripting languages are any unsuited to GUI wor=
k. The
other day I was thinking of making a sample solution for an introductory =
OOP
course I'm doing in Java / SWT, and I gave up an hour later to switch to =
Python
and wx, which ended up looking nice and purdy and native on XP as a bonus=
 
R

Richard Lyman

=20
Eww, Gtk ;P My quirk is mainly the fact wxRuby isn't quite up to speed wi= th
lessay wxPython, and all the other toolkits are guilty of my pet peeve -
emulating widgets even when native ones are available. Which always ends = up in
a plethora of problems, ranging from looking incredibly ugly (and yes, th= at
matters a lot) to rendering badly - text overflowing when the person who = tried
to recreate the native look-and-feel sort of didn't think someone would e= ver
change the default font size.
=20
David
(ikkle newbie in disguise)
=20

I haven't had any problems with FXRuby... that's about all I do in
Ruby - code GUI stuff. Yes win32 is my main target platform, yes I'm
not that bothered by the whole non-native thing, and most importantly,
yes I can code up a front-end to a program in a few hours since FXRuby
feels very ruby-esque and flows very nicely with everything else.

-Rich
 
P

Phil Tomson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top