Ruby vs Java vs c++

N

n/a

hi, newbie so please be tolerant.... ;)

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....
 
M

M. Edward (Ed) Borasky

n/a said:
hi, newbie so please be tolerant.... ;)

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

M. Edward (Ed) Borasky

Paul said:
It's not like we're all Macintosh owners, or Scientologists, or Mensa
members, if you get my drift. :)
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. :)
 
N

n/a

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....)
 
M

Matt Lawrence

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

Not true, Hal Fulton 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.
 
H

Hal Fulton

M. Edward (Ed) Borasky said:
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. :)

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

I don't think Daniel Berger is, or myself, or Matz.

Although I admit I've thought about it...


Hal
 
N

n/a

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.

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

n/a

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.


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
 
E

El Gato

n/a said:
hi, newbie so please be tolerant.... ;)

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.
 
S

stef

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....
 
R

Roseanne Zhang

El said:
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!!!!
 
R

Roseanne Zhang

Roseanne said:
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.
 
S

stef

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!!!!

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.....
 
M

M. Edward (Ed) Borasky

stef said:
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.....
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". :)
 
M

Mike Shock

Hi!
As a developer who wrote programs in C++ & Java & Ruby and as a man who
trained young programmers,
I surely recommend Ruby for a newbie :)

If you're a beginner it's certainly better to have the fastest startup
with some OO language - and Ruby here is the best choice:
it's easy to learn and it suggests the 'proper' way of OO thinking.
It's more important first to get more experience in OO design and
programming, leaving for the future your thoughts of possible app's low
speed...
After a while you may want to learn Java or / and C++ ('cause a
programmer have to know more than 1 language)
and with happy Ruby experience it'll be much easier.

The questions of speed and efficiency of financial / economical
applications should be treated from the point of view
of the architecture & framework, not merely the programming language -
considering all the DBMS, client-server and Web-interface stuff.
Ruby on Rails offers a fine solution for database-centric applications.

Mike Shock
(Mikhail Shokhirev)
 
P

Phlip

n/a said:
hi, newbie so please be tolerant.... ;)

Only if you promise to read every danged post you inspired.
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.

All non-trivial applications, these days, are multi-lingual. For example,
many applications use a markup language (HTML, RC, etc...) to paint their
GUIs. Then they use an OO language for their high-level command-and-control
code (such as Ruby). Then they use a declarative language, such as SQL, to
interface with their systems, such as OSs and database engines written in a
C language.
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.)

That's because Java was invented to take market share from C++, allegedly
without introducing new risks. The actual result was a language that's
harder to compile, and harder to program. Java strongly resists high-level
abstractions, forcing you to write line after line and page after page of
cruft just to get anything done. (No wonder the book /Refactoring/ uses
Java!!;)

Java is hostile to both the CPU and the programmer. Hence, the user suffers
too.
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++.

No prob. Just remember that C++ is "portable OO assembler", and it is
CPU-friendly and programmer-hostile.

Ruby, by contrast, is the ultimate in programmer-friendliness. At
considerable expense to the CPU!
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),

Oh, I love it when they start lecturing you on how awesome that peesashit
language is! Ay-yi-yi!
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.

Incorrect. C++ is a systems language (per Bjarne Stroustrup, its author).
Systems are large and long-lived. Nobody is phasing them out.

C++ is strongly represented in the database, videogames, operating systems,
scientific, and research spaces. Also, all those spaces typically "alternate
hard and soft layers", by augmenting their C++ with a soft OO language.
Videogames use LUA, OSs often use Perl, databases use at least SQL if not
more, and so on. Ruby makes an _exquisite_ soft-layer, to provide the
high-level features for a C++ application.
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.

Learn to learn languages. I could write a program in Java if you forced me
to (and with steady access to Google). Then learn all of them. You don't
have to worry about running out of room in your brain!
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....

You will never miss anything (except lots of entry-level jobs that nobody
should want) if you avoid Java like the plague, and stick with languages
that are technically superior. Put another way, the simple motivation of
having a boss order you to use Java is not good enough. The motivation
itself will not magically make Java more productive. It will slow you down.
Some people work by the hour, so that's okay for them. If you want to be
rewarded for productivity, go with the most technically advanced system you
can.

I work to the story-point. That means I estimate for my client each feature
in "ideal hours", and then I charge to those point, _not_ the actual hours
spent researching and coding. I don't actually give a darn what that time is
(and it usually includes lots of bizarre interruptions from my females!).

If I did that using any system besides Ruby (on Rails, and pure Test Driven
Development), I would be absolutely screwed. Instead, I am able to fix the
cost of each iteration, while keeping the quality as high as possible,
without excessive delays.
 
M

Martin DeMello

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,

I'm learning OCaml for just that reason :) Some of the Scheme dialects
get some impressive performance figures too, but I haven't really
looked into them as much.

martin
 
D

David Kastrup

Martin DeMello said:
I'm learning OCaml for just that reason :) Some of the Scheme
dialects get some impressive performance figures too, but I haven't
really looked into them as much.

I have looked through several compilers. I have to say that one of
the most appealing Scheme->C compiler ideas I have seen was to drop
the distinction between heap and compiler stack: functions were called
with an appropriate continuation data structure, and no function ever
properly returned at the C level. Data was allocated using alloca.

When the heap/stack combination overflowed, it was garbage-compacted
in its entirety. All continuations without a pending reference to
them consequently were removed from the stack.

This basically made continuations rather easy to implement.
Impressive.
 

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

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top