C++ or Java?

Which is better to learn for a newbie to start with?

  • (2 Pages)
  • +
  • 1
  • 2

20 Replies - 4631 Views - Last Post: 04 August 2007 - 08:38 AM

#1 CerebralAssassin  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 09-July 07

C++ or Java?

Post icon  Posted 11 July 2007 - 03:58 PM

Hi, I don't have much experience in programming outside of CSS and HTML. I tried learning Java, but I'm confused by several topics. I feel like just giving up on it. Is C++ any easier? I've heard people say that C++ is easier to understand and learn than Java. I was just wondering how accurate this statement is. I guess it depends on the person.
Is This A Good Question/Topic? 0
  • +

Replies To: C++ or Java?

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: C++ or Java?

Posted 11 July 2007 - 04:40 PM

It does...one is really no easier than the other. Java requires a level of understanding of Object Oriented Programming that C++ does not (does not require, that is, but it should be known as C++ is an OO language).

Search the forum here for the several discussions on the same topic - you can judge based on what others have said. I'd say learn c++ first of you find java difficult, but a java first programming would likely tell you different! :)
Was This Post Helpful? 0
  • +
  • -

#3 Israel  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 7
  • View blog
  • Posts: 818
  • Joined: 22-November 04

Re: C++ or Java?

Posted 11 July 2007 - 07:17 PM

Yes, this should definitely be moved to general programming. However, I don't have the power or authority to do that.

I wouldn't really say that Java is an easier language to learn. However, it is way more cross-platform. With C++ or C not only is the syntax a little different for every operating system, it also differs from one compiler to the next. Visual C++, Borland, and Dev/GCC all have differences in their syntax. Java is the same no matter what compiler. It also is the same whether your writing for Windoze, Mac, Linux, or a Cell Phone.

Not to bad mouth C/C++. You can write an Operating System with these. This is about the only thing Java can't do. It also has inline-assembly. But I wouldn't say it's any easier.

Practice makes perfect. I remember the day when html was a baffling idea. Keep it up and you'll be laughing at the day you wrote this.

This post has been edited by Israel: 11 July 2007 - 07:18 PM

Was This Post Helpful? 0
  • +
  • -

#4 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1865
  • View blog
  • Posts: 20,278
  • Joined: 17-March 01

Re: C++ or Java?

Posted 12 July 2007 - 07:50 AM

Threads merged, and moved, and deleted.


And Featured. Good topic.
Was This Post Helpful? 0
  • +
  • -

#5 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: C++ or Java?

Posted 12 July 2007 - 08:13 AM

View PostIsrael, on 11 Jul, 2007 - 10:17 PM, said:

I wouldn't really say that Java is an easier language to learn. However, it is way more cross-platform. With C++ or C not only is the syntax a little different for every operating system, it also differs from one compiler to the next. Visual C++, Borland, and Dev/GCC all have differences in their syntax. Java is the same no matter what compiler. It also is the same whether your writing for Windoze, Mac, Linux, or a Cell Phone.

Not to bad mouth C/C++. You can write an Operating System with these. This is about the only thing Java can't do. It also has inline-assembly. But I wouldn't say it's any easier.

C+, when written properly complying to ANSI standards, is completely cross platform. That being said, there are certainly components that are platform specific should you choose to use them - they can be necessary for certain types of applications, and in that manner, java can be more effective.
Was This Post Helpful? 0
  • +
  • -

#6 dogboi  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 94
  • Joined: 10-July 07

Re: C++ or Java?

Posted 12 July 2007 - 09:07 AM

This is what is known as a Holy War (Java Vs. C++, Linux Vs. Windoze, etc.) I usually don't participate in these, but what the hell:

I think easier is a very subjective term. You shouldn't be worrying about which is easier to learn. You should be worrying about what you're ultimately going to use the language for.

If you're going to write client side scripts for the internet, then you want Java.

If you want to write applications, you can use either. It's been my experience that the development time on Java is faster, but the resulting program is slower. In C++, the development time is longer, but the resulting program is faster.

So if you were writing, say a 3d game or a large application, then C++ is the way to go. If you were writing a small app or an applet, Java is the way to go.
Was This Post Helpful? 0
  • +
  • -

#7 Programmist  Icon User is offline

  • CTO
  • member icon

Reputation: 252
  • View blog
  • Posts: 1,833
  • Joined: 02-January 06

Re: C++ or Java?

Posted 12 July 2007 - 10:17 AM

Seriously...search the forum. You'll find at least 5, probably 10+ posts on this exact topic in the past 6 months. Not all the advice given in those topics is objective, so take it with a grain of salt. I'd say that both C++ and Java are probably about the same difficulty to learn. I started with C++. I find that pointers and references in C++ seem to really trip up beginners. In Java, object oriented concepts seem to confuse beginners as well. Every language has a learning curve. If you want to be a programmer you're going to have to push through that and learn to help/motivate yourself. If you switch to another language when one gets difficult, you're going to run out of languages. Either that or you'll end up being a VB programmer...ahem...not that there's anything wrong with that. :)
Was This Post Helpful? 0
  • +
  • -

#8 static-dragon  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 43
  • Joined: 10-July 07

Re: C++ or Java?

Posted 12 July 2007 - 10:21 AM

