aspose file tools*
The moose likes Beginning Java and the fly likes Java and other languages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java and other languages" Watch "Java and other languages" New topic
Author

Java and other languages

Stephen Foy
Ranch Hand

Joined: Oct 17, 2005
Posts: 143
Just wondering how it is, when you get quite good at java, is it difficult to apply knowledge from java to other languages like c++.

Sorry if this isnt appropriate for this forum section.


Stephen Foy - Microsoft Application Development Consultant
Gerardo Tasistro
Ranch Hand

Joined: Feb 08, 2005
Posts: 362
No, not at all.
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
I first learned to program with GWBASIC under DOS 5.something when I was in high school. When I took my first C programming course in college, I found a lot of the concepts transfer directly. Most of my time was spent in learning a new syntax to do the exact same things I was already used to. Then I took a course in C++ and now do some Java. I've also dabbled in Python, Perl, Lisp, and PHP. In my experience, each language is a little bit easier.

Java and C++ are very similar, so in some ways it will be easy since the syntax is somewhat familiar. However, C++ has some different pitfalls, so you have to be careful. For instance, you have to worry about memory management yourself since there is no default garbage collector. There are other minor differences, too, such as "bool" instead of "boolean". Once you get going, you should get used to these differences. Just be sure that you learn what things you CAN transfer from Java and which ones you should NOT.

Layne


Java API Documentation
The Java Tutorial
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
The last thing I did before leaving C++ for Java was buy the book "Exceptional C++" by Herb Sutter (subtitled "47 Engineering Puzzles, Programming Problems, and Solutions"). It languished on a shelf until I took it with me to survive a Christmas with the in-laws. This is essentially a book about pitfalls, and I hoped that I could apply some of what I read to Java or object-oriented design and programming in general. No such luck, but it did make be feel happy to be working in Java, and not dealing with all the gotchas of C++.

Some somethings transfer and somethings don't. You could argue that it's all experience and therefore all good, but the amount that transfers can be slight, so it could amount to a near-complete waste of time.

On the other hand, the first time I read the Gang of Four's Design Patterns, I was totally blown away by how much insight the book packed in and how relevant it was to OOP, in any language. I skipped all the code samples (which are mainly in C++, with some smalltalk thrown in to really confuse me) and still do now, when I go back to the book. I guess I'm saying that what I get the most out of is the higher level stuff, and this seems to be what I can apply across languages, versus things like "watch out for == versus equals()", which is true enough, but doesn't travel.
[ January 16, 2006: Message edited by: Jeff Albrechtsen ]

There is no emoticon for what I am feeling!
Steve Stanicki
Greenhorn

Joined: Sep 24, 2005
Posts: 23
I took a VB .NET course about a year ago, and I find that VB .NET has taken alot from Java. Java seems much cleaner. For instance, if a method in VB overrides another method, you have to declare it with "overrides myOtherMethod" when you declare the method. It's kinda fuzzy now, but this is what I remember. In Java you just do it.

So it would be very easy to learn VB .NET after Java, or vise versa.

Steve
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Originally posted by Steve Stanicki:
Java seems much cleaner. For instance, if a method in VB overrides another method, you have to declare it with "overrides myOtherMethod" when you declare the method. [...] In Java you just do it.


Hmmm... If you are using the current version of Java, you should be using the following annotation when overriding a method:Just do it, or do it properly? (Okay, it's not such a good slogan for selling shoes )
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java and other languages