C# - huh?

Started by
36 comments, last by Promit 16 years, 11 months ago
Quote:Original post by DaBono
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).


There is still a difference. You can write, run and ship a C++ program without the STL. You can (and I have) write C++ in environments where the STL does not exist. You can't decouple C# and .NET, or Java and it's libraries, it just doesn't work. They ship as a package. If I am working in C#, I know for a fact I have the .NET facilities at my disposal, it's not something I have to think or care about. System.String will be there and it will have a primitive syntactic sugar element called "string" and it will support all the operations I need it to. Even if STL DOES exist in the C++ environment, is it a good implementation? Does it follow the standard?
Advertisement
What's C#? Look here:

http://en.wikipedia.org/wiki/C_Sharp

http://en.wikipedia.org/wiki/Microsoft_Visual_C_Sharp

Can you use C# for game programmming?

Yes, you can. take a look here:

http://msdn2.microsoft.com/en-us/xna/default.aspx
Quote:Original post by GnomeTank
Quote:Original post by DaBono
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).


There is still a difference. You can write, run and ship a C++ program without the STL. You can (and I have) write C++ in environments where the STL does not exist. You can't decouple C# and .NET, or Java and it's libraries, it just doesn't work. They ship as a package.


Why can't you decouple C# and .NET? I mean, I guess you can't really write an operating system in C#... Oh wait, yes you can.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

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 don't know. Did the chainsaw cut off your fingers or did you? Is the chainsaw safe?
Quote:
You can't decouple C# and .NET

Yes you can. .NET is just a CLR implementation, you can run C# on any CLR implementation. Furthermore, nothing in the C# standard really mandates that you use a CLR... you could have the language compile to native code if you liked (though nobody has bothered to implement such a C# compiler).

In any case...

Quote:
You can write, run and ship a C++ program without the STL. You can (and I have) write C++ in environments where the STL does not exist.

There are two things wrong here. First, did you really mean the STL (the old SGI library), or did you mean the SC++L (the modern standard C++ library, which contains some of what used to be the STL)? They are different, although commonly used interchangeable, so clarifying your meaning would help.

I'll assume you meant the SC++L, because that makes the most sense in this context. I'll also assume that by .NET you mean the standard library that is exposed by .NET (all the System.* stuff), since I already pointed out the fallacy in your statements when .NET is taken to mean the underlying common language runtime implementation.

In that case, you're still wrong. Just because you ship code that does not utilize the SC++L does not mean it isn't there. Likewise, just because you ship code that makes no reference to the System namespace doesn't mean it isn't there. But you can, in fact, ship code in both C++ and C# that does not make use of the standard library as long as you rely appropriately on 3rd party libraries (otherwise there's actually very little you can do with the language).

This tends to be true of many languages, in fact. The actual language intrinsics portion of a language tends to be very limiting, and the standard library facilities (built on top of those basic intrinsics) tend to be what gives many languages their expressiveness and power. The way that many modern languages (and even C++ is moving in this direction) entangle their language intrinsics with their standard library (for example, as syntactic sugar) is becoming increase more common and pervasive, so it makes even less sense nowadays to consider a language without its standard library.

Note that you can make the argument that you worked with an implementation of language X that lacked its standard library (for example, C++ without any of the standard headers), but this really doesn't hold up because such an implementation is not standard-conforming, at which point you can say, make or do pretty much anything with said implementation since it has no baseline. Consequently, any remotely standards-conforming C++ environment should ship with a remotely-standards-conforming implementation of the SC++L (but not necessarily the STL, as its the SC++L that is detailed in the C++ Standard document, not the STL, which is technically a 3rd party library despite what the S stands for).
I don't think I need to add anything to the discussion of C++ and C#, just that it all depends on your abilities, desires, need for balance and control, the usual generic response.

As for an IDE, I've switched from Dev-C++ to Code::Blocks (using the Nightly builds on the forum), for a little more control, more feature sets, and an IDE made using the langauge it 'advocates'.
As far as I know, there may be a possiblity for it to use C# (it does have support for D), but I honestly don't know

On the note of D, you could also try that. It's a relatively young language (began in 2002, I think), and I've seen some applications/libraries on various D repositories and on SourceForge. As far as how good it is for game programming, I can't formulate an opinion on it just yet. I still need to get into the language.
Projects:> Thacmus - CMS (PHP 5, MySQL)Paused:> dgi> MegaMan X Crossfire
Not to mention, that there is C++/CLI, which imho completely undermines C#, unless
you never learned C++.
C++/CLI is great for porting legacy C++ code into a managed environment (eg, porting an old game engine so you can use it with C#).

It is sufficiently ugly and awkward to make writing fresh, new applications in it painful. [wink]

[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]

C# for tools, C++ for games, is a nice rule of thumb.

I don't really advise *learning to program* games in C# if you want to get into the industry professionally - good luck writing a triple A title for the PS3, Xbox 360 and Wii in C#.

However, if you want to make an indie PC or XNA game or learn how DirectX works, it's quite nice. With DX being a lot about pointers and filling out data structures, you can get started faster in C#, and it's a bit more forgiving. You'll also find performance wise it's a lot better than Java.
"He took a duck in the face at 250 knots."
I still remember my high school C++ teacher saying that everything was going to be moving from C++ to Java, that still makes me laugh.

This topic is closed to new replies.

Advertisement