which do most people use JS or C#? Which is better for a learner?

which do most people use JS or C#?
Which is better for a freshman?

I think you will find most people are going to use C#. It’s more widely supported. There are a ton of books out there compared to Unity’s Javascript. Plus with C#, it’s not just a unity thing. You can do so much more in C# versus JS

I think JS is a bit easier to use with unity but on other hand C# isn’t really hard its just takes more words to do something you could do in JS in just few words after all JS(unity script) was made for unity.

I’m not really good in programming but if I’m wrong correct me :smile:.

some people say unity3d is not going to support c# any more, can’t be true, right?

and authorities suggest JS?

I doubt they will drop C#. If they did, a lot of people will leave unity. I know I would.

The language war haz begun again! :smile:

This issue has been discussed to death before. I would suggest to do a forum search.

I personally think you will find most Unity people are going to use Javascript. It’s more widely supported inside Unity. It`s the main language when it comes to documentation. C# is rarely documented inside Unity, you have to buy external books. Javascript is easier to read, write and understand than C#, which may especially be an issue for a freshman.

You CANt do this much more with C# in Unity. Thats simply a myth. Javascript, C# and Boo have the same functionality inside Unity. You win or loose nothing by choosing one of the languages. Its to 99.9% a thing of personal flavour. And the rest of 0.1% doesnt really matter for game needs.

To have three languages available is just a design decision to make Unity a bit more universal. When somebody already knows C# or Python then there is no need to learn Javascript. You can jump right into Unity and start programming like you are used to. That`s all. All three available languages gets compiled to another language when you create your exe. So there is also no visual performance difference between them.

Totally not true. It would be a developer suicide to drop C#. Boo maybe but not C#.
JS is supposedly easier but c# isn’t hard either. If you’re on your own I’d pick C# as it has more resources.

Well said.

I find that most who went to school for creating apps come from a C++ and c# BG, while those who went to school for network and web apps learn java/HTML.

i use js/unity script but in the past have had a brief run in with C++, C#, Lua, and blitz. I found that the fundamental basics are all the same (ie) vars, functions, conditions, operators, code blocks, keywords and classes.

When looking at JS it’s real easy to spot what’s going on, that’s why i like it.

That’s nonsense. C# is THE language made for the CIL (in which all .NET/Mono apps compile to) and the C# compiler is of course the one which is most optimized to generate optimized/fast CIL code. Some of the language specific things in US for example doesn’t compile very optimized (i.e. UnityScript arrays being very slow) and .NET as well as Mono already comes with a C#-to-CIL compiler.

Not inside Unity, just in the documentations. And you don’t have to buy C# books (wtf, what kind of argument is this), there are like trillions of tutorials on the web. However, it is advise to anyone new to C# or programming to buy such a book. Because the book covers a large spectrum (polymorphism, field accessors, interfaces etc.) while most online tutorials only focus on a certain topic.

Really, C# or UnityScript, neither one of it is much difficult to learn. 95% of your “knowledge” comes form knowing the classes available in the Mono/.NET Framework and the Unity3D Classes, that’s the API.

In order to use a Dictionary, you must know how it works and when to use it, how to declare it etc, whether you use UnityScript, C# or Boo. Learning the API is like learning English, French, Japanese etc. C#/Boo/UnityScript is the grammer, the API is the vocabulary.

Yea, but you can make it more comfortable. LINQ, Lambda, events/delegates, Extensions methods and operator override don’t work in UnityScript.

While you can do most of the stuff without the ones above in UnityScript/Boo, it’s not nearly as comfortable. Try implementing event/delegates in UnityScript, it feels like a mess. And replacing that one with direct Framework interaction requires you to dig even deeper into the Framework and what delegates are and how they work than without doing so :wink:

In my humple opinion C# language is more valuable to learn because it’s more common and more correct.

I disagree on the more correct comment. Not one specific language is more correct than another. It depends on how you, the programmer, and how you program the script.

I did not mean that it’s more correct itself but in other sense, for example in JS you don’t need to define variables and etc. and I don’t like that, I like more strict code that don’t let you leave unstable stuff on the side. But yeah, I write code equally amount on JS and C# and I don’t think that there is a reason to choose a single language.

Oh ok, I misunderstood.

+1 On this. If you are reading this thread and have more languages under your belt than UnityScript and C# you will just laugh at the sand being thrown in the sandbox.

From my experience, computer languages “call” to you at certain times in your career. This may sound funny but it’s more about what feels right at the time and when gets what you need done.

I have to be honest, there are times I wish I could just sit down and write some good old scripts in UnityScript and be done with it. But, my OCD gets the best of me and blah blah blah, to many OOP design pattern books.

Update: The one major reason for C# is existing libraries which may seem obvious to some but not others. Reusable libraries are very important when things get large and complex. They also allow you to pull out API that can be reused on a compiled level in future projects.

If I had one opinion that I thought others might listen to, I would say a lot of developers that “need” to use C# are going to be designing games that have more of an application structure. This is by no means a slam on javascript, it’s just that the C# language allows design patterns that just aren’t possible with javascript.

Mike

LOL What? Baring a few select cases the documentation comes in C#, US and Boo.

Correction.

C# has plenty of external documentation - feel free to go and read some books, watch video etc.
US has little to no external documentation.

Neither language is well documented by Unity.

Again wrong.

While I do agree that JS has certain advantages when coding at a basic level [e.g. newbs] C# has tons of features that can give it a strong heads-up if you commit to learning. A simple example is the LINQ keywords supported by C# that, when used properly, are a beauty to read :slight_smile:

Again wrong, C# has a selection of features that US doesn’t have, which gives it advantages when used properly.

LINQ [keywords].
Shorter Lambda’s.
Extension Methods.
Anonymous Types [?]
Events
Out/Ref

etc. all spring to mind. [Correct me if I’ve made a mistake]

Again wrong. With C# you ‘win’ the ability to reuse code in other non-unity applications. This is VERY useful when you’re writing server code :slight_smile:

Then refer back to the additional features etc.

I suggest YOU do a forum search, because you’ve made a ton of incorrect statements.


US isn’t completely useless - and a lot of the benefits of C# only come into effect when you decide to get hard-core with the language. However there certainly are differences.

I use both, I can convert scripts to or from C# to JS and back again…

I disagree the C# docs are pretty good, helped me out alot.

If by that you mean, that the game will be well designed and easily extensible, then yes :stuck_out_tongue:

That’s one of the reason why you do OOP programing (of course there are also ways to mess up OOP code and make it not extensible of flexible), because it can be extended more easily. If you just throw your code together to make it “work somehow”, you will run into problems when you try to add a new feature and have to rewrite 30% of your code base to add it.

I’m pretty sure I saw one or two Unity Books, though I haven’t read them so dunno if they use C# or Unity Scrpit in it. But compared to 1000s of C# books, it’s “quite rare” ^^

Exactly. Though you would have to be careful - Unity != UnityScript. Do the books teach the Language or the API (or any other of the many topic one needs to know - e.g. code patterns, asset importing, game design, project management, editor features etc)?

With C# there are exceptional books about the language itself, before you even start looking at resources about .Net, Mono, Coding Practices etc that you can find in C#.

I don’t find anything wrong with using the API for C# its very helpful…

Popcorn anybody? :smile: