Ruby vs Java vs c++

P

Phlip

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

Apologies for misunderstand you, but which one was the zealot?

That door tends to swing both ways... ;-)
 
E

EB

The one thing Ruby (and Python) have over C++ (and Java to
some extend) is that there is very little overhead in terms
of syntax to get started writing a program. You can just
get started, first in the interpreter to get your feet
wet and try out things, then later by putting programs
together in a source file.

No need to #include or import anything (well, I guess
Python/Ruby do something similar at times), no required main
functions/methods etc .. all that extra syntax (and in
case of C/C++ all that memory management, which can cause
endless headaches).

IMHO, for humans/programmers, languages like Ruby or Python
are much more productive tools than C++. They work at a higher
level and come with nice libraries to support the task at
hand - the programmer can concentrate on solving the problem
rather than worrying about arcane syntactic issues.

Using the above criteria, I would put Java somewhere between
Ruby/Python and C/C++.

Now, if low-level access to the machine is required, or
fast execution, C/C++ might be a better choice since it's
a compiled, rather than interpreted system, though there
are probably tools that would allow you to create executables
based on Ruby/Python (or perhaps not, I'm assuming here).

I was just recently taking another look at C++, and you can
easily see how it's C with C++ grafted on, it has some rather
"un-elegant" features because of it. I'm not taking anything away
from Bjarne S., he did a great job taking C and turning it into
an object oriented language and helping the OO paradigm to get
more widely accepted. Other languages learned from this
and improved on it, to wit Java and all those that came
after.

My background:

FWIW, I have been programming since 1980, plenty of assembly
(even some machine language for "fun"), Pascal, Ada, C, C++,
Java, C# etc .. my favorite languages currently are Ruby and Python.
If I have to develop for Windows with GUIs, VS w/ C#, most
of my code is written under Linux w/ emacs.


Sorry, this got to be longer than I had intended. Short version, if
you want to learn programming, and be productive, take a look at
Python and/or Ruby instead of C++.

EB
 
E

EB

Chilkat said:
About 20 years ago, when I graduated from University of Illinois' with a
BS in Computer Science / Engineering,
the department's philosophy was for students to acquire an understanding
of computers and programming
from the ground up. That meant from the electronic circuit level, to
the logic level (NAND and NOR gates),
to assembly programming, and on up. My answer to the original question
is based on this philosophy.
I recommend starting at the C/C++ level simply to gain a fundamental
understanding of the bits & bytes,
pointers, pointer arithmetic, structure layouts, byte ordering,
structure member alignment, dynamic memory
allocation on the heap as opposed to the stack, etc. Understanding
this gives you a good idea
as to what's going on "under the hood" with higher-level languages.
Things won't be so mysterious.
It'll pay off in the long run.

For someone wanting/needing a deeper understanding of how things work
this is true.

However, for someone with specific goals in mind, hopefully the languages
will isolate him/her from the bit-twiddling issues. E.g. smart file IO
libraries will worry about big-endian vs little endian etc.

I see this as one of the major features of higher level languages
such as Ruby/Python.

(Analogy, I can drive a car and get from here to there w/o understanding
how every part of the car's engine works. And not everyone wanting to
drive a car to get somewhere wants to know either :)

Worrying about malloc/free (or new/delete), run-away pointers etc
is not something I want to deal with unless I have a good reason
for it. 99% of the time it's not required.

Now, if you are writing primarily OS service code etc, then of course
it's all different :)

EB
 
D

dblack

Hi --

stef wrote:

/ ...


Translation for Earthlings:

"I *am* reading every single post in the thread, believe me. Thank you for
the information."

French is easier.

I think the point has been made enough times that stef uses a lot of
abbreviations, and that not everyone likes it. Please let's not go
on and on about it -- thanks.


David

--
David A. Black | (e-mail address removed)
Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3]
DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4]
[1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com
[2] http://dablog.rubypal.com | [4] http://www.rubycentral.org
 
F

Friedrich Dominicus

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

M. Edward (Ed) Borasky

Friedrich said:
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" ;-)
Back when dinosaurs walked the Earth amongst humans, I used *Fortran*
for scripting, mostly because it was more or less guaranteed to exist
everywhere, while everyone had their own "JCL/command
line/shell/whatever". So not only is it possible to write Fortran
programs in any language ...
 
S

spooq

I would like to suggest the newbie learns VBA. The financial world
lives and breathes Excel. VBA is by far the language most likely to be
of use to someone entering that world. It's pretty clear programming
is a tool for his/her use, rather than something that (s)he wants to
do for it's own sake. Having said that, Excel can be viewed as a type
of DSL in it's own right, so pushing the boundaries of what can be
done 'natively' is a great place to start.
 
D

David Kastrup

spooq said:
I would like to suggest the newbie learns VBA. The financial world
lives and breathes Excel. VBA is by far the language most likely to be
of use to someone entering that world. It's pretty clear programming
is a tool for his/her use, rather than something that (s)he wants to
do for it's own sake. Having said that, Excel can be viewed as a type
of DSL in it's own right, so pushing the boundaries of what can be
done 'natively' is a great place to start.

Isn't VBA rather similar to Ruby, anyway?
 
E

EB

M. Edward (Ed) Borasky said:
everywhere, while everyone had their own "JCL/command

Oh yes, good old JCL ...
line/shell/whatever". So not only is it possible to write Fortran
programs in any language ...

I actually wrote some programs in RATFOR (Rational Fortran) .. man
I feel old.

EB
 
R

Reid Thompson

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" ;-)
:)
http://www.softintegration.com/

Ch is an embeddable C/C++ interpreter for cross-platform scripting,
shell programming, 2D/3D plotting, numerical computing, and embedded
scripting. Ch is the solution for:
 
S

stef

stef wrote:

/ ...


I thought you would find it useful, in your valiant efforts to gain greater
literacy and achieve clearer communications with your fellow man. :)

My literacy is just fine, thank you very much. For the sake of speed, I
use shortcuts.
I realize you are a programmer but contrary to the machines you program,
which interpret code literally, you hopefully have the power to INTERPRET,
as opposed to a chip.
Surely, you can make out that "u" = "you", etc....
 
P

Peter Hickman

stef said:
My literacy is just fine, thank you very much. For the sake of speed, I
use shortcuts.
I realize you are a programmer but contrary to the machines you program,
which interpret code literally, you hopefully have the power to INTERPRET,
as opposed to a chip.
Surely, you can make out that "u" = "you", etc....
Not everyone has English as a first language and therefore the use of
regional and or cultural variants is unlikely to aid communication, even
native speakers can have problems. Remember that Ruby was developed by a
Japanese speaker. If Matz had shown your arrogance we would all be VB
programmers! Isn't is nice that Matz put the effort into communicating
clearly with other people. If you can't be bothered to take the time to
communicate then save yourself even more time by not hitting the send
button.
 
R

Richard Conroy

My literacy is just fine, thank you very much. For the sake of speed, I
use shortcuts.

You realise how self-defeating that is? Your speed of typing translates
into greater work for the reader. In your effort to seek help you should
be writing clearly. If that means that you sit down at a PC instead of
replying from your smartphone then do so.
Surely, you can make out that "u" = "you", etc....

Yes we can, but it's annoying. Text speak is bad.

Also consider that this is an international group. Phonetic text abbreviations
that may be obvious to an english speaker, might be unreadable to many
worldwide Ruby-talk readers.
 
H

Hugh Sasse

My literacy is just fine, thank you very much. For the sake of speed, I
use shortcuts.

If you are using vi or vim you can program the editor to expand
abbreviations for you. In vim you can lookup :ab in the help
system:-
:he :ab
I'm almost certain Emacs can do abbreviation expansion as well. There
is also automatic completion available in vim for, that matter, see
:he compl-generic
for more on this. Searching for tools to help with RSI will
provide other alternatives.

You appear to be using the Pan newsreader. I'm unfamiliar with it,
and a quick look around the pan web site turns up nothing about
configuring the editor for it, so I'd suggest you look on a Pan
mailing list about how to configure it to use you favourite editor.
I realize you are a programmer but contrary to the machines you program,
which interpret code literally, you hopefully have the power to INTERPRET,
as opposed to a chip.
Surely, you can make out that "u" = "you", etc....

This moves effort from you to the N people reading the message.
Given the way much reading is done by word shape rather than reading
individual letters, this is at best inconsiderate. As you have
seen, it can be misconstrued as ignorance.

Hugh
 
F

Friedrich Dominicus

Reid Thompson said:
Yeah I know that but I was talking of compiled C. So a bit different
;-). IIRC that was for parsing some XML....
Ch is an embeddable C/C++ interpreter for cross-platform scripting,
shell programming, 2D/3D plotting, numerical computing, and embedded
scripting. Ch is the solution for:
It's very C-ish but the libraries make the difference. However others
have written C-Interpreters also:
Eic (now abondoned)
Cint http://root.cern.ch/root/Cint.html
and another one which name I forgot...

And I remember that in anotherthread someone suggested to use the Ruby
Interpreter as a somewhat bigger library ;-)

Regards
Friedrich
 
C

CParticle

spooq said:
To me it looks like an OO BASIC with support for databases and Office apps.

My two cents here as someone who swtiched from VB script to Ruby on why
not VBA, is pretty simple. If you learn VBA your are locked in to MS
products only this was my feeling as I've not heard much of VB anything
on a non-Windows environment or at least none to take note of. While
it probably is the best way to go if you are in a MS only environment
and are ok with that it seems at least to be a non-transferable
language. I did switch to Ruby however exactly because as was said
above it is very much like VBA which I had experience with. The other
reason I switch if the OP cares is that Ruby is a younger language and
this give me an opportunity to learn the language before/if the
language becomes more popular. So far (6 months) I like Ruby very much
and with the help of some people on this list I've managed to put into
production some of my scripts.

CParticle
 
D

Diego Virasoro

I realize you are a programmer but contrary to the machines you program,
which interpret code literally, you hopefully have the power to INTERPRET,
as opposed to a chip.
Surely, you can make out that "u" = "you", etc....

Although I must agree that Paul was nitpicking too much, and I am happy
to be a bit flexible (for example lots of friends forget to capitalize
the first word of a sentence), some of those abbreviation you used do
take a while to be "processed".

You may think your readers will be happy to put up with it, but most
probably if they cannot work out one of your abbreviation in some short
time, they'll just give up and move to the next question.

So it's all a matter of who has the most interest in the communication,
if you or your reader.

That said, maybe you can set a small ruby script and everyone wins, you
get speed and the rest of us get clarity. :)

Diego
 
M

M. Edward (Ed) Borasky

EB said:
Oh yes, good old JCL ...


I actually wrote some programs in RATFOR (Rational Fortran) .. man
I feel old.
You feel old? Apparently you missed my post on ILLIAC I. :)
 

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,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top