Ruby vs Java vs c++

hi, newbie so please be tolerant… :wink:

i need to start to learn a programming language to be able to develop
custom aps to be applied to a variety of purposes but mainly 1)
financial
data modeling–including graphics and data handling via database
queries,
etc.; and 2) more general business-type aps.

my feeling is that i hate BLOATED sluggish programs (like some Java
program running on older JVM’s and perhaps not written in an optimal
way…u get the idea.)

if i need to make a choice between fancy and efficient,
speed, etc., then it’s an easy choice 4 me of efficient.
which is why i have just started w/ c++.

however, speaking to one my programmer friends who is a top level Java
programmer (the stuff he writes is very efficient and fancy as
well–great balance), he is telling me that 1) c++ is being phased out
(except 4 real low level stuff like drivers, etc.) in favor of languages
such as Java or Ruby. he recommends i switch from learning c++ to
learning
Java or Ruby. i wd hope to be able to choose the best path and not have
to
switch tack in the middle as my IT capablity is not a full time
activity,
but more of a support 4 my main one–finance.

of course, learning curve is to be taken into consideration as well…

'd love some comments that might help me consider my options and pick a
path (c++, java or ruby) w/ a higher level of confidence… i know
that
people here will be biased towards Ruby, but that is fine: i want to
hear
about it…

n/a wrote:

hi, newbie so please be tolerant… :wink:

You can count on it.

i need to start to learn a programming language to be able to develop
custom aps to be applied to a variety of purposes but mainly 1) financial
data modeling–including graphics and data handling via database queries,
etc.; and 2) more general business-type aps.

my feeling is that i hate BLOATED sluggish programs (like some Java
program running on older JVM’s and perhaps not written in an optimal
way…u get the idea.)

I have rather a lot of experience with Java, and it’s not easy to avoid
the
bloated aspect, if the program has a GUI. The problem is the GUI, not
the
code. It is made worse when the GUI code is written in java, nearly
always
true.

Ruby, by contrast, uses native-code GUI libraries, so it tends to be
faster
as a GUI based language. It is certainly easier to modify and debug than
Java is, because of its transparent syntax.

if i need to make a choice between fancy and efficient,
speed, etc., then it’s an easy choice 4 me of efficient.
which is why i have just started w/ c++.

C++ is only efficient when it is running. It is not efficient when you
have
a deadline to finish a project and deliver working code.

The basic idea is this – if the program is only written once and is to
be
used by millions of people, then definitely use C++. If the same program
is
to be written in a million variations over a period of years and only
used
by a handful or people, then definitely Java or Ruby.

The middle cases require more experience to decide. In such cases, I
sometimes prototype in Ruby, because development is so fast, and then
translate the result from Ruby into C++ once I have a working program,
so
the delivered program will be fast.

however, speaking to one my programmer friends who is a top level Java
programmer (the stuff he writes is very efficient and fancy as
well–great balance), he is telling me that 1) c++ is being phased out
(except 4 real low level stuff like drivers, etc.) in favor of languages
such as Java or Ruby.

This viewpoint would be very difficult to defend. C++ isn’t remotely
being
phased out. C++ has its niche, as does Java and Ruby, etc. etc…

he recommends i switch from learning c++ to learning
Java or Ruby.

You will most likely learn more about programming in a shorter time by
taking his advice, but remember that the reasoning behind his advice
isn’t
sound. Both Java and Ruby will show you object-oriented concepts, a
“good
thing”, and later on, you might want to learn C++ for those applications
that require more speed and/or closer coupling to the machine. C++ is
less
object-oriented than either Java or Ruby, which means (IMHO) that the
latter two languages are a better choice for learning programming
principles.

i wd hope to be able to choose the best path and not have to
switch tack in the middle as my IT capablity is not a full time activity,
but more of a support 4 my main one–finance.

Oh, I thought you were going to become a well-rounded programmer. Oh,
well,
in that case, either Ruby or Java will suit your goals much better than
C++
would. You will be able to create and maintain 95% of the applications
typical in financial institutions using either Ruby or java, or both.

of course, learning curve is to be taken into consideration as well…

