Results 1 to 8 of 8

Thread: Jave + C#

  1. #1
    Durden is offline Member
    Join Date
    May 2011
    Posts
    7
    Rep Power
    0

    Default Jave + C#

    I see a lot of people recommend C++ along with Java in terms of learning. I was curious what peoples thoughts regarding C# were. It seems to be in high demand for a lot of things but I like the portability of Java.

    My background is primarily with scripting languages (Perl, Python, Shell scripting on UNIX). I'm trying to learn more about OO languages just for fun and am currently teaching myself Java. I'd like to be thorough and learn the concepts of multiple languages.

    Is C# a good place to look or should I go the C++ route? Any advice etc would be very welcome.

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Why not learn both? You may find things about c++ you prefer and the same with c#. I have almost no c# experience but I am learning c++ and java atm. Either language will help you understand oo, i believe c# is similar to java in that it is a purely oop language.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    If you're doing this just to learn, you can choose what you like. The concepts learned by studying C# are directly extensible to Java and visa versa. C++ is a different animal entirely, and would be worth learning, but not at the same time as the other two languages. In other words, I'd choose one language and learn it first.

  4. #4
    Skiller is offline Member
    Join Date
    Jan 2011
    Posts
    67
    Rep Power
    0

    Default

    IMO if you are interested in learning C++ and Java/C# I strongly recommend learning C++ first, you'll understand a lot more about programming principles and how computers actually work with C++ than the other 2. It'll also be MUCH MUCH MUCH easier going to another language from C++ than the other way around as languages like Java/C# will teach you EXTREMELY bad habits for C++ that will render any C++ app a failure and unusable where as the bad stuff for Java/C# learned going the other way are usually quite minor. You'll get frustrated that a lot of the useful things you can do in C++ can't be done in Java though (not sure about C#) but going the other way you'll probably also get frustrated as Java comes with a lot of libraries with commonly used classes/functions that you'd need to write yourself in C++.

    TBH while personally I'd always prefer C++ over Java/C# you need to consider if it's worth you learning C++. If you intend to write complex games, real time simulations, applications that directly interact with special hardware, applications for devices with limited hardware specifications or applications that need complex time critical calculations, then C++ is almost always the best language and worth learning. If however you wish to write business applications, simple games, hobby apps, ect. then Java/C# are probably all you'll need and will make development of the apps a lot faster/easier.
    Currently developing Cave Dwellers, a Dwarf Fortress/Minecraft style game for Android.

  5. #5
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    I'd like to ask what things you think java teaches that will cause errors in c++?

    I agree that java babies you a bit. I feel a lot of the things aren't normally allowed in java it's just that java makes there error much more visible than c++.

  6. #6
    Skiller is offline Member
    Join Date
    Jan 2011
    Posts
    67
    Rep Power
    0

    Default

    Quote Originally Posted by sunde887 View Post
    I'd like to ask what things you think java teaches that will cause errors in c++?
    The main thing is that you won't be in the habit of managing memory, making sure you have the appropriate constructors and destructors, freeing everything you allocate, knowing where to free or allocate, buffer overruns, order of construction/destruction, ect. They won't cause errors but the apps will leak till they crash and given how often you need to allocate in Java that would probably happen rather quickly with the same frequency in C++ especially when factoring in memory fragmentation (another thing a Java programmer is less likely to know about).

    These are things that you need to get in the habit of doing or need to be constantly aware of in C++, otherwise development will be very slow and there will be many bugs. IMO it'd be a lot harder to form these habits and keep C++ specific things in mind if you start in Java/C# where it's not necessary. But going from C++ to Java/C# it's pretty easy to just not do those things, you will get tripped up here and there with some Java things too (like 2 objects referencing each other preventing garbage collection) but you'll easily understand why with a C++ background and a maybe quick explanation.

    Quote Originally Posted by sunde887 View Post
    I agree that java babies you a bit. I feel a lot of the things aren't normally allowed in java it's just that java makes there error much more visible than c++.
    Yeah, one of the problems a lot of people have with C++ is that it lets you do a lot of stuff that under most circumstances you really shouldn't and can cause serious problems, but that's also one of it's biggest advantages as you can really save a lot of memory and CPU time when you know what you are doing and use those techniques right. However a lot of it just isn't possible in Java (AFAIK) like unions, reinterpreting casts, unsigned data types, passing objects by value and stack variables, which means they are less likely to be learned and understood or used properly by someone coming to C++ from Java.
    Currently developing Cave Dwellers, a Dwarf Fortress/Minecraft style game for Android.

  7. #7
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Good explanation, thanks for that, I'm only just getting into memory management in c++ so that didn't come to mind.

  8. #8
    Durden is offline Member
    Join Date
    May 2011
    Posts
    7
    Rep Power
    0

Similar Threads

  1. jave script where is source code
    By maryjane in forum New To Java
    Replies: 1
    Last Post: 01-15-2011, 02:48 AM
  2. Need Help For Jave Slideshow
    By defanci in forum New To Java
    Replies: 0
    Last Post: 01-06-2011, 07:15 AM
  3. Jave Developers (job Opportunity)
    By tetfernandez in forum Jobs Offered
    Replies: 1
    Last Post: 01-15-2009, 12:25 PM
  4. Replies: 13
    Last Post: 07-31-2008, 05:35 AM
  5. Database connectivity in Jave struts with Hibernate
    By sanjay_sharma77 in forum Advanced Java
    Replies: 1
    Last Post: 02-02-2008, 08:41 PM

Posting Permissions

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