Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2008

Tip: Looking for answers? Try searching our database.

Java or C++?

Thread view: 
s0suk3@gmail.com - 19 Apr 2008 14:15 GMT
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?
Arne Vajhøj - 19 Apr 2008 14:47 GMT
> 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?

What answer do you expect when asking this in a Java group ??

:-)

My Recommendation would be Python->Java->C++.

It is a good thing to know several languages.

And I believe that two small jumps will be easier for you. Python->Java
will bring you from dynamic to static types and Java->C++ will add
unsafe pointers and explicit memory deallocation.

Arne
Donkey Hot - 19 Apr 2008 14:52 GMT
Arne Vajhøj <arne@vajhoej.dk> wrote in news:4809f7e0$0$90267$14726298
@news.sunsite.dk:

>> 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.
[quoted text clipped - 15 lines]
>
> Arne

I have maybe 12 years of C++ coding behind, and now happilyt doing it with
java.

C++ is so old, like Cobol. It's needed only on so specific cases. Certainly
I would go with java, and take the C++ later if you have strength for it.
Java/Java EE and all it has is something to learn for a quite lenghty time.

Java is not hard, but it's so massive;D
Arne Vajhøj - 19 Apr 2008 15:11 GMT
> Arne Vajhøj <arne@vajhoej.dk> wrote in news:4809f7e0$0$90267$14726298
> @news.sunsite.dk:
[quoted text clipped - 21 lines]
> I would go with java, and take the C++ later if you have strength for it.
> Java/Java EE and all it has is something to learn for a quite lenghty time.

There are few applications where C/C++ is the best language today.

But that does not mean that a Java programmer can not benefit from
having learned one of those languages.

And there are still gazillions of lines of C/C++ code out there
that need to be maintained and enhanced.

Arne
Alex.From.Ohio.Java@gmail.com - 19 Apr 2008 15:28 GMT
> Arne Vajhøj <a...@vajhoej.dk> wrote in news:4809f7e0$0$90267$14726298
> @news.sunsite.dk:
[quoted text clipped - 28 lines]
>
> Java is not hard, but it's so massive;D

Definitely Java.
You don't want to go memory allocation/deallocation which is the main
subject in C++ and has nothing to do in Python and Java.

I started with Assembler, then it was Cobol, PL/1, Fortran, C, C++
then Java. Perl, Rexx, JavaScript were involved a lot too.
The best language. no questions ask, is Assembler. You can do
absolutely anything in few simple instructions. But then it gets bored
because you have to do this anything/everything again, again and
again. Like determine where is line end million times.
More advanced languages like C do it almost automatically and still
have the same power. I like C.
But you have to carry and know huge primitive libraries like strcpy.
C++ provides OOP and cares about all this stuff. I worked with C++ for
10 years and was proud of myself. I was guru and could find memory
leak in no time. But my all time (about 90%) was spent for such memory
leak finding/preventing. And when Java came I was a little confused.
What should I do when there is no memory management? Where should I
spend my 90% of my time.
And, yes, it seemed a little massive even on the start.

But after a little experience and understanding how it's organized,
how packages work and so on, I feel absolutely comfortable with all
Java libraries, systems and applications.
And it is still almost as powerful as Assembler and has nothing
(almost) to do with memory allocation and as extensible as you wish.
Recently I needed to catch boundary changes for windows. For my
surprise I didn't find such Listener in Java.
First of all I knew for sure where it should be in the standard
packages, so I knew it didn't exist.
Second one - I was able to write my own BoundsChangedListener in few
lines of code and use it as easy as any other standard Listener.

Isn't it wonderful?
So, Java is my favorite language for more then 10 years and I strongly
recommend it.
Of course you can learn other languages and approaches like Ruby or
http://symade.com/ but (I believe) you need to spend at least few
years of hard coding till you start to feel the language.

So, good luck with any language. Just don't waste your time on not
required ones.

Alex.
http://www.myjavaserver.com/~alexfromohio/
Donkey Hot - 19 Apr 2008 17:49 GMT
> And when Java came I was a little confused.
> What should I do when there is no memory management? Where should I
> spend my 90% of my time.
> And, yes, it seemed a little massive even on the start.

Good writing overall.

But Java IS massive.

When we did C or C++ we codd some nice applications all from the start, and
we knew what we did.

