English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Which is better and Why?

2007-01-07 13:58:36 · 7 answers · asked by Best Helper 4 in Computers & Internet Programming & Design

Sieo-Kow what r u talking about

2007-01-07 14:09:08 · update #1

7 answers

Both will create exe file,

But they differ from the storage as well as poniters.

C# has default value when the array size is created but the C++ has taken the value from carbage collection.
and C# is used for webdesign but not C++.

And so on

2007-01-07 14:08:11 · answer #1 · answered by Anonymous · 0 0

Some of my thoughts...

Sure, with C#, I do spend less time considering memory usage (i.e. preventing memory leaks), but the issue of closure doesn't go away. I still need to deterministically release resources and to do this I'm going to need to call Dispose(). The point I'm getting at here is that, as a programmer, I still need to spend time thinking about the same problem - resource management. Using C++, it's natural to deal with memory at the same time - memory is just another resource.

Sometimes I feel that the time I save thinking about memory usage is now spent figuring out what to do with exceptions. Exceptions aren't new to C#, there just seems to be more of them. I'm convinced that I write more lines of error handling code these days, but that's probably a good thing :O)

C# is a simplified language, compared to C++. That's a good thing for developers who are used to Visual Basic or Java, but in this simplification it does miss a lot of features that are available in C++ - which is why I don't wish for a 'winner' and applaud the enhancements being made to the C++ language and tools.

While some may never miss the C++ compilation model, I really do miss being able to view the 'interface' of a class. I can look at a C++ header file for a birds-eye view of the class, though this does rely on good code guidelines and can get unstuck with patterns that hide implementation. Being forced to write inline code just doesn't work for me. At a class level, C# just isn't as readable without the use of a tool.

Templates - they're tough to learn and can promote some very obtuse code, but they sure are powerful. Generics are a good start in C#, but don't come anywhere close to providing what C++ has to offer. I think STL and Boost get a bad rap because they're difficult to use and there are multiple implementations. If you've ever needed to choose the right smart pointer, you'll know what I mean. I do think that the C++ community can learn something from the simplicity and consistency of the .Net Framework.

At the end of the day, it's about choosing the right tool for the job.

2007-01-07 15:46:22 · answer #2 · answered by Anonymous · 0 0

http://www.google.com/search?q=C%2B%2B+vs+C%23

Please Google and read the whole arguments and debates.

I'll keep it summarily: C# is unsuitable for systems level programming. You must use C++ or a lower level language like C or Assembly.

C# is better for RAD and general purpose applications development on windows only (C# isn't really usable on Macs, Linux, Unix, etc.). The C# framework (.NET framework) as well as managed code (no worries about pointers and memory management) plus higher level of abstraction make it suitable for general purpose applications.

2007-01-07 15:01:59 · answer #3 · answered by csanon 6 · 0 0

Programming language is something like religion. The way you choose to get the same result, so i think which one is better should be personal preference. but u have to decide which way the easiest way to get what you want. and in my opinion, c# is far more easier to learn than c++, because you don't have to worry about garbage collection thing, freakin pointer, and other deep dark API programming. They're all covered by c# (.NET Framework)

2007-01-07 14:25:49 · answer #4 · answered by Stephel 3 · 0 0

C++ produces faster code then C#, but it's harder to learn.
in C# you don't need to worry about memory leaks, and pointers but it uses more system resourses.

2007-01-07 22:32:43 · answer #5 · answered by Stanley 3 · 0 0

Java.

Seriously, why would you use a language like C# that is controlled by one company?

Now C++ is an excellent language supported in most platforms. You could us it too.

2007-01-07 14:48:01 · answer #6 · answered by adar 2 · 0 3

C's is not so good. get A's or at least B++

2007-01-07 14:06:44 · answer #7 · answered by Anonymous · 0 0

fedest.com, questions and answers