# Ruby vs Java vs c++

**URL:** <https://rubytalk.org/t/ruby-vs-java-vs-c/33053>\
**Category:** ruby-talk\
**Created:** [18 November 2006 23:40 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053 "2006-11-18T23:40:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![n\_a](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@n\_a](https://rubytalk.org/u/n_a)\
**Post date:** [18 November 2006 23:40 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/1 "2006-11-18T23:40:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Paul\_Lutus](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@Paul\_Lutus](https://rubytalk.org/u/Paul_Lutus)\
**Post date:** [19 November 2006 00:05 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/2 "2006-11-19T00:05:05Z")

</div>

n/a wrote:

> hi, newbie so please be tolerant.... 😉

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

> **···**
>
> --  
> Paul Lutus  
> [http://www.arachnoid.com](http://www.arachnoid.com)

---

<div class="post-metadata">

**Author:** ![M\_Edward\_Ed\_Borasky1](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@M\_Edward\_Ed\_Borasky1](https://rubytalk.org/u/M_Edward_Ed_Borasky1)\
**Post date:** [19 November 2006 00:14 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/3 "2006-11-19T00:14:50Z")

</div>

n/a wrote:

> 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....  
> &nbsp;&nbsp;

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(P)  
> [http://borasky-research.blogspot.com/](http://borasky-research.blogspot.com/)
> 
> If God had meant for carrots to be eaten cooked, He would have given rabbits fire.

---

<div class="post-metadata">

**Author:** ![El\_Gato](https://avatars.discourse-cdn.com/v4/letter/e/71e660/32.png) [@El\_Gato](https://rubytalk.org/u/El_Gato)\
**Post date:** [19 November 2006 03:06 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/4 "2006-11-19T03:06:58Z")

</div>

n/a wrote:

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

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Mike10](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Mike10](https://rubytalk.org/u/Mike10)\
**Post date:** [19 November 2006 07:44 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/5 "2006-11-19T07:44:57Z")

</div>

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)

n/a wrote:

> **···**
>
> > 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++.
> > 
> > &nbsp;&nbsp;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....

---

<div class="post-metadata">

**Author:** ![Phlip5](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@Phlip5](https://rubytalk.org/u/Phlip5)\
**Post date:** [19 November 2006 08:40 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/6 "2006-11-19T08:40:10Z")

</div>

n/a wrote:

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

> **···**
>
> --  
> &nbsp;&nbsp;Phlip  
> &nbsp;&nbsp;[http://www.greencheese.us/ZeekLand](http://www.greencheese.us/ZeekLand) \<-- NOT a blog!!!

---

<div class="post-metadata">

**Author:** ![David\_Vallner](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@David\_Vallner](https://rubytalk.org/u/David_Vallner)\
**Post date:** [19 November 2006 17:18 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/7 "2006-11-19T17:18:58Z")

</div>

n/a wrote:

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

So, for my two cents.

For the sake of all that's good and holy, use "you" instead of "u", same  
for "wd" etc. You write to communicate ideas to others, do so that  
they'll be comprehensible by anyone, not just someone able to decrypt  
your specific array of preferred abbreviations.

'd b hard 2 undrstd ppl if evr1 tlks n rites like ths.

This whole post was, if unintentional flamebait, having more information  
on your requirements as opposed to going on about your and someone  
else's personal tastes would have helped.

Now, for the more objective (I hope) bits.

As for performance, well-written C++ outperforms well-written Java,  
well-written Java outperforms well-written Ruby. The comparisons get  
hairier as problem domain complexity increases.

For graphics, both Java and Ruby use / let you use native libraries for  
the heavy lifting, and as long as a database is involved, as the weight  
in DB queries increases, the overhead of the language used to do  
processing gets negligible compared to DB connection / query execution lag.

Most of Java's bad performance rap is due to Swing from versions 1.4 and  
easier. It's a well-deserved bad rap. SWT is usually snappier, and works  
reasonably well on Windows. On 1.5, IDEA - using Swing tends to be more  
responsible for me than Eclipse, using SWT. This doesn't say much about  
the relative qualities of the toolkits, rather that by now, they're both  
mature enough for their use to be negligible overhead in applications of  
sufficient complexity. The above of course presumes the GUIs are  
well-written, both those toolkits are quite daunting, and often make  
concessions GUI designers - layout managers that are intended to be  
targetted by code generators rather than handcoding, which usually draw  
much whining from mainly .NET fanboys. (I personally feel much  
resentment towards anyone confused by options.)

I admit to not having used Ruby-based GUIs extensively. From what I can  
recall about my brief forays into FreeRIDE, FOX seemed to be quite  
responsible, and Gtk is fairly mature and native too, and tends to  
perform rather well. (On Windows, both look horrible to me though.) On  
the question of GUIs, I'd call things even from the performance point of  
view. From the programming point of view, all toolkits mentioned make  
use of callback functions, where all the languages mentioned need to  
emulate functional programming capabilities with varying levels of  
verbosity (with roughly Java \> C++ \> Ruby, greater = more verbose).

With your requirements, I think you're understating data source  
integration. For database connectivity, every product exposes a C / C++  
API. Also, more or less every product save very, very legacy databases  
will provide you with a JDBC driver, which in addition to ubiquity gives  
you some measure of uniform access. With Ruby, the situation is mildly  
less stellar, and you'd better try and scout out if bindings to what you  
need are available. For major DB vendors, they should be at usable  
levels of maturity, but it's a point worth checking.

Your programmer friend has a rather narrow way of looking at things.  
Both C++ and Java have their well-established niches, which means  
they'll in some way matter for a long time still. I personally see no  
shame in having a CV entry with good representation on the job market  
even though it's not the shiny new kid on the block. That said,  
depending on how much decision power you expect to wield about choice of  
technology you'll use to program, this might be irrelevant to you and  
your choice.

As for the fear of switching tacks in the middle, as others have pointed  
out, this is unavoidable, and learning to switch is a valuable (and  
easy) skill. There is no silver bullet, there is no "best" language, and  
if you've got the right brain pathways, you'll notice that all the  
class-based OO languages (the major family these days) are essentially  
identical in enough of the fundamental concepts for programming in one  
you don't know to be a matter of two hours of reading through a syntax  
tutorial and having an API reference open in a browser window.

From the learning curve perspective, It Depends. C++, C#, or Java are  
easier if you have skill with using a high-level IDE, Ruby if you don't.  
On that note, I'd be more in favour of Python than Ruby; since a lot of  
learning a language \*well\* involves reading code, and Python forcing you  
to express using more clear and basic concepts (e.g. no eval  
metaprogramming, global namespace / class definition clobbering, or  
other manners of witty hacks), it's more likely you'll find Python  
material more didactic. That said, Ruby code not using features beyond  
your current level of comprehension is on par with Python's, and the  
latter language has its idiosyncracies too - notably the functional -ish  
features.

Summarising the language curve bits, I don't have a problem with either  
side of the fence, but scripting languages, Ruby and Python more so than  
Perl / Tcl (for me at least) are more approachable in general, and their  
libraries seem to be more oriented towards solving the most common tasks  
very simply, instead of solving all cases consistently - which means  
problems are expressed in a straightforward, more understandable way.

David Vallner

---

<div class="post-metadata">

**Author:** ![Jim\_Cochrane](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@Jim\_Cochrane](https://rubytalk.org/u/Jim_Cochrane)\
**Post date:** [19 November 2006 23:40 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/8 "2006-11-19T23:40:09Z")

</div>

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

If you're not too attached to the mainstream, Eiffel could be another  
choice - efficient (statically compiled, like C++), but higher-level  
than C++; has GC but is better designed than Java, as far as the language  
itself. Designed to facilitate writing correct programs. If this  
interests you, do a bit of googling/research to learn about its  
advantages and disadvantages and see if it's worth pursuing further.  
(There are two GNU-licensed Eiffel compilers available:

> **[DropCatch.com](https://www.DropCatch.com/domain/eiffelzone.com)**
>
> DropCatch.com helps you secure expiring domain names.

[http://smarteiffel.loria.fr/](http://smarteiffel.loria.fr/)  
.)

Regarding Ruby, it's much closer to being justifiably called a pure OO  
language than Java is; part of the result of that is that its design is  
simpler and better. In many cases, you don't want to make a choice  
between high-level and efficient - you want both; and you do that by  
using two or more languages. Ruby is a contender for being your best  
choice for your "dynamic scripting" language. (Perl has an advantage if  
you need its larger available collection of libraries and components,  
but this will shrink as Ruby is used more.)

> **···**
>
> On 2006-11-18, n/a \<na@nomail.invalid\> wrote:
> 
> > 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....
> 
> --

---

<div class="post-metadata">

**Author:** ![Friedrich\_Dominicus2](https://avatars.discourse-cdn.com/v4/letter/f/b38774/32.png) [@Friedrich\_Dominicus2](https://rubytalk.org/u/Friedrich_Dominicus2)\
**Post date:** [20 November 2006 06:05 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/9 "2006-11-20T06:05:11Z")

</div>

n/a \<na@nomail.invalid\> writes:

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

Why not Ruby and Java and C++?  
The realy unanswered question is when is one better than the other. I  
even have seen someone using C for "scripting" 😉

Regards  
Friedrich

> **···**
>
> --  
> Please remove just-for-news- to reply via e-mail.

---

<div class="post-metadata">

**Author:** ![Henry\_Maddocks](https://avatars.discourse-cdn.com/v4/letter/h/f475e1/32.png) [@Henry\_Maddocks](https://rubytalk.org/u/Henry_Maddocks)\
**Post date:** [21 November 2006 07:25 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/10 "2006-11-21T07:25:47Z")

</div>

I have been thinking, and talking, about this quite a bit lately. Here is my take...

Learn Ruby and C. With Ruby you can write programs fast, with C you can write fast programs, ie write your system in Ruby and then rewrite the slow bits in C (rubyinline?).

C++'s days are numbered unless you are doing seriously performance critical stuff (visualisation, some games, etc). Java is an improvement but then Ruby is at another level.

> **···**
>
> On 19/11/2006, at 12:40 PM, n/a wrote:
> 
> > '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....

---

<div class="post-metadata">

**Author:** ![Daniel\_Schausser](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@Daniel\_Schausser](https://rubytalk.org/u/Daniel_Schausser)\
**Post date:** [22 November 2006 22:46 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/11 "2006-11-22T22:46:20Z")

</div>

n/a wrote:

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

&nbsp;&nbsp;And that would be the best choice. If you want efficiency you should  
definitely use C++/Visual C++. If you ask me, it's the best programming  
language around, when you want efficiency, power with a resonable amount  
of work when writing code.  
&nbsp;&nbsp;However, Java would more suited when you want to make things fast and  
not care very much about efficiency. For example, if you like to split  
up a mail address like daniel.schausser@gmail.com and you want to do it  
fast, you have to allocate buffers, use strtok and so on and so forth.  
With java, that's piece of cake

> **···**
>
> > 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....
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![M\_Edward\_Ed\_Borasky1](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@M\_Edward\_Ed\_Borasky1](https://rubytalk.org/u/M_Edward_Ed_Borasky1)\
**Post date:** [19 November 2006 00:18 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/12 "2006-11-19T00:18:15Z")

</div>

Paul Lutus wrote:

> It's not like we're all Macintosh owners, or Scientologists, or Mensa  
> members, if you get my drift. 🙂  
> &nbsp;&nbsp;

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

> **···**
>
> --  
> M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)  
> [http://borasky-research.blogspot.com/](http://borasky-research.blogspot.com/)
> 
> If God had meant for carrots to be eaten cooked, He would have given rabbits fire.

---

<div class="post-metadata">

**Author:** ![n\_a](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@n\_a](https://rubytalk.org/u/n_a)\
**Post date:** [19 November 2006 00:20 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/13 "2006-11-19T00:20:08Z")

</div>

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 Sat, 18 Nov 2006 16:00:07 -0800, Paul Lutus 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.

---

<div class="post-metadata">

**Author:** ![n\_a](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@n\_a](https://rubytalk.org/u/n_a)\
**Post date:** [19 November 2006 01:15 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/14 "2006-11-19T01:15:05Z")

</div>

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 Sun, 19 Nov 2006 09:14:50 +0900, M. Edward (Ed) Borasky wrote:
> 
> > 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.

---

<div class="post-metadata">

**Author:** ![Paul\_Lutus](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@Paul\_Lutus](https://rubytalk.org/u/Paul_Lutus)\
**Post date:** [19 November 2006 03:15 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/15 "2006-11-19T03:15:05Z")

</div>

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.

> **···**
>
> --  
> Paul Lutus  
> [http://www.arachnoid.com](http://www.arachnoid.com)

---

<div class="post-metadata">

**Author:** ![n\_a](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@n\_a](https://rubytalk.org/u/n_a)\
**Post date:** [19 November 2006 04:50 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/16 "2006-11-19T04:50:08Z")

</div>

u'r right; i guess that's what i'm looking 4....

> **···**
>
> 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.

---

<div class="post-metadata">

**Author:** ![Roseanne\_Zhang](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Roseanne\_Zhang](https://rubytalk.org/u/Roseanne_Zhang)\
**Post date:** [19 November 2006 05:36 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/17 "2006-11-19T05:36:05Z")

</div>

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

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Martin\_DeMello](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Martin\_DeMello](https://rubytalk.org/u/Martin_DeMello)\
**Post date:** [19 November 2006 09:57 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/18 "2006-11-19T09:57:47Z")

</div>

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

> **···**
>
> On 11/19/06, El Gato \<wmwilson01@gmail.com\> wrote:
> 
> > 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,

---

<div class="post-metadata">

**Author:** ![Mark\_Shroyer](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mark\_Shroyer](https://rubytalk.org/u/Mark_Shroyer)\
**Post date:** [19 November 2006 15:55 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/19 "2006-11-19T15:55:08Z")

</div>

> Java is hostile to both the CPU and the programmer. Hence, the user  
> suffers too.

Being reasonably experienced in developing both C++ and Java applications,  
I would suggest that a modern JVM is not slow by any means:

[http://www.kano.net/javabench/data](http://www.kano.net/javabench/data)

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

Ruby is great; I clearly wouldn't be on this newsgroup if I thought  
otherwise. However, at this point in time Java is far more mature,  
performs better, and enjoys a much greater market penetration than Ruby,  
meaning that your Java skills, should you choose to develop them, could  
prove the more useful.

I agree with Philip in that you should "learn to learn languages"; that's  
the advice of a seasoned software engineer. But what I would add to that  
is that since Java borrows so much from C++ (and is borrowed even more  
heavily from in C#), learning to "think in Java" is an especially good  
starting point from which to proceed to other languages. That might be  
something worth keeping in mind, especially if you think that you might do  
work on .NET some day.

There certainly are flaws in Java, particularly in the language itself.  
Many tasks must be approached with an unnecessary verbosity of code:  
launching a new thread, for example, requires more writing than it should.  
I get the feeling that Gosling et. al. originally intended this very  
explicit syntax in order to make the exact behavior of the code more  
apparent to the programmer (a decision which may have contributed to  
Java's popularity in academic circles). However, when comparing Java to  
its extremely similar - yet more concise - counterpart, C#, it is clear  
which approach is more appropriate from the standpoint of a pragmatic  
software developer. Java began to add some much-needed syntactic sugar in  
Java 5, and I would expect to see further improvements in this area in  
upcoming relases.

All things considered, the Java environment (and the vast ecosystem that  
has grown up around it) is quite powerful. Coupled with the close  
ideological relationship that the Java language shares with other popular  
programming languages, I would think this makes Java very much worth your  
consideration.

Good luck,  
Mark

> **···**
>
> On Sun, 19 Nov 2006 08:38:21 +0000, Phlip wrote:
> 
> --  
> Mark Shroyer  
> [http://markshroyer.com/](http://markshroyer.com/)

---

<div class="post-metadata">

**Author:** ![David\_Vallner](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@David\_Vallner](https://rubytalk.org/u/David_Vallner)\
**Post date:** [19 November 2006 15:59 UTC](https://rubytalk.org/t/ruby-vs-java-vs-c/33053/20 "2006-11-19T15:59:50Z")

</div>

Phlip wrote:

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

[snip]

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

I am so glad to see the ranting preaching zealot was refuted with a  
factually supported statement based on experience with comparable problems.

David Vallner

[Next page](https://rubytalk.org/t/ruby-vs-java-vs-c/33053.md?page=2)