In Java days, we have Ejb, Ejb2, Ejb 2.1, Ejb 3.0, Struts, Struts2, JSF,
and what not middleware like JBoss and WebSphere. Things are not simple any
more. When you write an application, you have to decide if it will be an
Eclipse plugin (a Netbeans plugin) or maybe a "Rich Client" on said
platforms, or maybe a browser based GUI and using a Java EE platform as
middleware.

We did not have HTML, XML, CSS when we just coded C. Now we have Java and
ALL those. Java is nothing without HTML, XML, CSS, Struts, Ejb, Hibernate,
Quartz...

Coding is integrating nowadays. It was much easier during the Cobol and C
times.
EricF - 20 Apr 2008 05:59 GMT
>> And when Java came I was a little confused.
>> What should I do when there is no memory management? Where should I
[quoted text clipped - 21 lines]
>Coding is integrating nowadays. It was much easier during the Cobol and C
>times.

Java is big but not massive. The language spec is not that big. The api is
getting much larger, agreed, but these are libraries. But yes, there are a
number of related technologies. It is tough to keep up with them all.

It may have been easier in the dinosaur days (I was there), but what we do
today is so much more powerful and complex. I wouldn't want to go back if I
could.

Eric
Roedy Green - 20 Apr 2008 11:32 GMT
>But Java IS massive.

Yes but.  With other languages the libraries that come with them are
pretty  anemic and very platform specific.  You end up writing pretty
well everything from scratch yourself. With Java, you have to find
excuses to write interesting code. So much coding is just verbose
tedious plumbing -- hooking together bits of libraries written by
other people -- however, much more productive and bug free.  Java
appeals to people interested in the application.  C++ appeals to the
assembler type who is more interested in the inner guts of the OS and
writing low level code.

Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Tim Smith - 20 Apr 2008 21:30 GMT
> >But Java IS massive.
>
[quoted text clipped - 7 lines]
> assembler type who is more interested in the inner guts of the OS and
> writing low level code.

The downside of that is that you run into a higher percentage of Java
programmers who get lost if they need to do something complicated that
isn't covered by one of the libraries that came with their Java
environment.

While all languages can do this, Java for some reason seems to lead to
the most programmers who can only handle things if there is a library
for them, a design pattern to fit them into, and an IDE to handle the
boilerplate.

This isn't a flaw in Java, but more likely just a consequence of its
popularity.

Signature

--Tim Smith

Alex.From.Ohio.Java@gmail.com - 20 Apr 2008 21:49 GMT
> > Yes but.  With other languages the libraries that come with them are
> > pretty  anemic and very platform specific.  You end up writing pretty
[quoted text clipped - 10 lines]
> isn't covered by one of the libraries that came with their Java
> environment.

> While all languages can do this, Java for some reason seems to lead to
> the most programmers who can only handle things if there is a library
[quoted text clipped - 3 lines]
> This isn't a flaw in Java, but more likely just a consequence of its
> popularity.

It depends on people. A lot just use "puzzles" what they combine
together. If they don't have "blue" piece they say it's impossible.

For me beauty of Java is that you can go as deep as you want. I can
write web server or secure mail client from scratch if I want. With
any level of details or features. Or, based on your needs, you can
change or add something.

As I mentioned before, I wrote BoundariesChangedListener for Windows
in few lines of code. Another example what I did was
InterruptableInputStream to read and control data via Sockets.
Most of things I already have and it's easy to write what I don't
have.

As for lazy people they will always find excuse to do nothing no mater
what area they are in. And, yes, a lot of them are in Java because
it's fashion area.

Alex.
http://www.myjavaserver.com/~alexfromohio/
Peter Duniho - 20 Apr 2008 21:50 GMT
> [...]
> While all languages can do this, Java for some reason seems to lead to
> the most programmers who can only handle things if there is a library
> for them, a design pattern to fit them into, and an IDE to handle the
> boilerplate.