During my studies in college I went from C++, to Java and knowing C++ allowed me to pick up Java very quickly. Several of my co-workers learned Java at first in their college structure and said they wish they had learned C++ first. I personally am a bigger fan of Java, but then my goal is to work at Sun Microsystems someday :)

This post has been edited by static-dragon: 12 July 2007 - 10:22 AM

Was This Post Helpful? 0
  • +
  • -

#9 xerxes333  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 31
  • View blog
  • Posts: 504
  • Joined: 05-July 07

Re: C++ or Java?

Posted 13 July 2007 - 01:11 PM

First and foremost understand that both HTML and CSS are not a "programming language". I won't go into detail but it would behoove you to research and understand what they are and why they are different. It will only make you a better programmer. They are however one of the best building blocks to learn an actual programming language.

OK enough with the rant, on to the fact of the matter. Here are a couple good questions to ask yourself.

How do you see the world you live in? Do you process information by categorizing and grouping or do you tend to process information sequentially and in a pre-determined order? If you like grouping things together OO (Object Orientated) programming will make more sense to you and Java may be the best choice for you. Although C++ is also OO it functions sequentially as well, Java just makes a little more sense when starting out.

Why do you want to learn to program, is it for a job? If so what language is most commonly used in the filed you’re interested in. Geography plays a big part as well. Where I live there is a big demand for experienced J2EE programmers but you hardly ever see a job posting for a C++ programmer. In San Fran you may be better off knowing C++ cause there a about a Bajillion game development companies out there.

Do you want to program the Next-Gen MMORPG in your spare time? If this is the case I hope you plan on living for a really, really, really, ridiculously long time. :D Seriously thought, I would recommend C++. It will be more efficient and robust with 3D graphics and heavy processing. If you just want to write the next Tetris, use Java. It’s quick, easy and you can have a functioning game in a couple of days.

All in all, I think it depends primarily on what you want write code for that will determine what language you start learning from. If you want my humble opinion well here it is. Go with C++, in my brief existence on this floating rock I’ve learned one great life lesson. The more difficult tasks are often the most rewarding (and you can quote me on that).

Also keep in mind that fundamentally most of the different languages out there are very similar. You’re going to have data structures, control statements, methods, etc. in almost every language. So once you learn the basics it’s easier to pick up new languages, you simply have to learn the nuances.

Hope this helps.

This post has been edited by xerxes333: 13 July 2007 - 01:25 PM

Was This Post Helpful? 0
  • +
  • -

#10 bernard.assaf  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 41
  • Joined: 15-July 07

Re: C++ or Java?

Posted 16 July 2007 - 12:19 AM

Well i saw some tips in all these replies, but there is one important one talking about the Object Oriented Programming in Java which is not present in C++, and this led to the C# language that was like a copy of Java with some minor changes. And till now Java is way ahead the C evolution. As well as the inheritance and the Dynamic Dispatching of Java give it a good plus over the C language.
Was This Post Helpful? 0
  • +
  • -

#11 PennyBoki  Icon User is offline

  • system("revolution");
  • member icon

Reputation: 53
  • View blog
  • Posts: 2,334
  • Joined: 11-December 06

Re: C++ or Java?

Posted 17 July 2007 - 09:58 AM

View Postbernard.assaf, on 16 Jul, 2007 - 12:19 AM, said:

Object Oriented Programming in Java which is not present in C++

Now maybe it's just a matter of wording but OOP is present in C++ very much so. Only because Java is a completely OO language that doesn't imply that OOP is not present in C++.

View Postbernard.assaf, on 16 Jul, 2007 - 12:19 AM, said:

Java give it a good plus over the C language.

Now for me there is a difference between C and C++.

For the complete beginners I would say C++ first then Java. I'm just a student and I think it's the more natural way well at least was for me.
Was This Post Helpful? 0
  • +
  • -

#12 dogboi  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 94
  • Joined: 10-July 07

Re: C++ or Java?

Posted 17 July 2007 - 10:35 AM

View PostPennyBoki, on 17 Jul, 2007 - 12:58 PM, said:

Now maybe it's just a matter of wording but OOP is present in C++ very much so. Only because Java is a completely OO language that doesn't imply that OOP is not present in C++.



Agreed. When I write in C++, I write OOP code almost exclusively. I vary rarely write functions. I write methods. I don't create structures. I create classes (though to be specific - in C++ structs are classes where the default membership is public rather than private). Yes, you can go outside the OOP framework in C++, and you can't do that in Java. But C++ is definitely an OOP language. It just doesn't force you into that framework.

And in some ways, I think, that gives C++ more power. I don't have to use the OOP framework to create simple things, like say, a recursive factorial function or some other trivial code. But I could, if I really wanted to.
Was This Post Helpful? 0
  • +
  • -

#13 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: C++ or Java?

Posted 17 July 2007 - 12:02 PM

Also agreed.

C++ provides as much OOP capability as java, it's simply that java enforces it, while C++ does not.
Was This Post Helpful? 0
  • +
  • -

#14 dodzki2006  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 30
  • Joined: 21-September 06

Re: C++ or Java?

Posted 22 July 2007 - 10:30 PM

I am a new VB programmer and I may be out of the topic here, but I would just like to inquire if I can use either C++ of Java as the front-end programming language with MySQL.
Was This Post Helpful? 0
  • +
  • -

#15 1lacca  Icon User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: C++ or Java?

Posted 23 July 2007 - 12:31 AM

Yes.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2