C# - huh?

Started by
36 comments, last by Promit 16 years, 11 months ago
Quote:Original post by RyanZec
Quote:
And think about all the time spent fixing bugs caused by unsafe operations.

And did C++ create these errors or did you?

Like stated before, With C++ you have more control becuase the C++ expects the programmer to not make these mistakes and C# does not give the programmer the chance to makes these mistake but you lose so control that you had in C++, its a tradeoff.


You can make the same mistakes in C# if you know how to use unsafe code and fixed pointers. The difference is that C# makes it so you won't accidentally make those mistakes, while C++ has no such protection. You have to be specifically trying to play around with pointers in C#, generally indicating you know what you are doing and why you are doing it.
Advertisement
First off, I wanted to thank Scorp and all the others for replying so fast and being of great help.

Second, I wanted to say that so far all the programming I've done was in Java, which from what I understand is the same level as C#. If managing the memory is important at the higher level programming then I suppose it would be best to work in C++, especially if it's the most commonly used language for games nowadays (for some odd reason I thought people were using C# now).

If anyone could direct me to some reading material to get me converted to C++ and tell me which compiler to use (either free or bought) It would be greatly appreciated.
Also, feel free to tell me anything else you think I should know on this subject.
Honestly, the "difficulty" of memory management in C++ is enormously overstated. You just have to make sure you delete memory that is dynamically allocated.

I don't think I would choose a language based on whether or not you feel that it will "teach you" to manage memory. That sort of thing can be picked up quickly if and when you need it.
Quote:Original post by RyanZec
Quote:
And think about all the time spent fixing bugs caused by unsafe operations.

And did C++ create these errors or did you?


Does it matter? They still occur and they're expensive to fix.

Quote:Like stated before, With C++ you have more control becuase the C++ expects the programmer to not make these mistakes and C# does not give the programmer the chance to makes these mistake but you lose so control that you had in C++, its a tradeoff.


The "control" C++ gives you has some benefits, but the number of projects that require that level of control certainly does not reflect the number of projects using C++.
....[size="1"]Brent Gunning
Quote:Original post by Idopik
tell me which compiler to use (either free or bought) It would be greatly appreciated.

id recomend either

visual c++
microsofts compiler, has good intelisense but its large number of features an build options can be a bit intimidating

dev c++
a open source compilers for windows, a bit lacking in features but very easy to learn to use
Quote:Original post by RyanZec
Quote:
And think about all the time spent fixing bugs caused by unsafe operations.

And did C++ create these errors or did you?


I did, since I chose to use C++.
Quote:Original post by skittleo
Quote:Original post by RyanZec
Quote:
And think about all the time spent fixing bugs caused by unsafe operations.

And did C++ create these errors or did you?


Does it matter? They still occur and they're expensive to fix.

Quote:Like stated before, With C++ you have more control becuase the C++ expects the programmer to not make these mistakes and C# does not give the programmer the chance to makes these mistake but you lose so control that you had in C++, its a tradeoff.


The "control" C++ gives you has some benefits, but the number of projects that require that level of control certainly does not reflect the number of projects using C++.


Let me make clear I am not saying that if you are going to make game, use only C++. C# is a great tool if you need something up fast and quick or if game programming is just a hobby. however if you plan to do game programming as a professional, I would say use C++ without and doubt. The reason for this is becuase of the I don't see gaming companies moving away from C++ for awhile for the main reason that there is just a huge amount of C++ code that has not been written in C# and won't for some time. However after saying that, I would still learn C# as even now if is being used by professionals mainly for Game/Engine tools(level editord, etc...).

Quote:Original post by skittleo
I would call C++ minimalistic. There's nothing built into the syntax of the language for strings, lists, dictionaries, etc. You can access most of the missing features through STL and boost but the code is almost always lengthier than other langauges and the fact still remains that these features exist outside the basic syntax of the language.


I was only addressing the point of C++ being made out to look like you're forced to program with only the primative data types and nothing more. Sure, you may need to delve into the STL to obtain more functionality for strings and containers such as dictionaries. But my understanding was that the advantage here was giving you more control with what you do with it, instead of just giving you a blanket data type and make of its methods what you will. If we're only looking at what the actual core language syntax is, well... I haven't found other languages to have cores any larger than C++, myself, but that's just my experience. It all goes to the main point I was trying to make, and that is if you want the most control, you'll have to get your hands the dirtiest. If the overall goal is to look for what does the most for you without you having to code anything "extra", why stop at higher level languages? Why not just contract to a different developer, tell them what you want and they save you from coding at all. But you've lost all of your control. It's all give and take.

Quote:Original post by skittleo
And think about all the time spent fixing bugs caused by unsafe operations.

... which were caused by unsafe programming...

Quote:Original post by skittleo
How much experience have you had with other languages? For example, have you tried python?


The point I was making here also goes right back to my first point, so I'll digress on this one.

Quote:Original post by skittleo
The "control" C++ gives you has some benefits, but the number of projects that require that level of control certainly does not reflect the number of projects using C++.

I do agree with this whole heartedly, however.

The bottom line of what I was saying is only that they both have pros and cons, nothing more. I personally like both very much, and realize each has its own place. I also agree with smitty in that the memory management isn't that big of deal to learn, procedurally. It's the programming style that you develop, but that can evolve just as easily.

Kaze is also correct on the compilers. I use Visual Studio 2005, and I like it, but it does have a crazy list of features and options, etc.

Anyhoo... the best of luck to you in your endeavors - keep the fun alive!

Cheers!
Scorp
Once you learn how to use VS 2005, either for C++ or C#, it really becomes a very productive tool. It has a learning curve, just like any advanced piece of software, but once you learn the tricks and the how to use the tools, it's a great environment to work in.
Quote:Original post by skittleo
I would call C++ minimalistic. There's nothing built into the syntax of the language for strings, lists, dictionaries, etc. You can access most of the missing features through STL and boost [...] these features exist outside the basic syntax of the language.

The same is true for Java and C#. The actual Java-language has no knowledge about strings. However, any installation of Java comes with a really nifty library full of stuff like String-classes, data structures etc. You know, just like with C++ and it's runtime library (including STL).

This topic is closed to new replies.

Advertisement