Java vs. C++

H

hzs202

Hi,

My name is Hakim Singhji and I am currently a student at New York
University. I am majoring in Information Systems concentrating on
Application Development. However, I have not completely decided on
which application langauage to concentrate on (yet!). I am fluent in
Unix shell scripting with ksh, bash and tcsh; I know a little Perl; I
also am very fond of SQL and Oracle's PL/SQL however I am looking to
focus my studies on either C++ or Java and I am looking for a little
bit of advice in this area.

It appears that Java is easy to learn and it's popularity is steadily
increasing because of its speed and ease of use. However, C and C++ are
industry standards which will undoubtedly be used for a long time.

I asked one of my Unix professors this same question and he suggested
starting with C then C++. He made a comparison between C and Java using
an analogy of German and Yiddish as he explained, "Learning C is like
learning German if you know German than you know Yiddish (i.e., Java)
by default."

His explanation makes sense however, he is also a C++ Professor and has
written books on C and C++. So I think there may be a bias. Is this the
general feeling of Java as it relates to C and C++ among developers?

Please review this thread carefully, I need to firm up my decision
before this next semester begins. Thank you all for your help in
advance.

Best,

Hakim Singhji
http://i5.nyu.edu/~hzs202/index.html
 
J

John C. Bollinger

I asked one of my Unix professors this same question and he suggested
starting with C then C++. He made a comparison between C and Java using
an analogy of German and Yiddish as he explained, "Learning C is like
learning German if you know German than you know Yiddish (i.e., Java)
by default."

His explanation makes sense however, he is also a C++ Professor and has
written books on C and C++. So I think there may be a bias. Is this the
general feeling of Java as it relates to C and C++ among developers?

Apparently your professor has not written any books on Java. Java, C,
and C++ all have similar syntax, but Java is no more a dialect or subset
of C than C++ is. In fact, I would claim that Java diverges from C more
than C++ does. Moreover, there are more issues than the language
itself: the supporting libraries, in particular, differ much more
between Java and C / C++ than the language syntax does.

This probably doesn't help much with your selection of a language to
focus on, but hopefully it firms up your foundation for that decision a bit.
 
A

Altman

I would probably agree with your professor that if you have a good
understanding of C++, then Java should come easy. You can kind of see
this 2 ways though. Do you want to start off hard, and make the second
one feel easy. Or do you want to ease into programing and then move to
the harder one when you have a good understanding of Java. Personally
I feel it is better to get an understanding in the easier language and
then work up. Not to say that C++ is incredibly hard, but it has more
things that will get you in trouble, and if you don't have a good
understanding of programming at all, this will be magnified.
Personally I would start with Java and then work to C++.
 
R

Rhino

Hi,

My name is Hakim Singhji and I am currently a student at New York
University. I am majoring in Information Systems concentrating on
Application Development. However, I have not completely decided on
which application langauage to concentrate on (yet!). I am fluent in
Unix shell scripting with ksh, bash and tcsh; I know a little Perl; I
also am very fond of SQL and Oracle's PL/SQL however I am looking to
focus my studies on either C++ or Java and I am looking for a little
bit of advice in this area.

It appears that Java is easy to learn and it's popularity is steadily
increasing because of its speed and ease of use. However, C and C++ are
industry standards which will undoubtedly be used for a long time.

I asked one of my Unix professors this same question and he suggested
starting with C then C++. He made a comparison between C and Java using
an analogy of German and Yiddish as he explained, "Learning C is like
learning German if you know German than you know Yiddish (i.e., Java)
by default."

His explanation makes sense however, he is also a C++ Professor and has
written books on C and C++. So I think there may be a bias. Is this the
general feeling of Java as it relates to C and C++ among developers?

Please review this thread carefully, I need to firm up my decision
before this next semester begins. Thank you all for your help in
advance.

Best,

Hakim Singhji
http://i5.nyu.edu/~hzs202/index.html
This is the kind of question that provokes "religious" wars where fans of
each language or technology argue passionately - even fanatically - for
their favourite language.