Your learning curve will be much faster with Ruby or Java than with C++.
Guaranteed. I personally think Ruby and Java are much better tutorial
languages than C++ is.

'd love some comments that might help me consider my options and pick a
path (c++, java or ruby) w/ a higher level of confidence… i know that
people here will be biased towards Ruby, but that is fine: i want to hear
about it…

I don’t think you will see much in the way of bias for or against any
particular language, at least from the regular posters here, because
most
have come from a background of many other languages.

It’s not like we’re all Macintosh owners, or Scientologists, or Mensa
members, if you get my drift. :slight_smile:

Paul L. wrote:

It’s not like we’re all Macintosh owners, or Scientologists, or Mensa
members, if you get my drift. :slight_smile:

There was a time not too long ago (RubyConf 2006) when I thought pretty
much every Rubyist was a Macintosh owner. At least all the famous ones
seem to be. :slight_smile:


M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC§
http://borasky-research.blogspot.com/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.

n/a wrote:

switch tack in the middle as my IT capablity is not a full time activity,
but more of a support 4 my main one–finance.

of course, learning curve is to be taken into consideration as well…

'd love some comments that might help me consider my options and pick a
path (c++, java or ruby) w/ a higher level of confidence… i know that
people here will be biased towards Ruby, but that is fine: i want to hear
about it…

I think you’ll find that Ruby is the easiest to learn, followed by Java
and C++ being the hardest to learn. However, the heavy math, graphics,
database queries and other computational finance applications will be
easier for you if you use a language not in your list – R. R has a lot
of computational finance libraries already. Are you on Linux, Windows or
something else?

As far as general business applications are concerned, I think you’ll
find Ruby is a lot easier to work with than Java or C++. I find C++ code
totally unreadable, but I can usually read Java code. And having to
manage memory and pointers yourself is tedious, error prone and pretty
much rules out C++ for anything but gurus.

Speed – for number crunching, regardless of which language you use, the
underlying math and array operations should be done in either C, C++ or
FORTRAN in libraries. Native Java number crunching is a lot faster than
native Ruby number crunching, but I don’t know anyone who does number
crunching these days in native scripting languages.


M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC§
http://borasky-research.blogspot.com/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.

On Sat, 18 Nov 2006 16:00:07 -0800, Paul L. wrote:

In such cases, I sometimes prototype in Ruby, because development is so
fast, and then translate the result from Ruby into C++ once I have a
working program, so the delivered program will be fast.

tx a lot 4 the feedback, Paul. i will take e/g into consideration.

let me ask u how the the translation from ruby to c++ is done…

(that wd make the case even more to go ahead and start w/ ruby and
translate to c++ in some cases where it wd be needed; & stick w/ ruby
the
rest of the time…)

On Sun, 19 Nov 2006, M. Edward (Ed) Borasky wrote:

Paul L. wrote:

It’s not like we’re all Macintosh owners, or Scientologists, or Mensa
members, if you get my drift. :slight_smile:

There was a time not too long ago (RubyConf 2006) when I thought pretty much
every Rubyist was a Macintosh owner. At least all the famous ones seem to
be. :slight_smile:

Not true, Hal F. doesn’t own a Macintosh. But I’ll bet he would
really love having one if someone was to send it to him.

– Matt
It’s not what I know that counts.
It’s what I can remember in time to use.

n/a wrote:

On Sat, 18 Nov 2006 16:00:07 -0800, Paul L. wrote:

In such cases, I sometimes prototype in Ruby, because development is so
fast, and then translate the result from Ruby into C++ once I have a
working program, so the delivered program will be fast.

tx a lot 4 the feedback, Paul. i will take e/g into consideration.

let me ask u how the the translation from ruby to c++ is done…

By a human. e.g. me. It’s not automated. It might be sometime in the
future,
but remember that hand-written C++ is always faster, when done by
someone
with some depth of knowledge.

(that wd make the case even more to go ahead and start w/ ruby and
translate to c++ in some cases where it wd be needed; & stick w/ ruby the
rest of the time…)

You shouldn’t expect an automated Ruby to C++, or for that matter a Java
to
C++, automatic translator, in the foreseeable future.

M. Edward (Ed) Borasky wrote:

Paul L. wrote:

It’s not like we’re all Macintosh owners, or Scientologists, or Mensa
members, if you get my drift. :slight_smile:

There was a time not too long ago (RubyConf 2006) when I thought pretty
much every Rubyist was a Macintosh owner. At least all the famous ones
seem to be. :slight_smile:

Well, Dave T. is, and many others… Austin Z is (only recently).

I don’t think Daniel B. is, or myself, or Matz.

Although I admit I’ve thought about it…

Hal

On Sun, 19 Nov 2006 09:14:50 +0900, M. Edward (Ed) Borasky wrote:

manage memory and pointers yourself is tedious, error prone and pretty
much rules out C++ for anything but gurus.

Speed – for number crunching, regardless of which language you use, the
underlying math and array operations should be done in either C, C++ or
FORTRAN in libraries. Native Java number crunching is a lot faster than
native Ruby number crunching, but I don’t know anyone who does number
crunching these days in native scripting languages.

ok, so i cd conceivably develop in ruby and integrate c++ 4 the number
crunching parts. wd that make sense…?

(and tx 4 the pointer to “R” as well)

On Sat, 18 Nov 2006 16:26:58 -0800, Paul L. wrote:

let me ask u how the the translation from ruby to c++ is done…
You shouldn’t expect an automated Ruby to C++, or for that matter a Java to
C++, automatic translator, in the foreseeable future.

ok, tx 4 clearing that up. it means that u must have knowledge of both
languages, obviously…and the point re. starting w/ a more intuitive
language such as ruby is of interest

M. Edward (Ed) Borasky wrote:

Paul L. wrote:

It’s not like we’re all Macintosh owners, or Scientologists, or Mensa
members, if you get my drift. :slight_smile:

There was a time not too long ago (RubyConf 2006) when I thought pretty
much every Rubyist was a Macintosh owner. At least all the famous ones
seem to be. :slight_smile:

Hmm. :slight_smile:

Well, anyone can be a Macintosh owner, but it takes a special mental
configuration to be a Macintosh … looking for the right word here …
advocate? :slight_smile:

El Gato wrote:

/ …

I’d rather suggest that you go the Ruby route because I think that you
would experience a much smoother learning curve and a level of
productivity that the other two can only dream of (…well, until you
get into GUI stuff which is generally quicker in Java or C++ due to the
nice IDEs available for each. I haven’t really been keeping up with
Ruby IDEs, but I don’t think one exists yet for GUI development).

QTDesigner on Linux, plus a command-line utility called “rbuic”, makes
creating GUI interfaces very easy (“rbuic” translates the GUI interface
specification into a Ruby source file). These may also be available on
Windows.

n/a wrote:

hi, newbie so please be tolerant… :wink:

i need to start to learn a programming language to be able to develop
custom aps to be applied to a variety of purposes but mainly 1)
financial
data modeling–including graphics and data handling via database
queries,
etc.; and 2) more general business-type aps.

my feeling is that i hate BLOATED sluggish programs (like some Java
program running on older JVM’s and perhaps not written in an optimal
way…u get the idea.)

if i need to make a choice between fancy and efficient,
speed, etc., then it’s an easy choice 4 me of efficient.
which is why i have just started w/ c++.

however, speaking to one my programmer friends who is a top level Java
programmer (the stuff he writes is very efficient and fancy as
well–great balance), he is telling me that 1) c++ is being phased out
(except 4 real low level stuff like drivers, etc.) in favor of languages
such as Java or Ruby. he recommends i switch from learning c++ to
learning
Java or Ruby. i wd hope to be able to choose the best path and not have
to
switch tack in the middle as my IT capablity is not a full time
activity,
but more of a support 4 my main one–finance.

of course, learning curve is to be taken into consideration as well…

'd love some comments that might help me consider my options and pick a
path (c++, java or ruby) w/ a higher level of confidence… i know
that
people here will be biased towards Ruby, but that is fine: i want to
hear
about it…

I’d rather suggest that you go the Ruby route because I think that you
would experience a much smoother learning curve and a level of
productivity that the other two can only dream of (…well, until you
get into GUI stuff which is generally quicker in Java or C++ due to the
nice IDEs available for each. I haven’t really been keeping up with
Ruby IDEs, but I don’t think one exists yet for GUI development).
However, it seems to me that you’re looking for the expressiveness of
Ruby and the speed of C++. Welcome to the club. Strangely enough,
Java’s domain really is somewhere between each. Plus, you’ll never
truly appreciate a language like Ruby until you deal with a more…
verbose language such as Java.

On Sun, 19 Nov 2006 12:06:58 +0900, El Gato wrote:

However, it seems
to me that you’re looking for the expressiveness of Ruby and the speed of
C++. Welcome to the club.

u’r right; i guess that’s what i’m looking 4…

On Sun, Nov 19, 2006 at 09:49:56AM +0900, Hal F. wrote:

There was a time not too long ago (RubyConf 2006) when I thought pretty
much every Rubyist was a Macintosh owner. At least all the famous ones
seem to be. :slight_smile:

Well, Dave T. is, and many others… Austin Z is (only recently).

I don’t think Daniel B. is, or myself, or Matz.

Oh, but look here:
http://flickr.com/photos/zh/165711300

Only one. :]

_why

El Gato wrote:

Ruby and the speed of C++. Welcome to the club. Strangely enough,
Java’s domain really is somewhere between each. Plus, you’ll never
truly appreciate a language like Ruby until you deal with a more…
verbose language such as Java.

Everybody here or somewhere else take that for granted: Java is slower
than C++, but actually that is not true.

I thought so too. However, my computational heavy practice proved, to
certain extent, otherwise.

Interesting enough, I was a very experienced C++ programmer, and
learning Java in 2000. I got an very heavy algorithm job. I write the
same code in Java and C++. When the algorithm was relatively simple, my
C++ code was about twice faster than Java c++/Java = 610/1085. However,
when my algorithm became extremely heavy iteration, the result was
c++/Java = 26000/12000. Java was more than twice faster than C++.

I asked several Java experts include Jason Hunter, Daniel Brookshier
about the question, why? The answers are the same, JIT!!!

On Sat, 18 Nov 2006 19:14:19 -0800, Paul L. wrote:

QTDesigner on Linux, plus a command-line utility called “rbuic”, makes
creating GUI interfaces very easy (“rbuic” translates the GUI interface
specification into a Ruby source file). These may also be available on
Windows.

u mean this http://www.arachnoid.com/ruby/RubyGUIProject/index.html (but
for windows) and
this http://www.trolltech.com/products/qt/features/designer

Roseanne Z. wrote:

Everybody here or somewhere else take that for granted: Java is slower
than C++, but actually that is not true.

I thought so too. However, my computational heavy practice proved, to
certain extent, otherwise.

I should have said:

Everybody here or somewhere else take that for granted: Java is slower
than C++, but actually that is not ALWAYS true.

On Sun, 19 Nov 2006 14:36:05 +0900, Roseanne Z. wrote:

certain extent, otherwise.

thanks for the info; i see that i was not the only one with that idea
(whether pre-conceived or not).
i have to say that o/all i have seen java slower than c++ but NOT always
e.g. my programmer friend who can write in java really complex aps yet
super fast, user friendly and pleasant to the eye… he tells me it is
because he knows how to program (and because JVM’s r better than they
used
to be.)

he might have a point there…

stef wrote:

Everybody here or somewhere else take that for granted: Java is slower
c++/Java = 26000/12000. Java was more than twice faster than C++.
e.g. my programmer friend who can write in java really complex aps yet
super fast, user friendly and pleasant to the eye… he tells me it is
because he knows how to program (and because JVM’s r better than they used
to be.)

he might have a point there…

Ayup … ask the jRuby folks about that :). Of course, there is YARV
coming down the pike, and Rubinius, and the various Ruby on CLR
implementations.

Then again, for pure number crunching, there’s no reason in the world
Ruby’s NArray can’t run at full floating point speed on at least a
modern x86-32 platform. This stuff is what we call “embarrassingly
parallel”. :slight_smile:


M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC§
http://borasky-research.blogspot.com/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs