I’ve seen a lot of people, of which some are my friends, who keep whining and telling me how bad c# is for developing games, javascript (unityscript) too and that c++ is best.
I know that c++ is very good and is the way to go for AAA games, but why do people say that c# and unityscript (javascript) suck?
Or are they just jealous kids and it is possible to make good games (graphically) with c#/ js (basically with Unity)?
Someone who ‘keeps whining’ about a language probably shouldnt be regarded as an authority on the matter.
From my experience, people who ‘whine’ about a certain language are more often than not either (or both):
a) biased fans of the other option (c++ in this example)
b) unacquainted with the language in question
I started with C++ myself and for a long while i thought its the way to go and C# is inferior. Until i actually had to learn C#. Now i dont want to touch C++ ever again. Which is not to say thay that C# is somehow better, i just prefer it over C++.
To compare, C++ is simply lower-level than C#. This means you have more control, more power if you will, particularly as far as computational efficiency and optimization is concerned. But at the cost of having to do more coding. Due to its higher level of abstraction, C# does much more for you, which simply means less work. The same is true for JavaScript.
C++ isnt ‘very good’. Its different. It has different characteristics and qualities, as every language does. As far as i know, the reason why it is said that C++ is the best choice for AAA games is because of being low-level (which lends well to optimization efforts) while at the same time being one of the most common languages.
The only valid reasons i can think of:
a) in certain circumstances (ie. computationally intensive calculations) C++ will usually be faster than C#/JS.
b) perhaps because C#, due to its higher level of abstraction, can cause some bad programming habits
c) perhaps because there are more resources for C++ than C#.
As far as Unity and most other 3d engines/libraries are considered, graphic power has nothing to do with the language used for programming the game. Just being able to use Unity together with C++ or any other language out there would not give you better graphics.
I’m sorry to say so but b) is definitely no valid
If something lends to very bad habbits and inacceptable code then its if the language is as open (broken?) as C++, where you to do things in 10+ different ways and is used by users that think that it is required to use them and other highly optimized hacking around instead of a clean, well designed, maintainable code base.
I’ve never seen such blatant ignorance towards even basics of coding and “good practice” as when working with C++, which is very annoying, because aside of ASM and C, nothing can fail as badly as C++ when being hacked together badly thanks to the unprotected pointer environment.
Its true that it low level access gives major power, but with that amount of power, there normally also comes responsibility for not hacking together a pile of poo just “because you can”
Thats why i said ‘perhaps’ - ive just seen people talking about it, but i myself actually share your opinion. Just the whole mess with headers makes me shudder.
But this comes with the lower level of abstraction - its not just C++ thats like that, afaik most low-level languages have this problem. I find that the higher-level language is, the easier it is to maintain the project, if only because theres less code.
The higher maintainability and stability are one of the main reasons the higher level languages were designed, aside of the desire to overcome the low level bindings I guess.
I don’t think its a common problem with low level languages though.
C kind of is not even half as bad.
To me the problem is more that C++ looks and behaves like C with several hundred half baken, independent and non-synergetic additions “plugged ontop”, designed to allow any code, independent of how broken and badly hacked together, to run and to always offer the a halfbaken+ version of “state of the art OO design methods”
Thats where Eiffel, Java and C# clearly show that their designers learned the lessons from C++. The languages were designed consistently with things work hand in hand, in a uniform, stable, maintainable way.
Thanks for answers.
Yes, c++ is faster and that’s why many people prefer it over others. It has a good graphics library, which is another reason.
I too think that C# and javascript as well are way easier to use. They’re more user friendly, just like Unity’s API is powerful but easy to use compared to some other game engines.
Also, it’s the matter of taste. For e.g. if I was using c++ for years instead of c#, javascript, java etc., then of course I’d be more into c++ instead of other languages, but that’s just me
I don’t care what languages I use though, all of them are good enough for me lol.
C++ is not generally faster. It CAN be faster in specific circumstances, but it wont be ALWAYS faster (in some cases it might be even slower, since C# is automatically optimized), it depends on many factors.
What graphics library do you mean?
Both C++ and C# have plenty of good graphics libraries.
So if you basically knew the answer anyway, why the question?
Probably because they believe they have to develop their own game engine to be “real men ™”. Which, IMHO, may be a pretty cool attitude if you’re one of the Unity devs (exchange the “real men” motivation with “democratizing game development” for them; I have great respect for the Unity devs and am very glad they wanted to create a game engine and also followed through with that project) … but … anyways … if your primary goal is to develop a game (and not a game engine), it’s just plain stupid to even consider C++ as language for development (and consider creating your own game engine). Except for maybe very limited parts of the game (that’s what Unity Pro’s native plugin feature is for ).
I think for developing a game engine, there’s not much you can do except using C++ - after all that’s what Unity is implemented in for the greatest part. But today’s reality is that when you want to develop a game, you don’t create a game engine for that. Instead you use an existing one … like … Unity, for instance
And for coding the game logic, C++ is not a good idea at all for the reasons others have already mentioned. There’s also not a single good argument for using C++ for game logic, as game logic is not something that has to run super-low-level. Game logic is something that runs embedded in your game engine. And for that purpose, you use the language that is most efficient from the coding perspective (in contrast to “most efficient from the execution perspective”). And languages like Java, C# and the like (“high-level languages”) are extremely efficient from the coding perspective because you don’t waste weeks trying to find out stupid memory leaks or malformed pointers or other crazy stuff. Well … at least … most of the time
I’d say they simply missed what has happened on the marked during the last 5 years.
I don’t know, I was talking about unity the other day on other forum and some guys started picking on me that c++ has such great graphic libraries and c# doesn’t etc.
I don’t know the answer. I know nothing at all about c++, I never used it, that’s why I posted this topic
EDIT:
What the hell, why did it double post. I only clicked once o.o
sorry.
There are much more engines for C++ than for C#, thats true.
But that does not mean much, as aside of the engine programmers nobody has to use C++, even with multi hundred thousands engine, the designers and game logic developers are primarily working within script languages ( lua - python - ruby - own thing ), as no engine developer will be pleased to see “noobs” hack around in critical sections
For C# there are enough powerfull engines too by the way, some of which a C++ user will never be able to use.
ahahaha, I nearly pooped my pants laughing when I read that lol.
It’s EXACTLY what some of the guys over at the other forum are doing. When I show off some pictures of games I make with Unity, they always come and start picking on me because I use Unity and not my own game engine, that I should write my own engine etc.
That’s exactly what they’re doing, they’re making their own game engines in c++ to make a game. They keep calling Unity “shit”, but when I ask what is so “shitty” about it, and to give me at least one example, then they stop until next time I show something off lol.
OMG! Poor souls … but I’m afraid you won’t be able to save them. See, in their eyes, you’re not “a real man ™”. :lol:
Just go on making a game with C# / Unity and let your friends developing their engine.
Talk to them again in 6 month or so.
Priceless.
oxl
Tell your friends that “Real Men” would write their engine bit by bit in straight up binary or at least in asm instructions, and that they should get working on that ASAP…
You’re more likely to be an iphone millionaire by the time they’re done, but they certainly will have a fast engine when it finally works.
@jashan - I"m afraid I have to disagree with you… “real men ™” use assembler (C++ is for those poor ignorant souls who can’t get their head around how computers actually work… slow as h#ll if you ask me )
Anyone want a pointer to some statistics showing Java ™ out performing c++? :twisted:
@ djoscard - Kidding aside, if someone tells you that you have to “do it from scratch” for “it to be real” and then quotes an approach that leverages another abstracted layer as better… well. :roll: draw your own conclusions…
Cheers,
Galen
Too bad it will take so long that their fast engine would be considered archaic by the time they were done!
Ah, you’re right, of course. Forgive my ignorance. But seriously, real real men … I mean, the really real ones (realer then real, so-to-say) … use … um … punchcards for their assembler-development, of course! I mean, using keyboards and monitors is really for the feeble, isn’t it?
Ahh my friend, one day we must heat up some vacuum tubes and wax philosophic over better times!
Grok me?
ACK?
With c# you do have access to the direct x API
1: XNA
2: The new Windows API Code Pack which has
direct x 11 support
3: Slim direct x unofficial API.
I think that it is defiantly theoretically possible to use c# as your core language. That said I do not think that C# will overtake c++ anytime soon in game dev. Maybe after windows is written in c#. Until then C++ has more libraries and a strong foundation.
Sometimes I feel like I want the power of c++ but then I remember what a mess the language really is. One thing to remember is that you are likely to get slightly biased answers on this forum. Still c# is the only core language other then c++ right now that is a valid game development language.