Your professor is right that C, C++, and Java have some common elements.
Some of the basic language elements are largely the same so knowing one is
always at least a bit of a head start in learning one of the others. For
example, I had a basic familiarity with C when I started learning Java and
therefore found Java just a bit easier because of the common elements.
However, I think it would be a big mistake to view those common elements as
a huge head start: I think they might save you a day or two in learning one
language if you already know one of the others but not a lot more.

You might be interested to know that, a few months ago, I posted a question
asking how hard it is to learn C++ if you already know Java. I posted to
both this newsgroup and a C++ newsgroup and the answers I got were all over
the map. Some people felt that I could get a working knowledge of C++ in a
single weekend of study while others felt it would more likely take a year
or two of full time exposure to C++ to get even basic familiarity. One
individual said it would take 15 years to get good at C++ even with a strong
background in Java and OO!

I certainly wouldn't call Java an easy language to learn. Maybe it is
relatively easy if you already have an OO (Object Oriented) background but I
didn't have any OO when I started with Java. The Java API is *immense* and
growing by leaps and bounds each year. Many third parties add new classes
and packages every year. It's already to the point where I have had no
contact whatever with some whole categories of Java programs. For example, I
don't even know what JXTA stands for, let alone what to do with it, but I
know it has something to do with Java. So, if you plan to learn Java,
remember that it is huge and getting bigger every day.

It might be best if you state your criteria for choosing a programming
language before anyone offers you their opinions on which language is best
to learn. It is not clear whether you are looking for the language which is
easiest to learn, the language which is most powerful, the language which is
best to use with web applications, the language with the biggest employment
prospects or other criteria altogether. Some idea of your objectives for the
language would help a great deal in forming recommendations.

It would also be a good idea if you post your questions on newsgroups for
the other languages which you are considering. After all, you're bound to
get something of a pro-Java and anti-C/C++ bias on a Java newsgroup and
should expect the opposite bias on C and C++ newsgroups. You really ought to
hear the opposing viewpoints so that you have some chance of overcoming the
biases.

Having said all of that, I love Java and really don't like working with any
other languages any more. I have used something like 10 or 15 languages and
every time I use one of the others, I find that they are missing so many
things that are standard within Java. The easy extensibility of Java is its
biggest strength in my opinion. On that basis alone, I recommend it
enthusiastically to others.

Rhino
 
W

Wibble

Both C++ & Java are great languages and more different than the
syntax suggests. Its easier to learn OO concepts in java and
how a machine works in C. You need to know both these things to
program either language expertly.

A top shelf professional today should have a good working knowledge
of both, as well as some scripting, database & UI on
several platforms.
 
P

Patricia Shanahan

Hi,

My name is Hakim Singhji and I am currently a student at New York
University. I am majoring in Information Systems concentrating on
Application Development. However, I have not completely decided on
which application langauage to concentrate on (yet!). I am fluent in
Unix shell scripting with ksh, bash and tcsh; I know a little Perl; I
also am very fond of SQL and Oracle's PL/SQL however I am looking to
focus my studies on either C++ or Java and I am looking for a little
bit of advice in this area.

Why focus on one language?

A career can easily last 50 years. Programming languages
either go obsolete or change practically past recognition in
a decade or two at the most - and that's the long-lived
ones. Fortran in 2005 is not the language I learned in 1967.
Algol has sort of disappeared. I don't see that much
interest in Cobol.

If you become a successful application developer you will
use several languages in the course of your career, even if
they keep the same name. You will need to go on learning new
languages and new API's, or you will become obsolete.

Each language you learn will show you different ways of
thinking about programming, which can then be applied in
other languages. Certainly C++ and Java both have things to
teach, and mainly different things. Each has good and bad
points.

Patricia
 
H

hzs202

Patricia said:
Why focus on one language?

I think it is best to learn one programming language at a time. Do you
agree? Besides, the curriculum is designed to cover the nuts and bolts
of one programming language. Although, I know over time I will learn
others.
 
Y

Younes

Wibble said:
Pats right. The more you know, the more they pay you.
Programming is not just a question of which language to use.
In general, with a good programming skills and OO background, learning
and switching from one language to other be come more easy.
 
H

Hakim Singhji

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Younes wrote:
| Wibble wrote:
|
|> Pats right. The more you know, the more they pay you.
|>
|> (e-mail address removed) wrote:
|>
|>> Patricia Shanahan wrote:
|>>
|>>
|>>> Why focus on one language?
|>>
|>>
|>>
|>>
|>> I think it is best to learn one programming language at a time. Do you
|>> agree? Besides, the curriculum is designed to cover the nuts and bolts
|>> of one programming language. Although, I know over time I will learn
|>> others.
|>>
| Programming is not just a question of which language to use.
| In general, with a good programming skills and OO background, learning
| and switching from one language to other be come more easy.
|
My appologies for any misunderstandings. I was not able to come to a
strong conclusion from this discussion. I think I may have posed the
question somewhat ambiguously. I hope this clears up any ambiguity: I
wanted to know if my unix background and/or SQL, PL/SQL and an interests
in unix, oracle and system administration would work best with Java or C++.

I am an undergrad student at NYU. The program requires that I
concentrate on an application language either C, C++ or Java. That is
all that is offered in this program. I want to know which language is
best to start with given my interests (unix and oracle); my skill (shell
scripting, SQL and PL/SQL) and current developments of programming
languages.

|> Why focus on one language?

Pat, I have no intention on sticking with one language, however for all
practical purposes, when selecting classes in this program I must choose
a programming language. That is the purpose of my inquiry, to make an
educated decision for next semesters course selection.

Any thoughts?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCqlYSs2AZ6g3dZu8RAgimAJ4pfLpb5/SnoI1K6lHn+7CBY1aUdACePebJ
REB+ouFCedXilZGzvqLyix8=
=q8jg
-----END PGP SIGNATURE-----
 
H

Hakim Singhji

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

(e-mail address removed) wrote:
| Patricia Shanahan wrote:
|
|
|>Why focus on one language?
|
|
| I think it is best to learn one programming language at a time. Do you
| agree? Besides, the curriculum is designed to cover the nuts and bolts
| of one programming language. Although, I know over time I will learn
| others.
|

My appologies for any misunderstandings. I was not able to come to a
strong conclusion from this discussion. I think I may have posed the
question somewhat ambiguously. I hope this clears up any ambiguity: I
wanted to know if my unix background and/or SQL, PL/SQL and an interests
in unix, oracle and system administration would work best with Java or C++.

I am an undergrad student at NYU. The program requires that I
concentrate on an application language either C, C++ or Java. That is
all that is offered in this program. I want to know which language is
best to start with given my interests (unix and oracle); my skill (shell
scripting, SQL and PL/SQL) and current developments of programming
languages.

|> Why focus on one language?

Pat, I have no intention on sticking with one language, however for all
practical purposes, when selecting classes in this program I must choose
a programming language. That is the purpose of my inquiry, to make an
educated decision for next semesters course selection.

Any thoughts?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCqlfUs2AZ6g3dZu8RAgjPAJ9ZOB3al1rjcf6NTdlqDiZZF/1N6wCcCDR2
/Jz2NBaHq7rs4p+fs+fIl7w=
=wZs1
-----END PGP SIGNATURE-----
 
C

Chris Smith

Hakim Singhji said:
My appologies for any misunderstandings. I was not able to come to a
strong conclusion from this discussion. I think I may have posed the
question somewhat ambiguously. I hope this clears up any ambiguity: I
wanted to know if my unix background and/or SQL, PL/SQL and an interests
in unix, oracle and system administration would work best with Java or C++.

