C++ Learning Community Forum
August 01, 2010, 03:26:13 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Hello. Smiley
 
   Home   Help Search Login Register  
Pages: 1 2 [3]
  Print  
Author Topic: Java or C++  (Read 5081 times)
oldneuro
N00b!!1
*
Posts: 17


View Profile
« Reply #30 on: December 27, 2008, 01:50:53 AM »

I would agree with most of the others -- learn C++ first, then Java.  The reason is that C++ has a better shot of teaching you the actual inner workings of the computer.  Java is so abstracted, that often you really have no idea how memory is being handled, or even what is being stored in that memory.  Java is a great language, don't get me wrong, but it's strengths are in portability, the shorter development time cycle, and not having to worry about most of the inner workings of things.  However, I think you would be 'spoiled' by Java, if you then went on to learn C++.  C++'s object oriented nature is similar enough to Java that the transition from the former to the latter should not be difficult, and with C++, you get significantly greater control over the minute details of your code.  Also, it *is* possible to write very cross-platform code in C++, but it often requires writing seperate libraries for each platform.
Finally, although there is a lot of example code out there for Java, frankly, there is even more for C++.  C++ has been a standard since the mid-90s, and many (I would not say a majority, but at least a strong plurality) of major software suites are written in C++.  There is a massive wealth of tutorials already out there to do anything from writing a time sharing kernel to a flight simulator.  Almost every major library has a C++ interface.
Also, C++ has a lot less overhead for running programs.  Since it is not garbage collected, nor interpreted from an intermediate byte-code run on a virtual machine, you can expect significantly lower memory requirements, and slightly lower CPU requirements to run C++ applications.

In the end, the decisive factor must be what you are trying to do.  If you are just learning for learning's sake, then I'd say go with C++.  If you specifically want to create web based applets, or write a nibbles clone for a cell phone, then go with Java.  Use whatever the situation calls for.  Maybe an entirely different language is called for, like BASH (good for writing quick unix scripts), FORTRAN (good for writing statistical analysis apps) or LISP (good for writing higher order and AI apps).
Logged
FrozenKnight
ASM Freak
Global Moderator
Dr. of C++ology
*****
Posts: 546


Do it yourself it's the only way to learn.


View Profile
« Reply #31 on: January 04, 2009, 10:49:09 PM »

Good post oldneuro, but do realize that this thread is about 6 months old LOL. But maybe this is a good thing, the off topic section had been idle for months and this was once the most active part of CPPLC.
Every language has it's advantage. (except maybe brainf***) it's usefull to learn them all but there is usually an hierarchy usually it's better to learn the base languages first as they will give you insight into how the new language works. in my case i still perfer using Cstrings to the string class because of the way i learned how to handle strings. but many who started with a higher level language such as basic find that using the string class is easier. Of course this may just be me, even my high school psychological report says i have a habit of over complicating things.
Logged


Imagine the impossible, then make it happen.
mleveill
1337 L0LCoder
C++ Freak
***
Posts: 430


IM IN UR PROGRAMZ WRITIN UR CODEZ!


View Profile
« Reply #32 on: January 20, 2009, 08:30:40 PM »

yes, well... i'm going to oppose everyone else and defend java. Tongue
i recommend learning java before c++
i personally believe most of the reasons you guys have pointed out actually work in favor of java

Quote
The reason is that C++ has a better shot of teaching you the actual inner workings of the computer
yes, let's try and confuse him by teaching him stuff he doesn't need to know right away

