11 Replies - 1295 Views - Last Post: 27 February 2010 - 03:08 PM Rate Topic: -----

#1 xor-logic   User is offline

  • HAL9000 was an Apple product
  • member icon

Reputation: 128
  • View blog
  • Posts: 764
  • Joined: 04-February 10

Java to C++?

Posted 26 February 2010 - 07:35 PM

How hard would it probably be to switch from programming Java to programming C++? What are the benefits of C++ over Java? Any detriments?
Is This A Good Question/Topic? 0
  • +

Replies To: Java to C++?

#2 eker676   User is offline

  • Software Engineer
  • member icon

Reputation: 379
  • View blog
  • Posts: 1,833
  • Joined: 18-April 09

Re: Java to C++?

Posted 26 February 2010 - 07:43 PM

All you have to do is learn the C++ syntax to get started. Java and C++ are very similar syntax wise in my opinion. C++ can be very non forgiving though. Cryptic errors may get frustrating when you start coding classes and get deeper into inheritance and STL.
Was This Post Helpful? 1
  • +
  • -

#3 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Java to C++?

Posted 26 February 2010 - 08:45 PM

The problem with converting Java to C++ is that Java has a huge API backing it up, and C++ not so much. SO while something like algorithms are pretty easy to convert, applications are generally very very difficult and it is generally better to just redesign the program using C++. There will always be places where the Java code will make an excellent reference for what you want to do but in general converting an application from Java to C++ is not really very easy.

But it really depends upon what the Java code uses in the API.
Was This Post Helpful? 1
  • +
  • -

#4 xor-logic   User is offline

  • HAL9000 was an Apple product
  • member icon

Reputation: 128
  • View blog
  • Posts: 764
  • Joined: 04-February 10

Re: Java to C++?

Posted 26 February 2010 - 11:28 PM

Thanks for the weigh-ins. Nick, you misunderstand what I'm asking. I'm not trying to convert a particular program to C++. I'm worried that by learning Java I have made myself less marketable than I could have if I had learned C++, so I was thinking about focusing on C++ instead.
Was This Post Helpful? 0
  • +
  • -

#5 Munawwar   User is offline

  • D.I.C Regular
  • member icon

Reputation: 163
  • View blog
  • Posts: 457
  • Joined: 20-January 10

Re: Java to C++?

Posted 26 February 2010 - 11:54 PM

I don't see why a person who already knows Java would switch to C++ since C++ doesn't have the rich API which Java has.(Yes you can always use third party libraries).
Maybe you are to develop something at the lower level like drivers or something that really require optimization like game programming routines.Or maybe something specific to an operating system like Windows API.
Was This Post Helpful? 1
  • +
  • -

#6 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Java to C++?

Posted 27 February 2010 - 09:04 AM

AH! see I should read more skim less :)

I for one found that my Java classes ended up being far more valuable than my years of experience in C++. I currently work as a Java developer, even though I am a C++ programmer at heart. Java pays the bills.

They syntax for both languages are similar but they are very different. C++ is a much more "computer oriented" language and Java focuses more on the problem space at hand. That is to say you spend far less time thinking about bits and bytes and memory locations, memory allocation, etc. in java than you don in C++. So in some ways it is a better language to learn to program in because you get to focus more on the problem and less on the details of the implementation in a computer. This is especially true because most C++ classes are really just fancy C because C++ is almost always learned as C plus the OOP stuff, rather than as its own language.

Learning to program really has little to do with the language you learn on. So learning to program in Java will teach you to program and then it should not be too hard to learn C++ later. Though you MAY find it a bit frustrating to go from learning Swing and then have to turn around and learn console applications and then learn the windows API (or whatever GUI framework you choose).
Was This Post Helpful? 1
  • +
  • -

#7 Munawwar   User is offline

  • D.I.C Regular
  • member icon

Reputation: 163
  • View blog
  • Posts: 457
  • Joined: 20-January 10

Re: Java to C++?

Posted 27 February 2010 - 09:20 AM

View PostNickDMax, on 27 February 2010 - 07:04 PM, said:

...even though I am a C++ programmer at heart. Java pays the bills.

LOL

View PostNickDMax, on 27 February 2010 - 07:04 PM, said:

...So learning to program in Java will teach you to program and then it should not be too hard to learn C++ later. Though you MAY find it a bit frustrating to go from learning Swing and then have to turn around and learn console applications and then learn the windows API (or whatever GUI framework you choose).

