Results 1 to 18 of 18

Thread: what to study: Java or C++

  1. #1

    Thread Starter
    Addicted Member herpysz's Avatar
    Join Date
    Mar 2002
    Location
    Europe>Moldova>Kishinev
    Posts
    176

    what to study: Java or C++

    Hi! I have such a situation: I know Visual Basic. But I want to begin to study a new laguage...but I don't know what to choose: Java 2 or C++ ???

    So please tell me what to choose and why???
    Next regards from Herpysz!

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Go with Java or C#. Don't worry about C++.

    Heres some diffrences between C and Java just so you can take a look.

    No preprocessor directives: Java treats constant definitions as
    static final fields.

    No global variables: Java defines an extreamly clean namespace.
    Packages contain classes, classes contain methods and fields methods
    contain variables. Thus there is no possibility for namespace
    collisions.

    Well-defined primative type sizes:
    All the primative types in Java have well defined sizes. In C, the size
    of int, short ,long types is platform dependent, which hampers portability.

    Foward References: The Java compiler is smarter then the C compiler in
    it allows methods to be invoked before being defined. This elimates the need
    to define function in a header file before defining them in a program file, as
    is done in C.

    No method pointers: C allows the programmer to store the address of a function in a
    variable and pass that function pointer to other functions. You cannot do this with
    java methods but you can acheive similiar results by passing an object that implements
    a particular interface.

    Variable declarations anywhere: C only permitts local variable declarations to be at
    the beginning of a method or block. Java allows the variable declarations anywhere
    within a method or block. --NOTE-- most programmers perfer to keep variable
    declarations at the top of a block or method however.

    Garabage Collection: The Java Virtual Machine performs "Garabage Collection" or
    deallocation of memory automatically. This elimates the need for Java programmers to
    explictly manage memory used by all object and arrays. For instance an object is
    eligible for garabage collection if there are nolonger any variables that hold a
    refrence to that object.

    Method overloading: Java programs can define multiple methods with the same name
    as long as the methods have diffrent parameter lists.

  3. #3
    Addicted Member
    Join Date
    Apr 2001
    Location
    Ottawa, Canada
    Posts
    181
    i agree with Dilenger4

    java also helps you understand the purpose of OOP. you have well defined objects that can interact with eachother. also the GUI components(called awt and javax.swing) are really good and easy to implement. it also helps you understand the model-view-controller setup and how it makes stuff easier.

    it also has an awesome api so anything you need to look up for any class, you can do it very easily.

    java is a good progression after VB, stronger data typing and a bit more challenging.

    --770

  4. #4

    Thread Starter
    Addicted Member herpysz's Avatar
    Join Date
    Mar 2002
    Location
    Europe>Moldova>Kishinev
    Posts
    176

    thanks

    thanks guys...i'll begin to study Java..then may be c++.
    BUt I have to download first java2se ???
    Next regards from Herpysz!

  5. #5
    Addicted Member
    Join Date
    Apr 2001
    Location
    Ottawa, Canada
    Posts
    181
    i'm sure you know this but you have to download the SDK not the JRE

    --770

  6. #6
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Cool

    i may be a little late here. but my advice would be to study both to appreciate the other. without knowing java, you won't be able to appreciate what C++ can do for you. without C++, you won't appreciate how easy java is.

    I am a Visual Basic Programmer, who has made a transition to java. I also learned a little bit of C_Sharp on the way.

    Cheers!
    Abhijit

  7. #7
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Since you're a VB programmer I recommend you learn Java, it is closer to what you were doing previously. But keep yourself open to C++, once you know Java you can learn C++ too.

    Dilenger4's post is crap. First, comparing C to Java doesn't make sense. If anything, you should compare C++ to Java. Second, the comparison by syntax changes is pointless. Sure, what is in this post is all true, but the main difference is what the language was written for. Java is for easily distributable cross-platform applications that don't need to worry about speed. C++ is for the biggies, large applications that need the full speed only real compiled languages offer, for small command line tools that don't need any runtimes (esp. in Linux) and finally to create the high-performance backends for higher-level languages like Java, VB, .Net languages etc.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  8. #8
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    CornedBee the speed of C++ is widely known. Since previous versions of Visual Basic(1-3) were written in assembly and version 4 was written in C++ i think that is a testement to bolth languages. As for the change in syntax i don't see how that would be irrelevant. If i was begining to learn a new language i would certainly want to know what the syntactical differences were from language to language.

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Yes, if you are learning the language. But when you are only deciding which language to learn then what matters far far more is what the languages are made for.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  10. #10
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    I will agree with you on that. But if one is made aware of some of the complexities of C++ before comparing C++ to other languages they might opt to choose another language to program in.

  11. #11
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Which would be a pity IMO. That would be scaring them off from C++ because C++ DOES look dangerous and complicated from afar. Once you get to see it closer it all makes sense, until you get very close. When you do that it gets harder again because you have to fight against limitations of the language and individual compilers. C++ allows you so much that you usually end up wanting even more.

    Oh how I would love variable length template parameter lists...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  12. #12
    Fanatic Member doofusboy's Avatar
    Join Date
    Apr 2003
    Posts
    526
    I switched careers to programming several years ago and the first language I learned was C++. After 6 courses in that language (finishing with Visual C++), everything else was a comparative BREEZE !!!

    Was subsequently able to then learn [and appreciate] VB, Java, Perl, etc.
    Do canibals not eat clowns because they taste funny?

  13. #13
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I can't imagine anyone who has a good grip on C++ appreciating VB. Java or C# yeah. Perl too, if you're like that. But not VB...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  14. #14
    Hyperactive Member marnitzg's Avatar
    Join Date
    Oct 2000
    Location
    South Africa
    Posts
    372
    CB - The only "thumbs up" I have for vb at this stage is the rate at which applications can be churned out. It was devoloped as a RAD tool and thats exactly what it is. Even with Visual C++ it takes me a lot longer to develop applications. However, they are more stable and run faster, but if a client comes to you and says I want this prog in 3 days, you don't exactly have the time to sit with c++. However, with .net I find it more useful to program in C#. Although I still think the language needs a lot of improvement, I'm pretty sure I'll be coding more in c# than vb in the future.

  15. #15
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Yeah, C# solved the worry that I had: that I might one day have to use VB because my boss wants something developed quickly.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  16. #16
    Addicted Member Virtual24's Avatar
    Join Date
    May 2001
    Posts
    228
    I learned VB first, when i was young... Then i took on c++ without knowing how difficult it was. I was ok at it but could never finish everything because it is so hard to do everything. Arrays are near impossible; you have to worry about weather or not to send by pointer or not... so on and so forth. Not to mention trying to bring up the simplest window in c++ takes hours of typing :-D.


    After all that i switched to java... WOW what a difference. Java is great and i consider it to be the best language of what i know. The only problem with java is its slow speed and inability to make exe's. If you could get Java as a platform specific language then It would be so much better than it already is... Wich is hard to beat!
    To protect time is to protect everything...

  17. #17
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    Re: what to study: Java or C++

    Originally posted by herpysz
    Hi! I have such a situation: I know Visual Basic. But I want to begin to study a new laguage...but I don't know what to choose: Java 2 or C++ ???

    So please tell me what to choose and why???
    You're asking this in a Java forum. What kind of answers do you expect?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  18. #18
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    He has to ask somewhere

    The C++ forum wouldn't be objective either.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width