There's definitely a synergy between UNIX and C, and to the extent that
C++ is like C, there's something left of that synergy there as well. In
that sense, a UNIX background MIGHT suggest learning C++ over Java.
(Here too, though, there's more to be considered. If you learn C++ with
ATL and MFC for Windows environments, this will look precious little
like your average C++ code; that difference is perhaps greater than the
difference between some C++ and Java.

On the other hand, there's definitely a strong connection between Java
and databases... not so much on a language level, but in the sense that
a lot of industry database giants are also hopping on the Java track.
Also, Java is used in a lot of the same environments where databases are
relied on heavily.

Basically, either Java or C++ would be a fine choice. C++ would take
you more in the system programming direction (at least in potential,
though there are plenty of applications developed in C++ as well),
whereas Java puts you in the business software environment.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
G

Giovanni Azua

Hi Hakim,

Please find my comments bellow:

... I also am very fond of SQL and Oracle's PL/SQL however I am
looking to focus my studies on either C++ or Java and I am looking
for a little bit of advice in this area.
I think this is not the right way to ask for applicability of a language,
both
C++ and Java (I would not even bother with C) can be used in a wide
range of applications that in some cases overlap, and in some just, do
not, your question should be like:

If I had to develop a project with requirements _____________ what
would be the best fit?

There are many factors on this, like: from which language can you reuse
more?
APIs? libraries? components? frameworks? i.e. where can you implement it
faster
and better? what has been more often used by others to solve this kind of
project?

You can: read reviews, compare, benchmark, prototype, use newsgroups.

e.g.

- Developing Web-based Database applications. You can use both
C++ and Java but Java has richer frameworks and API's for this
e.g. J2EE (transaction, remoting, concurrency, security, persistence),
in C++ you would need to whether do it yourself or pay a very expensive
provider who give you a kind of CPP2EE framework for that.
(Answer is you NEED Java).

- Developing a Windows Service that interacts with users through the
Windows System Tray. Cosidering Java ... are you sure? really not
possible unless you overcome that you reached the boundary of the
multiplatform features of Java by wrapping it with Windows-specific
code.
(Answer is you NEED C++ and Windows SDK)

- Developing external functionality to Oracle that needs to interact with
environment and is not available in Oracle PL/SQL API e.g. saving
information in the System Registry (Windows or Unix). Considering
C++ ... are you sure? If you develop this piece in C++ you will have
to maintain as many versions of your C++ as there are different
Environment
Registry API's in each platform. The answer is develop a Java component
that is callable from e.g. Java Stored Procedure ...
(Answer is you NEED Java).
It appears that Java is easy to learn and it's popularity is steadily
increasing because of its speed and ease of use. However, C and C++ are
industry standards which will undoubtedly be used for a long time.
Using Java also has limitations. I think a strong limitation is sometimes
performance for rich client-side GUIs e.g. developing a rich fron-end
using Java e.g. Swing appears slow and in the case of Windows not exactly
as Windows users would expect a GUI to be. I would only implement a rich
GUI for Windows using MFC and many and many of the existing
controls around.

Best Regards,
Giovanni

PS: I think the best you can do is try to use the best fit (language,
framework,
components) for each different project you have instead of sticking to a
single
choice to solve everything. This is what I did when I made my BSc. and what
I would do in your place.
 
C

Chris Uppal

Patricia said:
Why focus on one language?

Not relevant to the OP, but would you suggest learning Java and either C or C++
/at the same time/ ? I'd have thought that the superficial similarites between
them would cause considerable interference.

-- chris
 
C

Chris Uppal

Hakim said:
The program requires that I
concentrate on an application language either C, C++ or Java. That is
all that is offered in this program. I want to know which language is
best to start with given my interests (unix and oracle); my skill (shell
scripting, SQL and PL/SQL) and current developments of programming
languages.

A few observations:

C and C++ would probably take you further from your "comfort zone", since you'd
be thinking in terms of what the machine is doing, rather than programming in
the more "hand-holding" languages you are used to. This is more true of C that
C++, but it true to some extent of both. Whether you see that as something to
be welcomed or not is for you to decide (I could understand either attitude).

Java would be more likely to induct you into a habitual appreciation of the
skills involved in large scale software development (I don't say that those
skills don't exist, or are not /extremely/ valuable in C or C++, just that
those languages are not designed in such a way as to encourage "doing it right"
naturally).

If career prospects /in the language you use for this course/ are an important
factor, then I'd say that C is the least valuable of the three.

C++ is more intricate than Java, and is easier to get wrong (in several senses
of the word "wrong"). You will spend a relatively greater proportion of your
time learning to use the tool (the programming language) rather than learning
what you can do /with/ the tool. You may see this as wasted time (especially
with your background).

A slightly vague observation: because of it's cross-platform emphasis (and to
an extent, because it doesn't interface will with other languages) Java is
something of a world on its own. If you are programming Java on Unix, then you
will be doing very little Unix-related stuff -- pretty much everything will be
happening in Java. (You will still be talking to SQL databases, I assume, but
you will be doing very little Unix scripting)

I suspect that in the end, the choice will not make a great deal of difference.
Provided that you end up learning whichever language it is reasonably well, and
learn to use it appropriately, then you'll have gained roughly the same value
from that part of the course. I suggest (somewhat tentatively) that it
wouldn't be altogether stupid to let non-technical aspects sway your
decision -- whether there's a teacher you detest (or just find confusing) on
one course rather than the other, what are your friends doing, and so on...

Good luck!

-- chris
 
O

opalpa

I prefer writing database (oracle) programs in Java over C++ and C.

C++ is much more difficult than C and C++ is much more difficult than
Java. However everything computable is computable in Java, and
skipping C++ is for the most part just going to be skipping agony when
your first few complex programs do things that are not what you
intended and you cannot find what the heck is going on.

Java is like the greatest technological achievment of man kind.
 
P

Patricia Shanahan

Chris said:
Patricia Shanahan wrote:




Not relevant to the OP, but would you suggest learning
Java and either C or C++ /at the same time/ ? I'd have
thought that the superficial similarites between them
would cause considerable interference.

-- chris

Not necessarily literally at the same time. According to the
base article, the OP is majoring in Information Systems
concentrating on Application Development, but has very
limited exposure to general purpose languages, a little
Perl. That suggests to me that there are a considerable
number of programming classes and projects in the OP's
immediate future.

If the rules for the course require focus on one language or
the other, of course the OP has to do that.

The danger in learning one language and going through all
courses such as data structures using it is the
one-true-language syndrome. Sufferers become emotionally
incapable of appreciating any feature in any other language
that differs from the favored language. Other languages
appear to be, at best, crippled subsets of the favored language.

I suspect that the professor the OP consulted may be at
least a mild sufferer. I was very familiar with C and C++
before I started learning Java. I still had to go through
the normal process of alternating reading with writing small
programs, just as I would with any new language, before I
got Java. The similarities are in superficial areas, such
as syntax. The differences are in really critical areas,
such as how memory is managed.

Patricia
 
D

DavidEng

My advice is that if you are a student now, focus on fundamental stuff in
computer science. It's too earier to focus on some specific area, such as
database or administrator. Even you want to concentrate on this area now,
it doesn't mean you will work on this area after graduation, or if you work
on this area it doesn't mean you will work on this area forever. If you
learn fundamental in software, you will be easier when career changes.

That's why I suggest you learn assembly first. Then C and C++ as
programming language. Learn algorithm, data structure and relational model.
It is easy to understand algorithm and data structure if you know C/C++.
When you are in school to learn some hard stuff, you will benefit later in
your career.

Of course, if you are a student of training school or community college, I
definitely suggestion you to learn Java first.
 
W

Wibble

I prefer writing database (oracle) programs in Java over C++ and C.

C++ is much more difficult than C and C++ is much more difficult than
Java. However everything computable is computable in Java, and
skipping C++ is for the most part just going to be skipping agony when
your first few complex programs do things that are not what you
intended and you cannot find what the heck is going on.

Java is like the greatest technological achievment of man kind.
:)

Everything is computable on a turing machine too.

I like the wheel or plastic bag though as mans greatest achievement.
 

Ask a Question

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

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

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top