Yes.That is why I feel one should learn C++ before java.For a C++ programmer, it's quite easy to learn java (the syntax).
Currently my college is trying to teach Java and my friends know nothing other than C.They are breaking their heads with the 'hello world' program. Hah..They cannot understand what class,public,static and System.out.print is.
Was This Post Helpful? 1
  • +
  • -

#8 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Java to C++?

Posted 27 February 2010 - 10:38 AM

You know when I was in school I did the same thing: "Java is for n00bs I was to learn 'real programming' in C++"

But, now on the other end I offer some other perspectives:

#1 Java has a much more shallow learning curve (the very beginning part may be a bit steeper -- the basic Java "hello world" example is more complicated than one in C++) so once you get the basics out of the way it is easy to move on to concepts like abstract data structures and algorithm analysis -- i.e. the stuff CS courses are supposed to teach you.

#2 You are not there to learn a particular language, you are there to learn to PROGRAM and to learn computer science -- neither of which has anything in particular to do with C++ or Java. So by learning Java you will be able to get to the meat of what you need to learn faster.

#3 Paradigms shift, the world moves on, the way we think changes. Java and C# represent newer trends in thought and may very well be a better introduction to the type of programming you will be doing once you leave the academic bubble. Microsoft has stated quite categorically that forward momentum on the desktop will be .Net -- Linux is becoming more and more popular with each passing day, and the importance of platform independence is growing. Intel has stated quite clearly that the days of single core processors in desktops and servers are numbered. -- Java is an excellent platform independent language that easily handles multi-threaded programming and is a FAR better segway into .Net than C++.

I would really say that using Java as a base language for a CS curriculum is better than C++ -- I am not saying that C++ is obsolete or that Java is a "better" language.

Languages are tools -- Professional programmers use MANY languages, and we learn to try to pick the best tool/language for the job -- IMO Java is a better tool for the job of teaching CS. May not be the *best* tool... but probably better than C++
Was This Post Helpful? 1
  • +
  • -

#9 xor-logic   User is offline

  • HAL9000 was an Apple product
  • member icon

Reputation: 128
  • View blog
  • Posts: 764
  • Joined: 04-February 10

Re: Java to C++?

Posted 27 February 2010 - 12:48 PM

View PostNickDMax, on 27 February 2010 - 09:38 AM, said:

You know when I was in school I did the same thing: "Java is for n00bs I was to learn 'real programming' in C++"

:P Believe me, I don't think Java is for n00bs nor have I ever. I've just noticed in scanning the job ads in my area that C++ seems to be desired a lot, with less demand for Java.

Thank you all for the reassurance though. I will carry on as I have been.

This post has been edited by xor-logic: 27 February 2010 - 12:48 PM

Was This Post Helpful? 0
  • +
  • -

#10 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Java to C++?

Posted 27 February 2010 - 02:47 PM

Well you will find people who claim they were looking at the job ads and only see Java or C#.

Your in school, don't worry too much about what is in the job ads as they will be WAY obsolete by the time you need to worry about it. The best advice I can give you for getting a job when you get out of school is: Take NOTES. keep notes on every project that you do in school, what the challenges did you face (and not just technical ones), what did you do above and beyond the project, etc. -- Why? Because when you do your interviews they will ask you questions about these things.

Also take project classes where you can -- usually not a problem in CS curriculum but still. Having lots of projects to pick and choose for your resume is better than having only 2-3 that you HAVE to put on your resume to flesh it out.
Was This Post Helpful? 2
  • +
  • -

#11 xor-logic   User is offline

  • HAL9000 was an Apple product
  • member icon

Reputation: 128
  • View blog
  • Posts: 764
  • Joined: 04-February 10

Re: Java to C++?

Posted 27 February 2010 - 02:52 PM

Actually, I'm not in school. I'm learning Java on my own with a combination of an obsolete book, DIC, and the Java online documentation. :D
Was This Post Helpful? 0
  • +
  • -

#12 Munawwar   User is offline

  • D.I.C Regular
  • member icon

Reputation: 163
  • View blog
  • Posts: 457
  • Joined: 20-January 10

Re: Java to C++?

Posted 27 February 2010 - 03:08 PM

+1 for NickDMax (are you a fan of Autodesk 3dsmax?). I never took notes. I simply forget the challenges I faced after completing a project.I even forget the project itself except the good ones.

Quote

Your in school, don't worry too much about what is in the job ads as they will be WAY obsolete by the time you need to worry about it.

Talking about the future,languages and libraries, it reminds me of Ruby.Lovely language.I see a future in Ruby.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1