Quote
Java is so abstracted, that often you really have no idea how memory is being handled
and let's make him worry about memory allocation too. java is designed so you literally don't know (and don't need to know) how the memory is being handled. if you're creating a resource intensive program, you probably shouldn't be using java in the first place.

Quote
time sharing kernel to a flight simulator
why would a beginner ever need to reference these examples. just because c++ supposedly has more examples doesn't make it better, java DEFINITELY has enough example programs

Quote
Also, C++ has a lot less overhead for running programs
ya, with the crazy-intensive CPU programs beginners always write, they need to write native code (sarcasm)

Quote
If you are just learning for learning's sake, then I'd say go with C++
WHAT??? why would you learn a harder language that requires more practice and experience "just for learning's sake"
if you want to learn how to program as a hobby, learn java
if you want to learn and possibly get a programming job, i would learn java, then c++ and a few other languages such as C, python or perl, and if you're really into it, learn assembly and lisp, etc. it all depends

Quote
In C++ you have 1000 ways to do something, in Java they chose just one
not true at all. please tell me something you can only do one way.


other reasons include java's standard gui library (good for beginners who want stuff displayed onscreen)
i'll admit SUN "overengineered" AWT/SWING, but it gets extremely simple after you get to know it

java is also very forgiving (mostly due to exceptions). a beginner learning c++ could be overflowing buffers and never know it.

you also don't have to worry about pointers (which beginners usually struggle with), the difference between pointers, references, when copy constructors are called, shallow copies, the list goes on. they will eventually learn all that stuff, but when starting out with java, you don't need to learn it all at once.

i think it would be simpler to go from java to c++ (and learn how to delete allocated memory) than it is to go from nothing to c++
« Last Edit: January 20, 2009, 08:32:49 PM by mleveill » Logged

Quote from: kohlrak
Common interests aren't always the best thing. Especially programming wise.
I could just picture a couple fighting over weather to "xor eax by eax" or "and eax by 0"...
Then kids'll come home and argue with their parents that readabilty is better than size and that "mov eax, 0" would be best because that's "more readable." (Even if it really isn't...)

LOLCode - http://lolcode.com/home
ih8censorship
Megalomaniac!!!
Administrator
C++ guru
*****
Posts: 1236



View Profile
« Reply #33 on: January 21, 2009, 06:47:22 AM »

Quote
and let's make him worry about memory allocation too. java is designed so you literally don't know (and don't need to know) how the memory is being handled. if you're creating a resource intensive program, you probably shouldn't be using java in the first place.
Ok, so what is likely to happen when JavaGirl moves to C++, and deal with dynamic memory allocation there? I could see memory leaks being a major problem in her code, which would very likely go undetected. Had she started in C++, she would have learned about cleaning up after herself. Then when she moved to Java and tried to use delete, she gets a syntax error (right?) in which case she googles it, consults a book or a person and finds out she doesn't need it. I think when it comes to memory management it is most definitely better to know the c++ way.

Quote
yes, let's try and confuse him by teaching him stuff he doesn't need to know right away
Quote
WHAT??? why would you learn a harder language that requires more practice and experience "just for learning's sake"
if you want to learn how to program as a hobby, learn java
if you want to learn and possibly get a programming job, i would learn java, then c++ and a few other languages such as C, python or perl, and if you're really into it, learn assembly and lisp, etc. it all depends
Ok then, why not use GameMaker? I got out of GameMaker because it was too easy, and i wanted to learn how programs were actually made (and was going shareware at the time as well). C++ was a level up from assembly, and Java was a level up from C++. I chose C++ because i could write dlls for GameMaker, and because it would allow me to do things at as low of a level as I wanted. Some people like a learning experience that is challenging and takes time. If you want programming to be a hobby, find something that interests you, and research what language(s)/toolkits would be best to use.

Quote
ya, with the crazy-intensive CPU programs beginners always write, they need to write native code (sarcasm)
run compiled C++ = OS + libraries
run Java             = OS + libraries + jvm + packaging it as a "normal" executable so a normal non programmer can run your program without thinking too much

Here, It's just an extra hoop a person new to programming would have to jump through, and not a hoop I see any advantages in when it comes to other languages either, like with the memory management i was talking about earlier.

Quote
not true at all. please tell me something you can only do one way.
I'm no Java expert, but maybe a few paradigms would be at best difficult to use?

Quote
java is also very forgiving (mostly due to exceptions). a beginner learning c++ could be overflowing buffers and never know it.
See I think of this a bit differently. I hear about security vulnerabilities for windows and other stuff written by people who should know better that comes from a buffer overflow. I personally think this is because people come to C or C++ from languages that "dumb down" this area to a point where they aren't used to being concerned about it. While the learning curve may be steeper in this area, I think it's information that every programmer should at least know about.

Note that again, this all assumes that for the task at hand C++ and Java are equal candidates for getting the job done which in most cases they probably aren't for one reason or another. Java is a cool language/setup with the vm and all. It's just not for everything. Neither is C++. The choice of a first language is just the first in the many choices a person makes in programming, and it should be an educated one, not one driven by passion or laziness but what will get the job done in the best way possible, whatever that means, it's relative to the project.
Logged

PC==perfect_companion

Knowledge cannot come packaged and predigested; it must be chewed over carefully before swallowed.

What have you tried?
oulyt
C++ Freak
***
Posts: 340



View Profile
« Reply #34 on: January 21, 2009, 08:32:15 PM »

i started with C++ o.0

i mean i knew html/css/xml before i learned C++ but i dont think those count
Logged
mleveill
1337 L0LCoder
C++ Freak
***
Posts: 430


IM IN UR PROGRAMZ WRITIN UR CODEZ!


View Profile
« Reply #35 on: January 22, 2009, 03:19:32 AM »

Quote
Ok, so what is likely to happen when JavaGirl moves to C++, and deal with dynamic memory allocation there?
i'm sure they will be told to delete memory from a tutorial/example/class/forum.
everyone is making it out to be a bigger deal than it is.

Quote
Ok then, why not use GameMaker?
i don't see a problem with that. give them something you know they can handle and then they'll decide if they want more. (instead of overwhelming them right away and possibly giving up). it depends on the type of person.

Quote
run compiled C++ = OS + libraries
run Java             = OS + libraries + jvm + packaging it as a "normal" executable so a normal non programmer can run your program without thinking too much

Here, It's just an extra hoop a person new to programming would have to jump through, and not a hoop I see any advantages in when it comes to other languages either, like with the memory management i was talking about earlier.
i'm not sure what "hoop" you're talking about. chances are "normal" people aren't going to be running some new kid's programs.
in the offchance this happens, they can make a batch file containing two words "java MyProgram" or run a one line command to package it into a jar file.

Quote
See I think of this a bit differently. I hear about security vulnerabilities for windows and other stuff written by people who should know better that comes from a buffer overflow. I personally think this is because people come to C or C++ from languages that "dumb down" this area to a point where they aren't used to being concerned about it. While the learning curve may be steeper in this area, I think it's information that every programmer should at least know about.
they'll learn about buffer overflows when it happens in their java programs (when their program exits with an exception) since the behavior is prevented completely in java.

Quote
I'm no Java expert, but maybe a few paradigms would be at best difficult to use?
are you referring to the fact that java is "only" object-oriented?

Quote
Note that again, this all assumes that for the task at hand C++ and Java are equal candidates for getting the job done which in most cases they probably aren't for one reason or another. Java is a cool language/setup with the vm and all. It's just not for everything. Neither is C++. The choice of a first language is just the first in the many choices a person makes in programming, and it should be an educated one, not one driven by passion or laziness but what will get the job done in the best way possible, whatever that means, it's relative to the project.
i agree, there isn't a programming language best-suitable for all tasks, but the task at hand is learning to program for the first time (and the best-suitable language is obviously debatable).
Logged

Quote from: kohlrak
Common interests aren't always the best thing. Especially programming wise.
I could just picture a couple fighting over weather to "xor eax by eax" or "and eax by 0"...
Then kids'll come home and argue with their parents that readabilty is better than size and that "mov eax, 0" would be best because that's "more readable." (Even if it really isn't...)

LOLCode - http://lolcode.com/home
ih8censorship
Megalomaniac!!!
Administrator
C++ guru
*****
Posts: 1236



View Profile
« Reply #36 on: January 22, 2009, 04:38:00 AM »

Quote
chances are "normal" people aren't going to be running some new kid's programs.
I remember sending a couple prank programs i had made to "normal" friends haha.
Logged

PC==perfect_companion

Knowledge cannot come packaged and predigested; it must be chewed over carefully before swallowed.

What have you tried?
Pages: 1 2 [3]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!