C# and C++

Started by
21 comments, last by jbadams 11 years, 7 months ago
So bottom line, does it take more time or not?? (please only answer this question if you are skilled in both c++ AND c#)


PS: If the difference is. for example, if a project takes 1 year in one in the other it takes 1 year and 10 days then the difference doesn't matter to me as 10 days is not a lot of time
Advertisement

[quote name='MichaBen' timestamp='1347997057' post='4981370']
As long as the developers are experienced with the chosen language, it will not make a lot of difference in development time.
I call bullshit.[/quote]I think it's less bullshitty, if you factor in both the experience of the language user and importantly the nature of the problem that you're trying to solve.

There will be some small set of problems where it will be quicker for an experienced author to solve it in C++ rather than C#.
e.g. "refactor this collision detection system so that it generates no more than 5 cache misses per frame".

I'd say (IMHO) this kind of task is more suited to C++, but if the code was in C#, and I was a C# expert, then I'd be able to use explicit struct layouts, etc, to achieve the same results in a similar time.

As usual, generalizations only give us a general idea of the truth.
So bottom line, does it take more time or not??
It depends on the problems being solved. I use both languages professionally -- about half my code is C# and the other half is C++.
For the half of the code-base where C# is my chosen language, I do find it to be much less taxing on my brain energy...

So bottom line, does it take more time or not??

Unfortunately, the "bottom line" answer has to be it depends.

It depends on the knowledge and experience of the programmer in question. It isn't always enough to figure out the syntax of a language and be able to write a syntactically correct and error free program; if you haven't also adjusted to the style and idioms of that language you might still be using it in a sub-optimal way. A programmer who knows a language brilliantly might still be less efficient at solving a particular problem if they happen to be unaware of the library or a specific language feature that can help to solve that problem.

It also depends on the problem at hand. Certain problems are better expressed in different languages, and otherwise equivalent solutions in two different languages may have vastly different performance. In some cases certain problems become trivial in certain languages thanks to specific language features or existing solutions provided by libraries.


As usual, generalizations only give us a general idea of the truth

I'd have to agree with this. There isn't a universally applicable answer to your question, but my own personal attempt at a general answer might be:
[bquote]"for most people, programming in C# is generally more productive than programming in C++ unless the problem at hand is poorly suited to the language, assuming they have taken the time to properly learn the language and libraries available."[/bquote]


I'd still strongly advise taking a little time to try both languages yourself, and then make your own informed decision based on your own initial impressions and experiences. Where there might be a huge productivity advantage for one programmer, there might be only a small one -- or even a disadvantage instead -- for you. C# can be significantly more productive than C++, but it might not be for you. You'll have to spend a little more time doing your evaluation, but if you really value your time in the long run it should get you the best result[sup]1[/sup], as you'll be able to make a decision that matches your needs rather than relying on a general case or the experiences of others.


You know what the least productive thing you can do is?

Spending forever trying to choose between two languages rather than actually getting started. Ultimately, both are very capable languages that should be able to meet most -- if not all -- needs you are likely to have. It's possible that you might be more productive with one of them rather than the other, but it's a certainty that you'll be more productive using either of them rather than spending day-after-day trying to choose between them.

Either start going about the process of trying both so that you can make an informed opinion, or just pick either one -- flip a coin if you're still not sure but don't want to spend time trying both -- and get started learning! You could spend months researching and asking questions without getting better answers than you've already received, or in the same time you could possibly finish your first game!


[size=1][sup]1[/sup]Assuming you mean that you have limited time per-day rather than a strict deadline such as a 6 month period in which you must complete a project. If you're dealing with a strict deadline pick either language and get to work!

Hope that helps! smile.png

- Jason Astle-Adams

This topic is closed to new replies.

Advertisement