Java or C++?

S

s0suk3

I've been programming Python for a couple of years now. Now I'm
looking to move on to either C++ or Java, but I'm not sure which.

Which one do you think will be a better transition for a Python
programmer? Which one will educate me the best?
 
S

s0suk3

* (e-mail address removed):



Define "better".

Going to Java will be easier.


Define "best".

Cheers, & hth.,

- Alf

Well, I mean "better" and "best" in a very general sense, whichever
sense you want to interpret it on. More useful, more fun, more
educational, etc; or, as you already suggested, easier. Thanks.
 
K

Krice

More useful, more fun, more
educational, etc; or, as you already suggested, easier.

The reason you are asking this here is that you have already
decided for C++, which we all know is the best programming
language.
 
S

s0suk3

The reason you are asking this here is that you have already
decided for C++, which we all know is the best programming
language.

Not quite. I also posted it on comp.lang.java.programmer. I really
really can't decide!
 
L

Lambda

I've been programming Python for a couple of years now. Now I'm
looking to move on to either C++ or Java, but I'm not sure which.

Which one do you think will be a better transition for a Python
programmer? Which one will educate me the best?

It depends on what do you want to do with C++ or Java.

I've spend several years with Java and becoming interested in C++.
They are strong at different kind of applications.

What kind of applications do you want to develop next?
 
J

Jim Langston

I've been programming Python for a couple of years now. Now I'm
looking to move on to either C++ or Java, but I'm not sure which.

Which one do you think will be a better transition for a Python
programmer? Which one will educate me the best?

Well, what is it you want to program?

You want to program 2D games? Java may be the way to go.
You want to program 3D games? C++ may be the way to go.
You want to write device drivers? C++

C++ is a more generall all around language that will allow you do do
anything, but with a cost. The cost of a much longer and steeper learning
curve. Java will get you writing applications faster, but for some things
you just won't be able to do it in Java or will have to find a library
written in some other language (such as C++) that interfaces into Java.
 
K

Krice

Everything that you
can do in C++, you can do it much easier in Java

Can you break the class hierarchy and just hack in some old
school procedural code in Java?
 
M

Matthias Buelow

I've been programming Python for a couple of years now. Now I'm
looking to move on to either C++ or Java, but I'm not sure which.

Both of course. Both are important contemporary languages that a
professional programmer ought to have at least some basic knowledge of.
Which one do you think will be a better transition for a Python
programmer? Which one will educate me the best?

Any Lisp dialect.
 
J

James Kanze

There is nothing that you can do in C++ that you can't do
in Java (except write low-lever drivers perhaps).

There's actually a lot: programming by contract, for example, or
intelligent management of locks. Or distribute a program for
which you can give reasonable guarantees of reliability on any
platform on which it runs (i.e. no dynamic linking).

I work mainly on large servers. I can't use Java for
reliability reasons; my code must work, every time.
Everything that you can do in C++, you can do it much easier
in Java with standard libraries that support threading,

Threading is actually considerably easier to do right in C++
than in Java.
networking, GUI and much more.

GUI is easier in Java. I've had no problem networking in C++,
and all of the large servers I'm familiar with (e.g. Apache,
etc.) are written in either C or C++---never in Java. When I
wrote the server for dynamic allocation of IP addresses
(networking), we used C++ for the server itself (for reliability
reasons, mainly---we guaranteed up time), and Java for all of
the interface code around it (mostly beans under WebSphere).
Also, the java app with GUI and networking will run only every
OS that has a JVM. In C++ you have to hunt for libraries,
build them, and there is no guarantee that you will get a
portable product in the end.

And if the code is only supposed to run on one machine, or a
small set of machines? With care, it's possible to write C++
code which ports easily to most Unix machines, and for large
scale servers, that's all you're interested in anyway.
 
J

James Kanze

Both of course. Both are important contemporary languages that
a professional programmer ought to have at least some basic
knowledge of.
Any Lisp dialect.

That's actually a good point. If the goal is learning, a
language which gets you out of the OO/procedural mold will
probably teach you a lot more than a language which is, when all
is said and done, pretty similar to the one you already know.
 
N

noagbodjivictor

I've been programming Python for a couple of years now. Now I'm
looking to move on to either C++ or Java, but I'm not sure which.

Which one do you think will be a better transition for a Python
programmer? Which one will educate me the best?

Are you sure you've been programming Python for years now? I believe
that Python is similar and better than Java, and the natural language
that a person would switch to after python is C/C++ (because Python
modules are extended by C).

So, No, you've not been programming Python for years. And you should
stop saying it.
 
S

s0suk3

Are you sure you've been programming Python for years now? I believe
that Python is similar and better than Java, and the natural language
that a person would switch to after python is C/C++ (because Python
modules are extended by C).

So, No, you've not been programming Python for years. And you should
stop saying it.

Yes, I have.
 
C

Crazy c

I've been programming Python for a couple of years now. Now I'm
looking to move on to either C++ or Java, but I'm not sure which.

Which one do you think will be a better transition for a Python
programmer? Which one will educate me the best?

To get a good handle on Java, C++ is the best foundation. Java is a
very friendly C++. Yes, sometimes C++ is like oral surgery, but once
you somewhat get it, Java is a cake walk, so to speak.
 
I

Ian Collins

Razii said:
Would compiler be able to optimize this, like JIT compiler? i.e if
the compiler is sure that there won't be array out of bound, the check
is never done?

Yes.
 
L

Lambda

Well, I mean "better" and "best" in a very general sense, whichever
sense you want to interpret it on. More useful, more fun, more
educational, etc; or, as you already suggested, easier. Thanks.

I recommend learn C++ and Java all.
If you learn C++ first, you'll find Java is much easier to learn.
C++ is more fun, more educational, as you can handle details.

Java has more full library than C++, such as networking, GUI, web.
But C++'s container and algorithm libraries are more powerful than
Java's.

I'd like to learn Python next. You know why?
C++, Java and Python are Google's favorite languages. :)

Stephen Hsu
 
X

xtrigger303

Hi to all,

I've to say that all these threads C++ vs the world are very
interesting.

I'am an amateur programmer, I do small MIDI and audio apps just for
fun,
mainly for my electronic music productions( always just for fun, no
talent at all, sigh... ;-)

All the statements made in recent threads make me think that all the
hours spent in
learning how to program in C and C++ were useless.

So out of frustration I would like to ask to Java, 0Caml or whatever
else supporters:
How many POPULAR COMMERCIAL APPS in "real-time" fields like audio,
video or video-games
are made in Java or whatever else. I ask about these kind of apps
because they're the ones
I'm mostly interested in and because I would think they're the ones
where speed is of great importance.

My understanding is that (correct me if I'm wrong ):

- Almost all today's audio technologies/apps (like Cubase, Logic, VST
and Core Audio stuff )
are written in C and C++. For an awesome audio app that is written
mainly in C++ check out
Propellerheads Reason.

- 90% of todays video-game engines are written in C or C++. I'm
totally sure about Unreal Engine.
Plus I've seen source code for Quake and others. Never seen any Java
code for POPULAR GAMES.

- My personal favourite Metal Gear Solid for PS2 had its engine
written in C. I'm sure about MGS2,
cannot be sure about the others, but...

So if EVERYTHING can be done more productively in Java or 0Caml ( or
whatever ) and the final result should
be even faster (??) than the C or C++ equivalent, WHY all pros in the
above mentioned genres are still using
obsolete languages?

Please PROs enlighten a lost soul... :)

Regards to all,
Francesco

P.S.
All this said I've to say that some Razii's thread are very
interesting...
 

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,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top