Should I learn C++ or Java now?

I

inline_four

I disagree. I think learning C first is a good idea if you're
planning to master procedural programming. Not saying, it's bad, but
in my own experience, you can get ahead better with a solid
understanding of OOP. I believe it's better to get good at OOP with a
language such as Java or Python and then move on to things like C++ to
be able to write fast applications (GUI, games, complex number
crunching).
 
T

tom_usenet

Bjarne Stroustrup wrote:
[...]
To understand a language is to understand the programming techniques
it supports and how it supports them.

AFAICS, C++ doesn't support things like: (see TC++PL)

void g(priority_queue<string,String_cmp>& pq)
{
priority_queue<string> pq2(String_cmp(nocase));

presumably:
priority_queue said:
pq = pq2; // ok: pq and pq2 are of the same type, pq now also uses String_cmp(nocase)
}

Or am I just missing (e.g. some errata) and/or misunderstanding something?

What's wrong with the code fragment (apart from the typo)? It empties
the passed priority queue and gives it String_cmp(nocase) as its
predicate.

Tom
 
A

Alexander Terekhov

tom_usenet wrote:
[...]
presumably:
priority_queue<string,String_cmp> pq2(String_cmp(nocase));
Yep.


What's wrong with the code fragment (apart from the typo)?

Uhmm. Based on the TC++PL quotation below, I tend to clasify it as a
thinko ("ala Bazarov"; see the context from there it all comes from),
not typo.

<quote>

map<string,int> m1;
map<string,int,Nocase> m2; // specify comparison type (§17.1.4.1)
map<string,int,String_cmp> m3; // specify comparison type (§17.1.4.1)
map<string,int> m4(String_cmp(literary)); // pass comparison object

</quote>

I may be missing and/or misunderstanding something, of course.

regards,
alexander.

P.S. Hey Bazarov, "great minds think alike", oder? ;-)
 
T

tom_usenet

Uhmm. Based on the TC++PL quotation below, I tend to clasify it as a
thinko ("ala Bazarov"; see the context from there it all comes from),
not typo.

<quote>

map<string,int> m1;
map<string,int,Nocase> m2; // specify comparison type (§17.1.4.1)
map<string,int,String_cmp> m3; // specify comparison type (§17.1.4.1)
map<string,int> m4(String_cmp(literary)); // pass comparison object

</quote>

I may be missing and/or misunderstanding something, of course.

If he makes the same mistake twice in different contexts, it seems
like he's expecting template argument deduction of a type from
arguments passed to the constructor or something. A thinko, as you
say!

Tom
 
A

Alexander Terekhov

Bjarne Stroustrup wrote:
[...]
You can find the errata on my home pages,

http://www.research.att.com/~bs/3rd_printing6.html (m4)
http://www.research.att.com/~bs/3rd_printing7.html (Pqueue)
but if you have an early
edition, it might be worth upgrading. The latest printing is the 18th.

I have the 3rd edition pdf(s) [1st printing, I guess] from the IBM
Visual Age C/C++. Uhmm, perhaps you can provide a patch, oder? ;-)

regards,
alexander.

--
"If Unix were a car, they said, SCO Unix was like a driving motorized
wheelbarrow through a mosquito-infested swamp naked with both hands
tied behind your back."

-- http://www.humorix.org/articles/may03/sco.shtml
 
B

Bjarne Stroustrup

Alexander Terekhov said:
I have the 3rd edition pdf(s) [1st printing, I guess] from the IBM
Visual Age C/C++. Uhmm, perhaps you can provide a patch, oder? ;-)

I think what they shipped with the IBM compiler was something like a
3rd printing. It's now 1000+ corrections/improvements and two
appendices behind. If I were actually using it, I'd retire it to my
personal museum and get a new printing.

I do provide "patches" aka errata, and the two extra appendices are
also on my home pages as is the C/C++ compatibility appendix (by
popular demand). However, "patches" will only get you so far.
 
A

Alexander Terekhov

Bjarne said:
Alexander Terekhov said:
I have the 3rd edition pdf(s) [1st printing, I guess] from the IBM
Visual Age C/C++. Uhmm, perhaps you can provide a patch, oder? ;-)

I think what they shipped with the IBM compiler was something like a
3rd printing. It's now 1000+ corrections/improvements and two
appendices behind. If I were actually using it, I'd retire it to my
personal museum and get a new printing.

The "problem" is that I really need pdf(s)! Searching aside, I have
terrific ThinkPad with a FlexView display, you know.
I do provide "patches" aka errata, and the two extra appendices are
also on my home pages as is the C/C++ compatibility appendix (by
popular demand). However, "patches" will only get you so far.

I meant that "a patch" would provide some "data" plus some nice C++
program [open source, of course] that I'd use to update the stuff:

