Search Unity

  1. Dismiss Notice
  2. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  3. Dismiss Notice

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

Discussion in 'General Discussion' started by stainz, Sep 19, 2013.

?

What language do you use and why?

Poll closed Oct 9, 2013.
  1. C#: Performance

    36.8%
  2. C#: Knowledge of the language

    63.2%
  3. C#: Dynamics of language

    52.6%
  4. C#: Other.. Explain in post

    19.3%
  5. UnityScript: Performance

    3.5%
  6. UnityScript: Knowledge of the language

    10.5%
  7. UnityScript: Dynamics of language

    7.0%
  8. UnityScript: Other.. Explain in post

    1.8%
  9. Both

    5.3%
Multiple votes are allowed.
  1. stainz

    stainz

    Joined:
    Sep 19, 2013
    Posts:
    6
    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.
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    737
    I script in Boo.
     
  3. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    13,675
    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.
     
  4. stainz

    stainz

    Joined:
    Sep 19, 2013
    Posts:
    6
    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:
     
  5. stainz

    stainz

    Joined:
    Sep 19, 2013
    Posts:
    6
    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:)
     
  6. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,295
  7. LucasDaltro

    LucasDaltro

    Joined:
    Oct 31, 2010
    Posts:
    236
    Hipster...
     
  8. KyleStaves

    KyleStaves

    Joined:
    Nov 4, 2009
    Posts:
    820
    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."
     
  9. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,326
    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.
     
  10. KyleStaves

    KyleStaves

    Joined:
    Nov 4, 2009
    Posts:
    820
    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.
     
  11. XGundam05

    XGundam05

    Joined:
    Mar 29, 2012
    Posts:
    473
    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.
     
  12. inafield

    inafield

    Joined:
    Feb 26, 2013
    Posts:
    281
    Code (csharp):
    1. sudo rm -rf /home/jessy/comments/*
    ;)

    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.
     
  13. stainz

    stainz

    Joined:
    Sep 19, 2013
    Posts:
    6
    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 :D and thanks to those who have voted so far
     
  14. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    Strongly Disagree. It means there's more varied and vibrant ecosystem one can access.
     
  15. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,629
    And here we go.. drumroll...
     
  16. squidbot

    squidbot

    Joined:
    Jan 4, 2011
    Posts:
    128
    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.
     
  17. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    13,675
    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.
     
    Last edited: Sep 20, 2013
  18. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    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
     
  19. dxcam1

    dxcam1

    Joined:
    Feb 6, 2012
    Posts:
    477
    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.
     
    nmtmo likes this.
  20. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,180
    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.
     
  21. Shadowys

    Shadowys

    Joined:
    Aug 19, 2013
    Posts:
    5
    I use Boo too. Guess most of the people don't use Ruby or Python before much, thus not feeling the raw fire to have cleaner and clearer syntax, and the raw power of Boo in their code. Sigh. :p C# is nice, but seriously, the compiler is too stupid for fast scripting (foreach in D, even, is sane enough to know that when you pass a int[] into a loop, all of its elements are ints...., and the generics available is horrible. JS...please. LOL Don't get me started on the comparison operators....for an array== :p Guess I'm just biased to Python, but it makes me fly!
     
  22. Sir-Tiddlesworth

    Sir-Tiddlesworth

    Joined:
    Oct 19, 2011
    Posts:
    908
  23. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,223
    Which leads to snatch and grab snippets by supposed game devs and making a mess of the codebase and structure in many games clients have come to me to bug fix. I can tell they were just grabbing crap and inserting it and then scattering references across umpteen documents to get single sets of functionality done..and then painted themselves into a corner and bailed. When I go to find some info on some code that is puzzling I find alot of blithering about how it works on an MS server or in some business app. When I do run into some issue with Unity .js at least the answers are focused on game dev and not some integration with MS corporate crapola.

    I will work on others stuff in C# for cash if started in that language but forego it when writing from scratch as it is like talking backwards and forces verbosity that my sensibilities don't want to deal with nor do I have any need of the supposed extra functionality that C# has.. I often think that is a myth because in 5 years and several dozen client contracts and a few dozen of my own medium sized projects I have not ran across a single thing i could not accomplish in Unity .js. If I did I would simply write that one set of functionality and drop it in the appropriate folder to access it. I hear complaints from C# folks that they cannot work with .js. These whizbang programmers with high and mighty opinions cannot use the correct folder structure and do not know how to lodge a script/s to it???

    I use .js as it has a forward syntax to my sensibility and since I come from an 10 year ActionScript background doing RAD..not websites or ghawdawful ads... I can write it like I can write an email or a rant and hardly ever go to the API for guidance nor use IntelliSense or code hinting. I can then spend my time coding creatively. I still use Unitron as it seems be quicker than MonoDevelop and has never crashed..rock solid. I have been on Macs since 94 so not really caring about the windows platform nor putting another dollar in that reprobate Gates bank account I boycott anything that comes from them if possible.. YMMV. Apple fanbois spending too much for kit? No.. I have actually only bought out of my pocket three of the twelve macs I have worked with over the years.. Call me lucky..people/clients/friends give them to me when they see what i can do with one. So I ain't putting too many dollars in Cupertino's pants packets either. I will be trying to put some monies away for the new MacPro.. I don;t think that one is gonna fall into my lap...lol..

    -R
     
unityunity