Should I learn C++ or Java now?

E

Elijah

I have read many of the topics on learning C++ or Java first.
It seems like everyone says something different.
I would like to know if I should learn C++ or Java.
First a little about myself.
I know PHP, BASIC, and of course HTML.
I'll be 15 years old in September.
I am interested in programming GUI applications.
I am also interested in programming games.
I know that I should learn C++ to program games, but would learning
Java make the process any easier? Or am I better of just diving right
into C++?
Are there any recommended books on Java or C++ (depending on which
language I should learn first) for the beginner who only know PHP and
BASIC?

Sorry if this post some how offends somebody.

A teenager in desperate need of advice,
Elijah
 
E

E. Robert Tisdale

Elijah said:
I have read many of the topics on learning C++ or Java first.
It seems like everyone says something different.
I would like to know if I should learn C++ or Java.
First a little about myself.
I know PHP, BASIC, and of course HTML.
I'll be 15 years old in September.
I am interested in programming GUI applications.
I am also interested in programming games.
I know that I should learn C++ to program games
but would learning Java make the process any easier?
Or am I better of just diving right into C++?
Are there any recommended books on Java or C++
(depending on which language I should learn first)
for the beginner who only know PHP and BASIC?

Sorry if this post some how offends somebody.

A teenager in desperate need of advice,

It would probably be more fun to learn Java first.

Programming games today is about high performance graphics.
Take as many math courses as you can get and *pay attention*!
 
C

Cy Edmunds

Elijah said:
I have read many of the topics on learning C++ or Java first.
It seems like everyone says something different.
I would like to know if I should learn C++ or Java.
First a little about myself.
I know PHP, BASIC, and of course HTML.
I'll be 15 years old in September.
I am interested in programming GUI applications.
I am also interested in programming games.
I know that I should learn C++ to program games, but would learning
Java make the process any easier? Or am I better of just diving right
into C++?
Are there any recommended books on Java or C++ (depending on which
language I should learn first) for the beginner who only know PHP and
BASIC?

Sorry if this post some how offends somebody.

A teenager in desperate need of advice,
Elijah

I wouldn't recommend learning Java as an expedient to learning C++. Learn
Java if you want to program in Java. If your ultimate goal is to learn C++
start right away. There are GUI programming tools in just about every
language today, so I don't see that as a language selection criterion.

You might also consider Python. It has a lot to offer.
 
P

Peter van Merkerk

learning C++ is best done aftee u learn c thoroughly

If you really want to learn C++ I would not take the C detour first. I
you learn C first thoroughly (like I did), you will have to unlearn a
lot when you are start programming C++. The problem is that even though
almost all C constructs still work in C++, they are often not
appropriate in a C++ context because C++ offers usually much better
alternatives.
Because u wud be able to make a differece between language specific
syntactical info(in C) and object oriented concepts of C++
Once u learn language syntax in C thorughly , when u start learning C++ u
wud be able to apprciate the OOPS concepts in C++,

C++ doesn't force you to use OOP concepts. Consequently I see still many
programmers with a C background essentially programming C with C++. The
learning the syntax of a new programming language is usually the easiest
part. Learning new concepts behind it is much harder. The transistion
from Pascal to C was very easy for me, I only had to get familiar with
another syntax. However the transition from C to C++ was much harder
because I had to learn whole new concepts and new ways to structure
code.
Java since its made a platform independent it will be too heavy on u if u
are not sure of basic concepts of a high level language ,

Java can be a perfectly acceptable language to learn programming.
However if the goal is to learn C++ I wouldn't take that detour either.

I don't think that the language you use to learn programming is all that
important. I started programming with BASIC on a C64, hardly an ideal
start. Yet it learned me basic concepts like variables, loops,
sub-routines...etc, concepts you will find in just about any other
language. I do believe that quick and positive feedback is advantage
when learning to program. On the C64 I could enter a line of code, press
enter and see the results. With Python I can do the same thing, and with
Python you can learn many of the important concepts including OOP. Once
you have mastered the basic concepts, learning a new programming
language becomes a lot easier.
 