02/18/1998 03:03 PM 71,601 appA.pdf
02/18/1998 03:04 PM 63,046 appB.pdf
02/18/1998 03:06 PM 196,765 appC.pdf
02/18/1998 03:07 PM 86,541 ch1.pdf
02/18/1998 03:08 PM 183,056 ch10.pdf
02/18/1998 03:09 PM 200,553 ch11.pdf
02/18/1998 03:16 PM 153,774 ch12.pdf
02/18/1998 03:17 PM 152,795 ch13.pdf
02/18/1998 03:18 PM 165,478 ch14.pdf
02/18/1998 03:02 PM 202,431 ch15.pdf
02/18/1998 03:19 PM 177,831 ch16.pdf
02/18/1998 03:23 PM 269,602 ch17.pdf
02/18/1998 03:24 PM 264,881 ch18.pdf
02/18/1998 03:36 PM 193,287 ch19.pdf
02/18/1998 03:37 PM 119,948 ch2.pdf
02/18/1998 03:38 PM 166,133 ch20.pdf
02/18/1998 03:42 PM 301,934 ch21.pdf
02/18/1998 03:43 PM 202,769 ch22.pdf
02/18/1998 03:46 PM 135,671 ch23.pdf
02/18/1998 03:48 PM 195,784 ch24.pdf
02/18/1998 03:49 PM 132,684 ch25.pdf
02/18/1998 03:50 PM 121,593 ch3.pdf
02/18/1998 03:51 PM 96,204 ch4.pdf
02/18/1998 03:52 PM 102,436 ch5.pdf
02/18/1998 03:54 PM 177,092 ch6.pdf
02/18/1998 03:55 PM 118,218 ch7.pdf
02/18/1998 03:56 PM 149,431 ch8.pdf
02/18/1998 03:57 PM 126,849 ch9.pdf
02/18/1998 03:59 PM 165,653 index.pdf
02/10/1998 02:32 PM 8,970 npref.pdf
02/10/1998 02:30 PM 7,495 opref.pdf
02/04/1998 01:55 PM 5,766 part0.pdf
02/04/1998 01:50 PM 4,827 part1.pdf
02/04/1998 01:52 PM 5,130 part2.pdf
02/04/1998 01:53 PM 4,800 part3.pdf
02/04/1998 01:53 PM 5,144 part4.pdf
02/04/1998 01:46 PM 4,640 partA.pdf
02/10/1998 02:29 PM 8,604 pref.pdf
02/18/1998 04:01 PM 45,888 tbl.pdf
02/10/1998 02:35 PM 10,993 title.pdf

I'd simply "apply a patch" and, voila, all bugs are gone and I
enjoy 1000+ corrections/improvements. Well, it won't "++" book
sales, though. ;-)

regards,
alexander.
 
J

John D.

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?

If you want to learn to program games you should start
with learning how to program games. Choice of language is incidental.
Find a good book on programming games in BASIC. Once you grasp
the fundamentals of games design, you will be able realize
what you really need from a programming language to help implement
your idea. Programming games is more than just writing C++ or
Java code. It is a writing a script, designing user interface,
graphics, graphics engine, scripting engine, etc, etc, etc...

BASIC is a good language to learn programming. If you want to take
on C++, then use what you already know. This is how I would do it.
1. Think of an algorithm you want to implement.
2. Implement it in BASIC.
3. Then do it in C++.
4. Then do it in C++ without using "goto". :)
 
B

Bladez

i personaly think learning C++ first then maybe doing java , C++ will
probley give u a better idea on java
 
F

Fred

Bladez said:
i personaly think learning C++ first then maybe doing java , C++ will
probley give u a better idea on java

Outside of very basic similarities in syntax, one will not really help you
with the other.

Learn first whatever you think will pay the bills the quickest.

Java is actually more complicated to learn, not because of the language
itself, but because of all the extra subsystems one needs to know in
today's marketplace -- J2EE, Struts, JSP, etc.

-Fred
 
G

Govindan

Fred said:
Outside of very basic similarities in syntax, one will not really help you
with the other.

Learn first whatever you think will pay the bills the quickest.

Java is actually more complicated to learn, not because of the language
itself, but because of all the extra subsystems one needs to know in
today's marketplace -- J2EE, Struts, JSP, etc.

-Fred

I agree with Fred, learn the skillset that helps pay the bill first.

However from a technical viewpoint, learn C++ really well, most commercial
and network applications are written in C/C++.
Then learn a bit of Java, since it is so popular now, it wouldnt hurt to put
it on your resume.

In my opinion, the core language Java and associated technologies like
J2SE(Java Standard Edition ) and J2EE (Java Enterprise)
are for people who can't program well or dont have the adequate Computer
Science or Engineering background to do
enterprise development in teams. Java is more for cyber coolies.

For example EJB (Enterprise Java Beans) was invented because most
programmers and developers could not handle the
complexity of CORBA,DCOM, RMI and all that funky distributed and advanced
database computing stuff like transaction processing,
component models. EJB provides a very simplified abstraction for component
transaction monitors (CTMs), which represented
convergence of 2 technologies like transaction processing monitors (TP) eg
Tuxedo etc and distributed object services like DCOM, CORBA etc.
EJB is just a simple server-side component model that makes it easier to
developer Java components (EJBs, web applications etc)
among various Application servers( that is the EJB containers). The J2EE
specifications are just a bunch of coding, design rules and contractual
terms
that allows one standard J2EE application that runs one one standard J2EE
container to run in another without modification.

Struts and JSP are no harder than DHTML or Embedded Perl with some XML
thrown in for configuration and deployment.
ASP and Visual Basic is more brainless, trivial.

Java has syntax more similar to C than C++; had garbage collection,
exception handling similar to C++.
Java does not have multiple inheritance like C++, uses interfaces instead.
Java is a distant dialect of Lisp
with C-like syntax and with some Smalltalk semantics thrown in.

Learn C++ well and some Java.

Regards,
Govindan
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top