It's not just Java.  The same issue exists with respect to VB, and its  
descendants in .NET (VB.NET, C#, etc.).  Indeed, it exists in any  
environment with a broad, powerful framework and a relatively easy-to-use  
language.

When you have a powerful framework, and tools that make it easy to  
construct full-blown GUI applications, that significantly lowers the bar  
for entry.

Some may complain that this leads to less-competent-on-average  
practitioners.  I suppose in some sense that's even true.  But in the end,  
when you look at the total body of work produced by the practitioners, I  
believe that on the whole, you still wind up with about the same, if not  
more, amount of output from the more-competent practitioners, while  
improving the volume and average quality of output from the less-competent  
practitioners.

There's nothing about Java or similar environments that impede its use by  
experts, and in fact even for the expert an environment like Java provides  
a lot with respect to reliability and pre-existing solutions.  This sort  
of thing improves productivity across the board, not just for the  
less-experienced.

Pete
Arne Vajhøj - 21 Apr 2008 03:22 GMT
>>> But Java IS massive.
>> Yes but.  With other languages the libraries that come with them are
[quoted text clipped - 19 lines]
> This isn't a flaw in Java, but more likely just a consequence of its
> popularity.

You are correct.

But it does not really have a point.

I have no doubt that assembler programmers are by far the best
programmers.

But that does not mean that we should code everything in assembler.

Or in general: we should choose the languages that make it easy
to code not those that makes it difficult to code.

And the fact that languages that are very difficult would help
keep the lesser gifted programmers out of the business is
a lousy argument.

Arne
David Segall - 19 Apr 2008 15:15 GMT
>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.
Why do you want to make the move?
s0suk3@gmail.com - 19 Apr 2008 15:25 GMT
> s0s...@gmail.com wrote:
> >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.
>
> Why do you want to make the move?

Well, mostly because I only know Python, and Java and C++ are the ones
I'm most interested in. They're both suitable for large projects. Not
to mention they're perhaps the two most popular languages out there.
Anyway, I'll learn both, regardless of which one I learn first.
Arved Sandstrom - 20 Apr 2008 14:28 GMT
>> s0s...@gmail.com wrote:
>> >I've been programming Python for a couple of years now. Now I'm
[quoted text clipped - 6 lines]
> to mention they're perhaps the two most popular languages out there.
> Anyway, I'll learn both, regardless of which one I learn first.

That, of course, is the best solution - learn both. Learning Java first
would probably give you more bang for the buck...with Python under your belt
already you'd be up to speed quickly. I've seen good programmers with no
previous exposure to Java start doing very respectable work with the
language within a couple of months. If you use the Java tutorials
(http://java.sun.com/docs/books/tutorial/) as your guide you'll have a very
good roadmap.

Since there isn't exactly any one point where a programmer can ease back,
sigh in satisfaction, and say "Ahhh, I have now learned language X", except
maybe for some elite group who works on specs and compilers and core
libraries, at some point it'll make sense to start looking at C++. I don't
myself much like the way I first picked up the language, and were I to do it
again, I'd recommend obtaining a copy of Scott Meyers' "Effective C++" 2nd
Ed. early on. At the beginning and into the middle of your foray into C++,
when you are quite likely not to even know what you don't know (much of
which can bite you), this book is especially valuable. Don't expect to
understand much of it fast...just remember the items discussed and when
you're working with a certain concept in your C++ code, review the relevant
items in the book.

http://www.parashift.com/c++-faq-lite/ is also a good resource. And to a
degree not as necessary for many other programming languages, it's not a bad
idea to keep an eye on a decent C++ NG like comp.lang.c++.moderated. Let's
face it, when you have a problem in C++ it can be pretty arcane. Reading the
responses to many questions in that NG can be very illuminating.

I'll second Roedy's comment about researching your primary programming
interests - work or open source or hobby. This will drive your actual
decision. But if it's still 50/50 after looking at that I myself would go
with Java first.

Bear in mind too that learning Java the Language will be a small part of the
whole Java experience. At an early stage you'll want to start picking up
Java API's...a whole bunch of them. This is where the real learning curve
comes in for Java. With C++ on the other hand you can go a long ways on many
projects relying on a mastery of the language itself (not to discount some
of the most important libraries like STL).

AHS
Roedy Green - 20 Apr 2008 11:28 GMT
>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?

Java is closer to Python than C++.  You are mainly adding strict
typing.  C++ lets you get at platform specific features. Java does
not.

If you are thinking of work, check out what the sorts of companies you
want to work for are asking for.

If you want guaranteed lifetime employment, learn COBOL. Nobody knows
it anymore and there is a tone of maintenance work that still need
doing to keep legacy systems alive.  Not very exciting however.
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.