A

Agent Mulder

Eljah> Are there any recommended books on Java or C++ (depending on which
Eljah> language I should learn first) for the beginner who only know PHP and
Eljah> BASIC?
Eljah>
Eljah> Sorry if this post some how offends somebody.

Go to your local second hand bookstore and find the books
on Java and C++. You'll probably find lots of both of them.
Decide on the language by the documentation that you can get.
It is not easy to recognize a good book but some general
guidelines are:

-good books are heavy books
-good books have a good index
-good books have a good Table of Contents at the start (except
for Bjarne Stroustrup's C++ Programming Language, that has a
lousy Table of Content. There is also something with the backside
of it that I must always look twice to find it. But the weight will tell
me I'm right)

Some Java books have a CD-ROM in the back with a compiler and
tools that you need to start programming. If you plan to jump in quickly
with a high level object oriented language, I'd advice Java. With C++,
you'll have to go through a lot of grunch. But it pays of.

-X
 
P

Peter van Merkerk

Elijah said:
I have read many of the topics on learning C++ or Java first.
It seems like everyone says something different.

That is because the answer to your question depends very much on what
the objectives are. Even though many people believe differently, there
is no single perfect programming language for every possible
application. But whatever your choice will be, you can't really go
wrong. Worst thing that may happen is that you did not take the most
direct way to reach your goal, but even that experience may be valuable.
I would like to know if I should learn C++ or Java.
First a little about myself.
I know PHP, BASIC, and of course HTML.
I'll be 15 years old in September.
I am interested in programming GUI applications.
I am also interested in programming games.
I know that I should learn C++ to program games, but would learning
Java make the process any easier? Or am I better of just diving right
into C++?

If C++ is your goal go straight for C++, even though the learning curve
of C++ is steeper. At first sight Java and C++ may look deceptively
similar, but there are some major conceptual differences between the
two. These differences can make a transition from Java to C++ difficult.
Are there any recommended books on Java or C++

"Accelerated C++" (http://www.acceleratedcpp.com/ ) is usually
recommended as an excellent beginners C++ book for people with some
programming experience.
 
G

Gavin Deane

Agent Mulder said:
Eljah> Are there any recommended books on Java or C++ (depending on which
Eljah> language I should learn first) for the beginner who only know PHP and
Eljah> BASIC?
Eljah>
Eljah> Sorry if this post some how offends somebody.

Go to your local second hand bookstore and find the books
on Java and C++. You'll probably find lots of both of them.
Decide on the language by the documentation that you can get.
It is not easy to recognize a good book but some general
guidelines are:

http://www.accu.org/bookreviews/public/index.htm

<snip>
 
D

Default User

Peter said:
If you really want to learn C++ I would not take the C detour first. I
you learn C first thoroughly (like I did), you will have to unlearn a
lot when you are start programming C++. The problem is that even though
almost all C constructs still work in C++, they are often not
appropriate in a C++ context because C++ offers usually much better
alternatives.


This is one of those things I strongly disagree with. Learning C first
(to my mind) did not hamper me the least in learning C++. The OO
methodology was pretty easy to learn, and I was already familiar with
many constructs. There was little or nothing that I had to unlearn.

That being said, I also don't advocated learning C merely as a stepping
stone to C++. Learn C if you want to program in C, or to gain experience
in a popular procedural language. It is good for anyone serious about
programming to learn a number of languages of different types. I'd also
recommend becoming familiar with LISP.

Does learning C first help? A bit perhaps. Does it "poison the well"?
Nonsense.


Brian Rodenborn
 
A

AJ

I have read many of the topics on learning C++ or Java first.
It seems like everyone says something different.
I would like to know if I should learn C++ or Java.
First a little about myself.
I know PHP, BASIC, and of course HTML.
I'll be 15 years old in September.
I am interested in programming GUI applications.
I am also interested in programming games.
I know that I should learn C++ to program games, but would learning
Java make the process any easier? Or am I better of just diving right
into C++?
Are there any recommended books on Java or C++ (depending on which
language I should learn first) for the beginner who only know PHP and
BASIC?

Sorry if this post some how offends somebody.

A teenager in desperate need of advice,
Elijah



Not to sound condescending, but programming games and GUI's is not as
fun as you think, and I speak from experience. When I first got
started in programming, I thought, "wow, i want to make games and
guis". I am sure a lot of people thought this way as well. You state
that there is a rift between those who believe C++ should be the first
language learned, and those who believe Java should be learned. What
makes you think the responses here will be any different? To answer
your question, before picking up a book on game programming in java
nd/or C++, you would be better suited to evaluate your mathematical
abilities, you will need them to program games.
 
L

llewelly

Find out if games are actually programmed in Java, ie. talk to game
programmers.

No. Note that for certain popular game platforms - e.g., ps2, xbox,
gamecube, gba, there is no availible java implementation. So as
far as games are concerned, Java is 'write-once, and then re-write
from scratch in C++'. :)
If the answer is yes do Java since it is more than just a language it
comes with an enormous number of tools that can be used very easily.

Do your java tools come with a profiler? A profiler is essential for
modern action games.
In C++ you have to acquire libraries and although this is possible you
have to find out how to install them and link against them which are
issues which you don't have with Java.

If you think you don't have to understand those issues Java, I wonder
how you would fare if you had to write a large Java
application. Probably you come to hide under the table in terror
everytime you had a class path problem.
While you can draw something on the screen immediately in Java once
you understand the use of classes in Java it will take much more
effort in C++.

I don't think you know what you are talking about. First, drawing on
the screen has nothing to do with classes. Second, it is
impossible to draw on the screen in C++; the C++ standard contains
no mention of any such thing. You must use OpenGL, driectX, or
other platform-specific library. (Possibly one implemented by you
in assembler and video-chip microcode :)
C++ as a language is probably 3 times as extensive and complicated as
Java.

Why do you say 3? (I'd say 'an order magnitude' - a phrase which is
intended to convey both a great difference and an inability to
measure the difference precisely. :)
Moreover the problem is not only the language but also the tools which
are needed to build (compile and link) a program and what sort of
error messages these tools produce. If you can't handle these tools
you won't ever get to the level where there is any difference between
C++ and Java and certainly not to the point of programming games. You
will not have code that executes.

This process is much simpler in Java with decent error messages that
tell you what goes wrong and where. In C++ you might see

"program was terminated since SIGNAL 11 (segmentation fault) was
received".

Where? Why? What? ----- you find it out and learn how to use the
debugger.

No. You learn to review code. If you do not review your C++ code it
will not work - there all kinds of errors one can make in C++ that
will sneak right past your debugger.
Linker errors in C++ are ultimate horror:
"In function <incomprehensible string, seemingly unrelated to your
program> undefined reference to <ghastly string, 1000 characters all
on one line, scroll right for minutes>".

I'm glad it's been 3 years since I had to use a C++ environment whose
linker dumped mangled names at me. Today, it seems every C++
implementation I have has name-demangling linker.
Sometimes the function where supposedly the undefined reference
occured is one you have never heard of, the file resides in a
directory you did not even know existed and when you look it up there
surely is no reference to your function at all.

I have certinaly seen some bad error message, but none of this sort.
It will take a long time until you can even read these error messages.
It is very daunting.

It is better to read the code. The answer is usually there. Only read
the error message when you are convinced you cannot find it in the
code.
I have dealt with programs consisting of about 100 classes without
ever using the debugger in Java. I have also written and compiled
classes that compiled right away and worked correctly. That has never
happened to me in C++.
I am about 3 times faster in Java than in C++.

If you know Java so much better, what are you doing here?
On the other hand C++ is the pinnacle of programming languages

No language is 'the pinnacle of programming languages'. Many have
erroneously claimed to be, but C++ never has - even Bjarne
Stroustrup has said such things as 'if you like smalltalk, go use
it', 'if you need garbage collection, other languages have it,
maybe you could use one of those' and 'C++ shouldn't try to be all
things to all people'.
and it
produces very fast code. It also forces extreme discipline on you
otherwise you won't make it. Plan on programming sessions lasting 20
hours and longer.
[snip]

20 hours? Bad, bad, _*BAD*_ advice. No. To write working C++, you must
have a clear and alert mind. You must not overlook small
details. Very few people are clear and alert for 20 hours at a
time. In fact, I strongly advise no more than 2 (yes, 2!) hours
between breaks, and no more than 8 hours (yes 8!) a day of solely
programming. If you are working 16 or 20 hours a day, your excess
hours are usually better spent in design, documentation, study,
or code review.
 
V

Victor Bazarov

llewelly said:
Find out if games are actually programmed in Java, ie. talk to game
programmers.

No. Note that for certain popular game platforms - e.g., ps2, xbox,
gamecube, gba, there is no availible java implementation. So [...]

Why are we discussing Java _here_? Shouldn't the entire thread
move to 'comp.games.development.programming.misc'?
 
C

Cy Edmunds

Peter van Merkerk said:
Just read this newsgroup for a while and you will see my point.

I DO read the newsgroup, and I DO see your point. I see it very clearly. :)
 
D

Default User

Peter said:
Just read this newsgroup for a while and you will see my point.


Uhmmm, I first posted to this group in June of 1999, and so have been
reading it with fair regularity for at least that four years (I'm sure
at least a month prior to that date). As such, I don't see your point.

Can people program badly in C++? Sure. Can people stupidly try apply
things they've learned from other languages to programming in C++? You
bet. But is learning C first a handicap? I don't think so.



Brian Rodenborn
 
V

Victor Bazarov

mjm said:
Your approval is not necessary to be here.

It's apparently you who thinks the question was about any kind
of "approval to be here". You advocate using Java in a C++
newsgroup. Answer this question: what are your motivations?
 
P

Peter van Merkerk

Victor Bazarov said:
It's apparently you who thinks the question was about any kind
of "approval to be here". You advocate using Java in a C++
newsgroup. Answer this question: what are your motivations?

I never knew this was advocacy group for C++. Though I don't agree with
MJMs assessment, I don't think that postings here suggesting that Java
is a better choice should be censored by default either. If Java fits
the bill better than C++ (sometimes it does, but IMHO not in this case)
then by all means use it.
 
V

Victor Bazarov

Peter van Merkerk said:
I never knew this was advocacy group for C++.

It's not.
Though I don't agree with
MJMs assessment, I don't think that postings here suggesting that Java
is a better choice should be censored by default either.

Neither do I.
If Java fits
the bill better than C++ (sometimes it does, but IMHO not in this case)
then by all means use it.

Sure thing.

Peter, I think some emotions (perhaps rubbing off from earlier in
the thread) make you jump to conclusions. I asked the question.
Why do you need to see some kind of a hidden agenda behind it?
Why do you think it's an attempt to censor anything or a statement
against anything?

I am in no way against Java or any other language. However, bold
statements indicating superiority of anything over something else,
which usually aren't or cannot be substantiated, lead to agitated
state of the participants of the discussion. If that (agitation)
is _not_ the intention, some kind of calming interruption is needed.
I simply asked the question to see if 'mjm' had anything to say
that would clear him/her of my suspicion.

Yes, I suspect that 'mjm' is trolling (wilfully or not). But I
can be mistaken and that's why I've asked the question.

Take a deep breath. Count to ten. There is no need to jump on
anyone's throat. Yet.

Victor
 
A

Alexander Terekhov

Victor Bazarov wrote:
[...]
I simply asked the question to see if 'mjm' had anything to say
that would clear him/her of my suspicion.

Yes, I suspect that 'mjm' is trolling (wilfully or not). ....

Bazarov, one thing is pretty clear: your "motivation" is nothing but
trollophobia (a serious mental disease). Oh boy, I think that you're
suffering from it pretty badly. Condolences, my poor friend.

regards,
alexander.

P.S. I've emailed you some spare killfile segments; you know, "just
in case".
 

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,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top