Do you script in UnityScript or C# and why? POLL

Hey my name is James Collins and I am doing a study for my project at the University of Waikato.

The study is titled “compare the suitability of C# versus UnityScript(/javascript) as scripting languages for creating games on Unity 3D”

I myself am a beginner user of Unity and consider myself familiar with the program but not yet ‘savvy’ with Unity. I am well aware there are multiple choices of scripting languages available on Unity but this study is aimed at C# and UnityScript.

So far I have compared the time of execution of the 2 languages with different tasks however as I am trying to compare the “suitability” of the languages and need some opinions from regular developers which use the languages in a poll type format.

If you have any extra ideas of options for the poll please let me know and helps for contributing if you do it is a massive help for my study.

If you want to elaborate on your answer please post below.

I script in Boo.

How does knowing which one we use help you determine suitability?

I’ve been using Unity professionally and as a hobbyist for 5 years now. My preference is strongly for C#, though all three languages are definitely suitable for development.

Ohk thanks anyway and thanks to everyone who is using the poll. I was going to include all languages in the study but just didn’t have enough knowledge to jump to conclusions about other languages with Unity and would struggle to compare scripts in a language I’ve never used! :neutral:

Hey angrypenguin good question actually, The overall question is the suitability however by trying to determine that I need to answer a few sub-questions for myself (eg performance of both scripts within unity, why people use each language and so on)

So within the study I need to be able to say X number of unity developers prefer scripting in XX due to the dynamics of language whereas X number of… as supporting evidence and hopefully all my research as whole including why developers use a certain language will be able to eventually tie in to the suitability (I hope with fingers crossed :smile::smile:)

You may also be interested in the results of the following poll:

http://forum.unity3d.com/threads/18507-Boo-C-and-JavaScript-in-Unity-Experiences-and-Opinions

I have approached things from a different angle - but the results and also the discussion may still be relevant for your work.

Hipster…

You left out the #1 reason to code in C# over UnityScript. “It’s a real language that is thoroughly documented across several major hubs of the internet and used by several major industries.”

While C# has always been the best choice to use with Unity, the fact that many industries use it is not a selling point. C# normally goes with .NET, meaning that the people in these industries are using Windows.

Unity has no good scripting language; they all rely on garbage collection.

It means, if nothing else, that there are several industries pushing out crowd sourced documentation for the language on sites like StackOverflow. Sometimes we take client projects that deviate quite far from the usual ‘game development’ task list and require the kind of knowledge that the game development circles just cover well on our own.

I’d also argue that “Extensive experience with C#/Mono” looks significantly better on a resume than “Extensive experience with UnityScript” to anyone who is not a Unity shop (and, seeing as how almost all Unity shops use C# anyway, better to us as well).

It also makes interfacing with other industries significantly easier. On a client project we are currently working with a research team (University) on a natural language dialogue engine being integrated with a simulated learning environment. Their internal testing tools are all compiled against .Net using Windows Forms to display - but we can still share a significant portion of the code base directly with DLL’s in a language we both share.

We’re a game shop using Unity, they’re a research team using .Net and Windows Forms - but the advantages of sharing the same language are enormous on this project. I have absolutely no desire to derail another thread with a conversation where one person is going to make factual statements on their opinions. Everything I’ve said in this thread is my opinion based on my experience working on projects that use Unity but are not games. Please take it as opinion.

That’s not necessarily a downside. Native and Managed memory management methods aren’t really better than the other, just different. Each has their own set of problems and benefits.

sudo rm -rf /home/jessy/comments/*

:wink:

It is a selling point because it is a widely supported language regardless of platform. Java is multi-platform, but that doesn’t make it an ideal language to work in, though it has its uses.

Claiming a language is not a good scripting language because it uses GC isn’t very subjective or respective of their place and usage. Some languages may be bad for other more specific reasons, but faulting them for GC isn’t really valid imho.

PHP lets you do awful things, I program in it every day, but it doesn’t have GC (uses reference counting).
Ruby does cool stuff, but it has GC.
Perl 4 is very powerful, but it has GC.
Delphi and VB are… interesting… and have weird quirks… but don’t always/technically have GC, which doesn’t necessarily make them a good language.

Thanks a lot for that link to your poll jashan have had a look and it will be a help to me.

I’m loving the discussion too guys! learning more every post :smile: and thanks to those who have voted so far

Strongly Disagree. It means there’s more varied and vibrant ecosystem one can access.

And here we go… drumroll…

I use C#
I prefer JavaScript for the simpler syntax for things like closures and coroutines, however the ecosystem for C# libraries and code snippets is vast, and given Unity’s limited compile stages, you’re hooped if you want to write JS that talks to CS that talks to JS etc… so it makes sense just to use C# for everything.

I’m pleasantly surprised by the quality of responses here, actually. I disagree with some of them, but on account of nobody having been stabbed in the eye yet…

C# being used extensively elsewhere is a great selling point. For starters it means that you can hire in developers with prior experience in the language even if they’re not specifically Unity developers, something that you can’t do with Unity’s so-called JavaScript because it is not in fact JavaScript. (Not sure if you can with Boo, as I’m not sure how divergent it is from its base language.)

It also means that there’s plenty of existing code out there that you can just use right off the bat. And since plenty of businesses these days are getting internal code bases written in C#, it also potentially means easier integration with or reuse of your own stuff.

I also prefer C#'s way of doing things over JavaScript’s, but that’s largely a personal preference in that it’s how I’ve been used to doing things before I came to Unity. I also use delegates a lot and while it seems that JavaScript has some support for them I don’t believe that it’s as fully fledged as in C#. There are a few other less common things as well, but to be honest I’ve barely looked into them since I’d rather just leverage my C# experience rather than invest time into a tool-specific language.

Claiming that a language can’t be good because it has GC is a bit silly, in my opinion. I love languages with and without it, each for different things. Personally, I think that scripting is a great place for GC’d languages. And if you optimise for the tools you’ve got the GC doesn’t have to effect your performance too significantly, especially for the kind of thing you typically do with scripting. I know that people often do quite low level things with scripting (myself included), but remember that if you absolutely need bare-metal performance you can always move it out to a native plugin anyway. I for one know that I’d be less productive in Unity if I had to look after my own memory management, but I don’t think it’d lead to any practical kind of performance improvement.

I started with Javascript - cause I figured it would be easier. After a few months, I realized there were things I couldn’t do - plugins I wanted to use didn’t work and example scripts had to be converted. The switch to C# was surprisingly easy. It’s been two years since, and I’m still completely happy with my decision.never looked back.

Gigi

I came from a C++ background so C# was the obvious decision, I never liked python so boo was a no-go and Unityscripts syntax wasn’t natural for me. I can program fine in Boo and UnityScript because of my python/js knowledge but try to avoid the two as much as possible. C# also has some perks like faster compilations, statics, gotos etc.

1 Like

I know C, C++ and C# is a natural extensive with similarities to Java. C# has many outstanding reference books and learning books.

UnityScript has only that it is similar to JavaScript and used in many older Unity tutorials to it’s advantage and nothing more really.