CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2012
    Posts
    4

    Is C# the right way to go.

    I have been studying C# for a little more than half a year now, together with a review on calculus and some probability. I'm 40 years old, so that I do it on my spare time. My main interest is AI and game development, not of the kind with intensive graphics use, but of the less cpu intensive kind, like those based on historical warfare boardgames.

    Being so, I thought that an interpreted language like C# or Java would be much more practical than C/C++. I opted for C# with the intention of learning Lisp or Prolog later. But now I'm in doubt if I chose the right way. I'm loving C#, but I have a project that will take me more or less 5 years and which I would like to be commercializable when ready.

    The problem is that, with the advent of tablets, the future of Windows as the most popular OS seems challenged and .NET framework, as far as I know, hasn't been developed for other operational systems. I know about Mono, but I read it isn't able to run all .NET applications. Investing on a project that will only run on Windows and be ready in 5 or 6 years seems risky, at the moment.

    I know that C# vs Java vs C++ etc is not an uncommon thread topic on the net and enough has been discussed, but based on my described needs, would Java be a safer bet or should I keep going with C#.

    I know some will answer that I should learn both and, perhaps, I will. But I need to choose one to my project's kick off.

  2. #2
    Join Date
    May 2009
    Posts
    2,413

    Re: Is C# the right way to go.

    Quote Originally Posted by Portella View Post
    Being so, I thought that an interpreted language like C# or Java would be much more practical than C/C++.
    Prediction is very difficult, especially about the future.

    But I would say that if you start developing a program today and want to be almost certain it will run on a yet unknown platform X in 5 years you should write it in C++. It's a flexible and powerful language and very resilient to technology change. In fact the core parts of Java and C# are actually written in C++.

    On one hand I don't think you necessarily have to make a definite choise now. The most likely scenario is that you will be spending most of the 5 years working on a prototype that will be almost completely rewritten several times. This may include experimenting with different languages or language combinations, but mostly it will be about getting the design right to fit the application logic. Then near the end of the 5 years when you know what you're doing you swiftly code up a candidate for release on a relevant platform of the time.

    On the other hand it takes about 5 years to become really good at a language so I would switch to C++ now. You can do in C++ what you can do in Java or C# and even more and better. You just need to be a little more careful because it's a complex language that hasn't been dumbed down to keep people from shooting themselves in the foot.

    My secondary choise would be Java. It's because it has broader platform support than C# which is very Windows centric and likely to stay so. Also the Java runtime environment (the JVM) has become a very popular platform for lots of other languages which increases the staying power of Java. Finally the Oracle commitment to Java seems for real and they claim there have never been more developers assigned to improving Java than now.

    If you're relatively new to computing, Java probably is better than C++ for you. Java is similar to C# so your knowledge will carry over.

    That's my two cents. Good luck.

    http://www.tiobe.com/index.php/conte...pci/index.html
    http://www.lextrait.com/Vincent/implementations.html
    Last edited by nuzzle; June 1st, 2012 at 03:02 AM.

  3. #3
    Join Date
    May 2012
    Posts
    4

    Re: Is C# the right way to go.

    Thanks nuzzle.

    On the other hand it takes about 5 years to become really good at a language so I would switch to C++ now. You can do in C++ what you can do in Java or C# and even more and better. You just need to be a little more careful because it's a complex language that hasn't been dumbed down to keep people from shooting themselves in the foot.

    The reason I didn't choose C++ is that I don't thing I'll need to deal with low level stuff. My planned product can only suffer performance issues on things related to AI and then, I believe that the right choice of algorithms and techniques will be more important than low-level management (I may be wrong, due to my lack of experience). Yet, I want a language that can make things faster in terms of design. As far as I know, C++ will add code complexity and debug time will be greater, while with C#/Java, I'll get a finished product faster.

    On one hand I don't think you necessarily have to make a definite choise now. The most likely scenario is that you will be spending most of the 5 years working on a prototype that will be almost completely rewritten several times. This may include experimenting with different languages or language combinations, but mostly it will be about getting the design right to fit the application logic. Then near the end of the 5 years when you know what you're doing you swiftly code up a candidate for release on a relevant platform of the time.


    That's the most important point, which I want to be able to really assimilate. Yet, it is difficult, at the beginning, to be confident with a statement that supposes some pass perspective of those who already went through the experience of messing with multiple languages.

    My secondary choise would be Java. It's because it has broader platform support than C# which is very Windows centric and likely to stay so. Also the Java runtime environment (the JVM) has become a very popular platform for lots of other languages which increases the staying power of Java. Finally the Oracle commitment to Java seems for real and they claim there have never been more developers assigned to improving Java than now.


    What makes me hesitate isn't only the fact that I already know something about C#, but also what I've recently read about the possibility of a future portability capacity of C#. Not only the fact that it is ISO standardized, but also some news, like the recent translation of Android Java code to C#. What, in your opinion, are the real perspective of C# becomming a multi-platform language?

    Additionaly, in some countries, C# seems to be growing as the language of choice of professionals of the area.

    The real problem is that almost all comparisons seem biased, and we can't really have a glance at the real picture.

    I'll try to follow your advice and not be too preoccupied about the language, but to get the grasp of the logic underlying software development. It seems sensible. That's one of the reasons I'm going back to maths and logic, so as to build on the foundations. The kind of thing we only notice the value later.

  4. #4
    Join Date
    May 2009
    Posts
    2,413

    Re: Is C# the right way to go.

    Quote Originally Posted by Portella View Post
    The reason I didn't choose C++ is that I don't thing I'll need to deal with low level stuff.
    C++ is a general purpose language and not at all limited to low-level computing. It's as high level as Java and C#. All these languages have all it takes to develop the application you briefy described according to modern design principles.

    If the selection criterion is the highest probability of your application to be runnable on a system of your choise in 5 years from now then you should use C++. In my view C++ is the language that most likely will be available on most systems in the middle term future.

    One can always speculate about where Java or C# will be available in the future but one thing is for sure, it will be on systems that also support C++. It's because Java and C# depend on C++ for their efficient implementation.

    C++ is complex for sure and that's why Java was conceived and as a reaction to Java there was C#. But to whom are Java and C# safer than C++? That's right it's to upper management. Well educated programmers are scarce and expensive. It's much cheaper to employ hordes of knows-nadas and let them use Java and C#. This strategy doesn't work but it's another story. Anyway, if you consider yourself a man of Ahnung and ability you have nothing to fear from C++.

    What Java and C# do have that make them special over C++ is a built-in garbage collector and a huge standard library including a GUI. That's something you have to deal with if you select C++. I admit it's a heavy decision factor and that's why I suggested Java as the runner up choise. Here I picked Java over C# because the owner of Java has an interest in making it ubiquitous while the owner of C# has an interest in confining it to Windows. Java has strongly supported Windows and Linux from the beginning and now also Mac OS. If you pick C# you marry Microsoft for good and for worse.

    Finally a strategic advice. Why not let someone else in on your project? Many gifted programmers are somewhat lacking in imagination. It's because the nature of programming is to slavisly follow the rules laid down by others and if you're good at that you're not automatically good at coming up with own ideas of what to program. So if you can offer a purpose and a direction I'm sure you could attract an experienced programmer to help you with the details. Also a dialog with someone could benefit the project and sooner or later you'll need to let people in anyway because you can't do everything yourself.
    Last edited by nuzzle; June 5th, 2012 at 07:12 PM.

  5. #5
    Join Date
    May 2012
    Posts
    4

    Re: Is C# the right way to go.

    My main concern isn't difficulty of learning the language, but productivity. I have read that creating UI in C++ is cumbersome if compared to C#.

    I found that on a forum:

    Your solution, in case you haven't figured it out yet, is called "Mixed Mode", which basically means that you combine Managed (C#) and Unmanaged (C/C++) code in the same projects, it is often a bit of a hassle to get the VS project up-and-running (LNK2020 errors..argh..) but when you find the right settings it should work just fine.

    Only negative thing is that mixed mode assemblies must run in Full Trust, if that's OK then I guess you know what to do.


    How difficult is it to combine both languages in the same project. Would that be a good solution? What about combining C++ and Java, to get things like UI faster? What kind of difficulties one would face?

  6. #6
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: Is C# the right way to go.

    Do you intend to work on this with a team? Finding team members with the same skill set could then be a factor.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

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

Featured