Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Boo, C# and JavaScript in Unity - Experiences and Opinions

Discussion in 'General Discussion' started by jashan, Feb 27, 2009.

?

Which Unity languages are you currently using?

  1. Boo only

    2.9%
  2. C# only

    56.3%
  3. JavaScript only

    19.2%
  4. Boo & C#

    1.6%
  5. Boo & JavaScript

    0.4%
  6. JavaScript & C#

    18.5%
  7. Boo, C# and JavaScript

    1.1%
  1. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    You'll be pleased to hear, then, that in Unity 3.0, all the code samples in the manual will be available in C# (and also Boo).
     
  2. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    This is awesome news ... even though it's not really news anymore now ;-) ... anyways, I just found this cool link from Tom's Twitter-Stream:

    Coming from ActionScript / UnityScript to c#

    So, if you're coming from ActionScript - this might be a good way to get you up to speed with C# ;-)
     
  3. Nikolay116

    Nikolay116

    Joined:
    Mar 21, 2010
    Posts:
    421
    I knew python fro BGE and padan3d, with unity I started with JavaScript because most of tuts were in it.
    Now I moved to C#, because for general data handling it has more options (seems to me), than JS. Maybe it is also slower, but right now this is not a problem for me.
     
  4. Broken-Toy

    Broken-Toy

    Joined:
    Jan 16, 2010
    Posts:
    455
    Hi, I am not a programmer. I am a game designer and scripter. However, I am of the independent kind, so I don't (can't) hesitate to delve as far as CGPROGRAM to get my game ideas kicking and screaming into the world.

    My first contact with programming was through QuickBasic, back when I was a kid. It was a fun mental exercise and piqued my curiosity a little, but I was more interested by being oudoors at the time.

    About a decade later I discovered that one of the video games I was playing had something called a "scripting language" to make mods that changed the rules of the game. Since that game was Neverwinter Nights and I played mostly multiplayer, there was a potential to change the game experience for many other people through those scripts. That was the main driving force making me sit down and actually learn what all those brackets and semicolumns were about.

    I also spent time in Second Life and there, too, sat down and learned the local scripting language for gaming and social purposes. Both NWScript and LSL languages use a syntax which is very close to C-type languages, so over time I learned not to fear the brackets and semicolumns, although at first I was a bit awkward with them, being used to typespace in QB.

    Over the years I researched various game engines and game-making approaches, such as GameMaker, where I made my obligatory First Game Which is Not a Mod but Utterly Sucks (a Breakout clone), and Construct, which I actually used and abused to prototype gameplay as part of the production of two Wii games.

    Since my programming background stems from game modding and scripting, I don't consider myself a programmer, far from it. My diploma is one of game design, with bits of narrative and art direction in-between, although I have a previous background in industrial engineering to complement it.

    I work with the tools I feel are the most appropriate for each different job and for my situation.

    Most of the time that tool is UnityScript, because it retains most of the no-nonsense, straightforward approach of scripting languages. At first I wanted to learn Boo, but there are some cross-platform showstoppers and the majority of samples available are in UnityScript, so, yeah.

    I am used to work with "slow/laggy" scripting and modding languages to express my ideas, which forced me to refine my game designs in the most efficient ways possible. UnityScript is a lot faster in comparison so I usually don't see the "difference" with C#.

    However, I fully acknowledge that some of the more arcane features may not be available in that language. These usually involve getting a performance boost on complex and repetitive calculations. In the cases where that difference is meaningful, I'll definately favor C# and even ShaderLab/CGPROGRAM solutions. But most of the time, using C# has not proven to be that essential.

    I like the way I can write scripts without being bogged down in intricate syntax and can isntead focus on creating gameplay behaviors. I use a middleware like Unity precisely to spend less time in low-level programming and more time prototyping other aspects of my games and find the fun. The more high-level I can go while still getting results which are enjoyable for the players, the better.

    I also enjoy that I don't have to worry about platform-specific idiosyncrasies as much as I would with an engine made from scratch (drivers and memory management, ugh!). With Unity it "just works". That alone is worth a lot more than a grand.

    The absence of a built-in GUI editor! The lack of control (scripted and in-editor) on shadow cascades, resolution and blur distance!

    I also find annoying that the scripting languages don't come with a high-level version akin to Construct's event system, where pre-made "modules" are stacked ontop of one another to form the gameplay behaviors. I was pleasantly surprised to find their implementation very close to the structure of typing, very performant, and of course it removes the possibility of syntax errors. Unlike spaghett- I mean, visual editors, it stays tidy as well.

    I can't wait to see what Neodrop does with his spaghetti editor though, because automating part of the scripting process (generating the rough bulk of the script) can become a huge timesaver.
     
  5. johnboy007_2006

    johnboy007_2006

    Joined:
    Jul 14, 2011
    Posts:
    81
    Can you have all your game code in C# but also run a java script for an object or is it one code only?
     
  6. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    You can mix the different languages - however, you need to be a little careful with which scripts from which languages can access which scripts from which other languages under what circumstances ;-)

    See also: Overview: Script compilation (Advanced) (it's a little "hidden" in "3. All other scripts outside "Editor" are compiled next.")
     
  7. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,551
    Where are you coming from?

    I've always wanted to make videogames ever since I was a kid seeing one for the first time when my brother showed me. Ever since, I've studied what it took to make a game so I got into programming and 3d art.

    As a child, I've shown a natural inclination in art, but I also persevered with programming, and I'd say it paid off.

    I would usually learn a programming language earlier than my peers in school, only to find out that what I studied was too advanced for my expected level. I remember being a freshman in highschool when two seniors were at awe when I started writing private variables and public functions in C++.

    My very first game was a turn-based RPG combat in QBASIC, which I threw away because I thought it sucked. I regret doing that.

    I've dabbled in other stuff over the years: sketching, 3d art, graphic design, Flash and web programming.

    Game development is a very risky proposition here in my country as its not as established as other fields like advertising or information technology. Nevertheless, I always jump on the chance to go into game development because its what I love to do, stable jobs be damned.

    My very first major project was an online game with Torque, and it was quite stressful being the only programmer in the team. I worked there for two years and eventually left from burnout. There was a point when I questioned myself and didn't want to do programming anymore (I thought about being a novelist), but that's all water under the bridge now. As a compromise, I'm making a videogame where I'm also writing the story.

    Now I work in a start-up company making videogames hoping to establish ourselves in the local industry.

    I'm also active in the Unity developer community sharing code in the wiki and forums, and hanging out in the Unity IRC chat channel.



    Which languages are you working with in Unity?

    I come from C++, so C# was a no-brainer to me, after finding out the equivalents to the STL data structures and whatnot.



    What do you enjoy about using these languages in Unity?

    Its what I'm used to, and no more pointers.



    What do you find annoying?

    Mostly not the language but the IDE, MonoDevelop is a weird one, double-clicking on an error doesn't focus the MonoDevelop window, its slow, and crashes sometimes. So I use Notepad++ when on a Windows machine.

    I'm mostly vexed with the fact that I can't afford Unity Pro for the foreseeable future. This has me tempted to try out UDK.
     
    Last edited: Aug 10, 2011
  8. Dhruvil

    Dhruvil

    Joined:
    Aug 10, 2011
    Posts:
    3
    Thank you very much..
    :)
     
  9. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,753
    @anomalous_underdog

    If you don't like monodevelop which I don't either, you should really look at visual studios (with resharper plugin if you can afford it.)
     
  10. Adeno

    Adeno

    Joined:
    Aug 7, 2011
    Posts:
    184
    I've had experience programming in COBOL, Assembly, QBASIC, C, Visual BASIC, Java, C++, and the actionscripts that the first few versions of Flash used. Aside from the typical school programming exercises, I loved making prank programs. I remember creating a naughty clock which showed a pal in a naughty situation at the right moment. I also created fake chat programs to fool my classmates into thinking they were chatting with someone from the other class, only for the chatmate to reveal herself as the dean lol! I also made a game called The Big Mix (which I will revive in Unity someday) which was a mix of trivia and action game about two guys trying to survive in a sick and twisted game world. Unfortunately, after graduating from college, real life demands pushed me away from the computer science field in order to survive. It's been around more than a decade since I last programmed something and quite honestly, I have forgotten a lot about them except for the very basics.

    As of now, I'm trying to relearn everything, with C# as my focus (because people seem to be starting to move on to this) and a little bit of 3ds Max 2012 just so I can make my own simple assets. I just have bad memories about Javascript before that's why I'm not inclined to use it. I believe that as long as you have the desire to make fun games, you'll always be able to take that tiny step to move forward into becoming a respectable game maker and programmer.
     
  11. DavoAp

    DavoAp

    Joined:
    Dec 12, 2011
    Posts:
    9
    As I am trying to get out of being a beginner, I never used JavaScript before as I often use C# most of the time in Unity, however compared to JavaScript it feels so limited when trying for example subclassing, thus I think JS has more properties than C# but I don't know to be honest as I am not yet a moderate programmer.

    Like for example a cookie class in JS, how can you convert this to C#?
    Code (csharp):
    1.  
    2.  
    3. class A{
    4. var biscuit : string;
    5. var number: int;
    6. }
    7.  
    8. class B extends A{
    9. var hasChips : boolean;
    10.  
    11. function B(biscuit : string, number: int, hasChips : boolean){
    12. super.biscuit = biscuit;
    13. super.number = number;
    14. this.hasChips = hasChips;
    15.        }
    16. }
    17.  
     
  12. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    766
    We have moved everything we can into C#, for very specific reasons:

    We separated most of the game logic into separate Visual studio projects, and import the dlls into the game.
    This way, these separate projects can be easily tested with NUnit.
    Also, the nunit tests can be debugged with visual studio express.

    There are a number of features that C# has that JS does not. Like operator overloading and ref parameters. Also syntax for structs is very awkward in js.

    Our specific game is also very performance sensitive. We create millions of voxels using struct in memory, and we iterate through them to build procedural terrain. JS just does not cut it.

    Lastly, we will eventually do a server, and we want to share code between the client and the server. C# is better suited for this as there are more application servers supporting C# than UnityScript.

    The grief that we have is integrating JS with C#. You have put some C# in plugins folder in order to make them accessible in JS. It is much simpler and cleaner to just have everything into one language. LINQ is also fantastic.

    I do wish unity supported namespace for C# monobehaviours.
     
  13. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    I started with Unityscript and now I use C# exclusively. No turning back :)
     
  14. pivotraze

    pivotraze

    Joined:
    Feb 4, 2012
    Posts:
    593
    I only use Boo. Mainly because the majority of my past programming experience is in my favorite language: Python. I used C# before, it was nice, but when I used Python... Man did I love it. I still use it today. Boo is practically the same, so I chose it :p

    I actually am translating many tutorials from Unity's C# and JS scripts to Boo.
     
  15. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830

    Err... simply?

    Code (csharp):
    1.  
    2. class A
    3. {
    4.     public string biscuit;
    5.     public int number;
    6. }
    7.  
    8. class B : A
    9. {
    10.     public bool hasChips;
    11.  
    12.     public B(string biscuit, int number, bool hasChips)
    13.     {
    14.         this.biscuit = biscuit; //or base.biscuit = biscuit;
    15.         this.number = number;   //or base.number = number;
    16.         this.hasChips = hasChips;
    17.     }
    18. }
    Why didn't you just google it?
     
  16. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    As NPSF3000 has shown, that's actually quite simple. It's really the other way round: C# gives you more language features than UnityScript. In other words: Anything you can do in UnityScript, you can certainly do in C# - but quite a few things you can do in C#, you cannot do in UnityScript. However, UnityScript does quite a few things implicitly for you that you need to explicitly write out in C# (examples would be automatically subclassing MonoBehaviour, how Coroutines are started or how struct properties can be assigned easily).

    So that's what quite a few people consider an advantage of UnityScript. When you just want to have results as quickly as possible, this sure is a benefit of UnityScript. If you want to learn what's going in Unity on by reading code, this is a severe disadvantage of UnityScript compared to C# - so for teaching, I very much prefer C# as well.
     
  17. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    I had jobs where I had to code in PHP, ActionScript 1/2/3, Javascript, Java J2EE, on top of C++, Boo and Director's Lingo for personal (complicated) projects. Then 3 years ago I tried C# with Unity ...
    And to put it simply : I'll try my best for all my future job applications to revolve around C# :)
    The language is the most serious, efficient and interesting I've yet to know (personal, subjective opinion indeed).
     
  18. DavoAp

    DavoAp

    Joined:
    Dec 12, 2011
    Posts:
    9
    I have, but because of the lack of resources of answering my query and many confusing examples, I was not sure if it would give me the right answer and so I thought it wouldn't hurt to ask.

    I see, I am glad I made a fair choice, it takes alot of patience and commitment to learn C# in my opinion, so thank you. :)
     
  19. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    C# all the way!
    I came from a .net background, when i graduated in computer science, i worked in the aerospace market for a while (before getting in the gaming industry) doing C/C++ and a lot of C# and .net. To me the quickest and most elegant of those is of course C#. Though, i still like C++ to manage memory my self but when it comes to game logic and high level behavior, nothing can beat C#!
     
  20. Foam

    Foam

    Joined:
    Jun 13, 2012
    Posts:
    322
    Boo with some things in C#.

    I can pretty much code in whatever language is best for the job, and in this case it's pretty much Boo. The reasoning behind this is that I am the only developer on the project and so the limiting factor is my time. Boo speeds up development time significantly while still enabling all the "serious" language features necessary for decent development.

    The only annoying thing about it is the occasional hiccup on white-space (Boo's parser has some bugs) but that is easily fixed.
     
  21. Khyrid

    Khyrid

    Joined:
    Oct 8, 2010
    Posts:
    1,790
    BOO users are small in numbers so they have to be extra crazy like a wolferine to keep away the C# wolves and java unity noob rabid skunks
     
  22. Molt

    Molt

    Joined:
    Sep 6, 2011
    Posts:
    103
    Where are you coming from?

    I've been a professional non-games developer for fifteen years now, coding in a number of languages ranging from Perl and Ruby, through Java, up to assembler, CUDA and C++, I've also ended up finding myself needing to be useful in obscure/unusual languages (MHEG-5, BCPL, Haskell, Java bytecode..) at short notice.

    I learned Unity on my own time for personal projects, and have spent my own personal pennies on the Pro edition as render to texture and native extensions are too nifty not to have, but have been promoting it as a possible technology for interactive 3d applications at work for some time now.

    Which languages are you working with in Unity?

    I knew C# before I came to Unity and that's my primary language.

    When doing anything complex I try and code as much of the application as a DLL in Visual Studio, and then only writing thin adapters inside Unity components to allow me to use the DLL. This allows me to use my preferred approach to development, using unit/functional test tools such as nUnit, nSpec and DotCover to prove to myself that my code does what I intend (and will continue to do so tomorrow when I tweak it), as well as making use of tools such as ReSharper and Doxygen to provide a very strong development environment. It also means that if I do end up needing to develop for another .net engine (XNA for example) then the DLL is easily reusable, it didn't really 'know' it was intended for Unity in the first place.

    Some of my investigations have also lead to me writing C/C++ extensions to Unity, mainly experimenting with video playback. My approach to this is very similar to C#, although there is a need for some Unity-specific code to be part of the DLL in these case.

    I've also been recently experimenting with using F# for things it's suitable for, such as AI/analysis, but to be honest I'm at the point where I do know the syntax and can get it to Do Things but don't yet feel comfortable enough to just sit and write a large amount of it. I feel it's something which could be very useful and powerful, I just need to crowbar enough into my brain that it becomes "Just another language".

    What do you find annoying?

    Waking up in the mornings, and that Unity is running on an older version of the Mono framework. I use the shininess offered by more recent versions in other non-Unity projects and then find myself missing it when I move back.
     
  23. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
  24. UnknownProfile

    UnknownProfile

    Joined:
    Jan 17, 2009
    Posts:
    2,311
    Now what was the need to bump this thread? Do you have anything at all useful to say? If not, there really was no reason to bump this thread.
     
  25. Khyrid

    Khyrid

    Joined:
    Oct 8, 2010
    Posts:
    1,790
    He obviously bumped it so more people would have the chance to read my hilarious comment above.
     
  26. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    I'm using JavaScript for my current project, but I'm wishing I'd used C#.
     
  27. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    I think it's obvious Rab236 the reason why I bumped this thread. The poll numbers are important to me that's why.

    So there you have it rab236 I really do have a reason to bump this thread lol

    When I bumped this thread I wasn't thinking oh I must write something interesting for rab236.
     
  28. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    ...why?
     
  29. UnknownProfile

    UnknownProfile

    Joined:
    Jan 17, 2009
    Posts:
    2,311
    Oh, yes, so obvious. Your lack of saying anything made me know exactly what you wanted. Of course it's obvious to you why you bumped it.

    Also, as superpig asked, why are the numbers so important to you?
     
  30. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Thank you for reviving this thread – even though I kind of agree that just a "bump" is probably not the ideal way to do this (I guess there's places where this is very common, though). As the numbers are important to you (which is great because that's why I created this poll ;-) ), I believe the best approach is to link to this thread whenever another one of those C# vs. JavaScript threads that doesn't get anywhere pops up. That way, people can find the information instead of getting lost in discussions.

    So maybe we can get back on topic (from the original posting):

    "It would be nice if we could avoid discussions and instead just share the personal background - and experiences with the languages we actually use: Where are you coming from (programmer / new to programming, which languages have you used before using Unity etc.), which languages are you working with in Unity, what do you enjoy about using these languages in Unity, what do you find annoying?"

    And I just noticed that you haven't posted your background, experiences etc., yet. So that is really the greatest way to "bump" this thread: By contributing with your personal background, your experiences with languages in general and with the languages Unity provides in particular ... and what do you like/dislike about the languages you're actually using :)
     
  31. Doddler

    Doddler

    Joined:
    Jul 12, 2011
    Posts:
    269
    I'm not sure the poll results are relevant after so long, I imagine that the results would have shifted quite a bit since it was originally taken.
     
  32. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    The poll is still open - and will never close - so to a certain extent these changes are actually covered in the poll. And in fact, the results have shifted. Unfortunately I didn't think of putting the results into the thread every once in a while so that trends become obvious. But there's wayback ... so let's check out the Web history:http://web.archive.org/web/*/http://forum.unity3d.com/threads/18507-Boo-C-and-JavaScript-in-Unity-Experiences-and-Opinions

    The first capture in the archive was Oct 1st, 2010 - about 1 1/2 years after the poll originally was started. Here's the results from back then (299 voters):

    [TABLE="width: 500"]
    [TR]
    [TD]Boo only[/TD]
    [TD="align: right"]4.35%[/TD]
    [/TR]
    [TR]
    [TD]C# only[/TD]
    [TD="align: right"]31.10%[/TD]
    [/TR]
    [TR]
    [TD]JavaScript only[/TD]
    [TD="align: right"]31.77%[/TD]
    [/TR]
    [TR]
    [TD]Boo C#[/TD]
    [TD="align: right"]2.68%[/TD]
    [/TR]
    [TR]
    [TD]Boo JavaScript[/TD]
    [TD="align: right"] 0.33%[/TD]
    [/TR]
    [TR]
    [TD]JavaScript C#[/TD]
    [TD="align: right"] 28.76%[/TD]
    [/TR]
    [TR]
    [TD]Boo, C# and JavaScript[/TD]
    [TD="align: right"]1.00%[/TD]
    [/TR]
    [/TABLE]


    So let's move one year into the future - sample from Oct 11th, 2011 (453 voters):

    [TABLE="width: 500"]
    [TR]
    [TD]Boo only[/TD]
    [TD="align: right"]3.53%[/TD]
    [/TR]
    [TR]
    [TD]C# only[/TD]
    [TD="align: right"]33.55%[/TD]
    [/TR]
    [TR]
    [TD]JavaScript only[/TD]
    [TD="align: right"]30.24%[/TD]
    [/TR]
    [TR]
    [TD]Boo C#[/TD]
    [TD="align: right"]2.21%[/TD]
    [/TR]
    [TR]
    [TD]Boo JavaScript[/TD]
    [TD="align: right"] 0.44%[/TD]
    [/TR]
    [TR]
    [TD]JavaScript C#[/TD]
    [TD="align: right"] 28.70%[/TD]
    [/TR]
    [TR]
    [TD]Boo, C# and JavaScript[/TD]
    [TD="align: right"]1.32%[/TD]
    [/TR]
    [/TABLE]

    There's a trend becoming obvious here: JavaScript is losing, C# is winning ;-)


    Another year into the future - sample from August 31st, 2012 (so it's not a full year - but that's the data I have), 583 voters:

    [TABLE="width: 500"]
    [TR]
    [TD]Boo only[/TD]
    [TD="align: right"]3.26%[/TD]
    [/TR]
    [TR]
    [TD]C# only[/TD]
    [TD="align: right"]37.39%[/TD]
    [/TR]
    [TR]
    [TD]JavaScript only[/TD]
    [TD="align: right"]28.99%[/TD]
    [/TR]
    [TR]
    [TD]Boo C#[/TD]
    [TD="align: right"]2.06%[/TD]
    [/TR]
    [TR]
    [TD]Boo JavaScript[/TD]
    [TD="align: right"] 0.51%[/TD]
    [/TR]
    [TR]
    [TD]JavaScript C#[/TD]
    [TD="align: right"] 26.59%[/TD]
    [/TR]
    [TR]
    [TD]Boo, C# and JavaScript[/TD]
    [TD="align: right"]1.20%[/TD]
    [/TR]
    [/TABLE]

    So ... that trend obviously continues. We also see that Boo is going down a bit - but people using Boo with JavaScript is going up a little bit.


    So let's move almost another year into the future - today, July 18th, 2013, 763 voters:

    [TABLE="width: 500"]
    [TR]
    [TD]Boo only[/TD]
    [TD="align: right"]3.28%[/TD]
    [/TR]
    [TR]
    [TD]C# only[/TD]
    [TD="align: right"]40.10%[/TD]
    [/TR]
    [TR]
    [TD]JavaScript only[/TD]
    [TD="align: right"]27.92%[/TD]
    [/TR]
    [TR]
    [TD]Boo C#[/TD]
    [TD="align: right"]1.97%[/TD]
    [/TR]
    [TR]
    [TD]Boo JavaScript[/TD]
    [TD="align: right"] 0.52%[/TD]
    [/TR]
    [TR]
    [TD]JavaScript C#[/TD]
    [TD="align: right"] 25.29%[/TD]
    [/TR]
    [TR]
    [TD]Boo, C# and JavaScript[/TD]
    [TD="align: right"]0.92%[/TD]
    [/TR]
    [/TABLE]

    So ... C# is now used significantly more than JavaScript and the trend is that the difference will become more significant over time ... Boo has stalled around 3.28%




    You have to keep in mind: Only people participating in the forum will participate in the poll - and of those, only the people who are actually aware of this poll will participate. So, I wouldn't call these results totally reliable. But I guess it's random enough that there is some reliability. Besides, 763 voters isn't bad.
     
    Last edited: Jul 18, 2013
  33. jackyallstar

    jackyallstar

    Joined:
    Sep 4, 2013
    Posts:
    2
    this poll is wrong on one thing!

    please STOP CALLING UnityScript Javascript!!!!!!

    people are confused and google searches get cluttered with actual javascript references!!!

    both javascript and unityscript are based on ECMA script but there's where the simulairities stop or we should be calling all ecma script languages javascript, which we should not for obvious reasons. i know even the unity employees like to call it js, but this is totally wrong since unityscript follows unity's will, and javascript totally doesnt!

    get this sorted for crying out loud!
     
  34. MarkrosoftGames

    MarkrosoftGames

    Joined:
    Jan 5, 2012
    Posts:
    442
    i've been a fan of boo since the start, and i think ive only used unityscript in a tutorial or two. i like using boo if im working on a project by myself, but when working with a team of people c# seems to be the standard, and ive been thinking of switching to it all together. the problem with boo, and this may relate to unity scrip vs javascript as well, is that it is similar to python in many ways, but yet its awkwardly different enough that i never quite remember what python things i can do, and which things are boo only.
     
  35. Kryger

    Kryger

    Joined:
    Oct 3, 2012
    Posts:
    169
    I think multi-lingualism is a testament to the elegance of Unity design. Otherwise it would be a horrible burden to maintain. (Yeah, I'm a C# guy myself. )
     
    Last edited: Sep 5, 2013
  36. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    For pure curiosity's sake (and nerd-ness) I'd also like to know how languages are divided between various ranges of expertise (which would be a good thing to know also for Asset Store devs). It's generally considered that inexperienced users mostly prefer UnityScript, while pros go for C#, but I also know some pros (just a couple though) that prefer UnityScript instead.
     
  37. dxcam1

    dxcam1

    Joined:
    Feb 6, 2012
    Posts:
    477
    And Boo is for the weird nerds.
     
  38. MarkrosoftGames

    MarkrosoftGames

    Joined:
    Jan 5, 2012
    Posts:
    442
    we usually get called hipsters too lol
     
  39. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    I thought hipsters were the fashion/counter-fashion nerds, not the weird ones :D
     
  40. stormystudio

    stormystudio

    Joined:
    Jul 13, 2012
    Posts:
    21
    Where are you coming from?

    I'm a professional 2D and 3D animator by day and have steered away from learning a programming language for years.

    In my own time I've been using GameSalad for nearly 4 years to produce 5 games/apps. Yes, the simplified cousin of most GameSDKS with no programming required but the same thought process of what is required to design a game, how to use functions (behaviours), variables (attributes) , loops, tables, math and good labelling. It has made for a well paid hobby at time but not much else, and hasn't taught me how to code.

    At some point I realised I'm addicted to the problem solving process of using maths and rules to make a new game mechanic, and I enjoy this as much as making good animation, if not more.

    With a new game prototype up and running after 3 months planning and design I decided I wanted to create it in Unity and have access to... well... everything…

    Which Language are you working with in Unity?

    I've spent the past 2.5 weeks watching and reading a wealth of JavaScript (UnityScript) tutorials, going with US as it seemed to be the one pushed in most beginner tutorials.

    I've now managed to produce my first couple of scripts and I'm settling into the process of attempting to write some code, hit a dead end or big wall of confusion, search the script reference or forum, learn from and adapt a bit of code and move on… so far I'm loving it.

    The syntax for US is falling into place which is great. So for the moment I'm going to stick with Javascript US, once I'm comfortable in that and unity as a whole I plan to try and move over to C#.

    What do you find annoying?

    ';'

    Also that sometimes the script error message will say it's expecting a ')' on line 12… where as in fact it would be that I'd missed one on line 9.

    Lastly the fact that I've started down the road using Javascript (Unity Script) and not C#. I know lots of tutorials show code in all 3 languages, but the first 3 looonnng videos I watched on day 1 were in Javascript and claimed it was the most widely used language.

    Out of interest is Boo now compatible with Unity iPhone? … some earlier comments on this thread say otherwise but they're rather old now.
     
    Last edited: Nov 15, 2013
  41. Benproductions1

    Benproductions1

    Joined:
    May 11, 2011
    Posts:
    63
    Just as a side note (I've only just come here and haven't read the rest of the thread, so ignore this if it's a duplicate), but Unity technically doesn't support Javascript. The language referred to by the documentation as Javascript is actually called UnityScript (even by Unity internally), usually people mix and match the two but I think there should be a clear distinction between the two. UnityScript is most definitely not Javascript.
     
  42. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I agree … I actually usually call it UnityScript as well … probably the reason I called it JavaScript in the poll was to make it easier to find for people who don't know better ;-)

    I believe UT officially calls it JavaScript, though. Which, given that JavaScript was just called because at that time, Java was kind of cool, is kind of fair IMHO (JavaScript has much less to do with Java than UnityScript has to do with C#) ;-)
     
  43. Benproductions1

    Benproductions1

    Joined:
    May 11, 2011
    Posts:
    63
    Probably officially, but definitely not internally. Just search for UnityScript.dll in the install directory. One of those contains the translation code to boo... ;)
     
  44. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Well we all know that Unity has a history with names. UnityScript is called JavaScript (or viceversa), but also Unity is NOT Unity3D, but the website says the contrary, and if you search for questions concerning Unity minus the "3D" you definitely won't get the right answers :D
     
  45. Shadowys

    Shadowys

    Joined:
    Aug 19, 2013
    Posts:
    5
    Lol
    I normally use Boo in my projects as the clean syntax and general language features (clever for loops and hashtable literals anyone?) make development a breeze. Sometimes I'll have to write code in C# and really do miss plenty of nifty and clever features from the compiler, such as the deduction of types.

    Sometimes I just like pressing enter to enter a new line of code, instead of reaching for that semicolon then enter :p

    Sometimes I just like translating the examples into Boo with shorter and cleaner code. :p

    Sometimes I just want to do this:
    Code (csharp):
    1.  
    2. state={}
    3. state["motion"]="up"
    4. if state["motion"]=="up": print("I'm up!!!")
    5.  
    Imagine translating that to C# lol.

    As for JS, I'm sorry, but the lack of proper support of classes and dicts (the heck? they are the same? lol :p ) and this:
    Code (csharp):
    1.  
    2. a=[1,2];
    3. b=[1,2];
    4. alert(a==b) //will give false..................... sigh
    5.  
    just turns me off.

    I'm perhaps biased since I come from a Python and D (too bad this is still a new language) background though. :p
     
  46. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    Code (csharp):
    1.  
    2. var state = new Dictionary<string, string>();
    3. state["motion"] = "up";
    4. if (state["motion"] == "up") print("I'm up!!!");
    5.  
    ?
     
  47. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    The converse of that is with C# it's pretty easy to AutoFormat a Document :)

    Sometimes I just like translating the examples into Boo with shorter and cleaner code. :p

    Why imagine? I'd do something along the lines of:

    Code (csharp):
    1.  
    2. var state= new Bag();
    3. state["motion"]="up";
    4. if (state["motion"]=="up") print("I'm up!!!");
    5.  
    6. //or possible with 6.0
    7. var state= new Bag{["motion"] = "up"};
    8. if (state["motion"]=="up") print("I'm up!!!");
    9.  
    10. //Or with dynamic
    11. var state = new Bag();
    12. state.motion ="up";
    13. if (state.motion =="up") print("I'm up!!!");
    14.  
    I'm not sure how these minor differences are enough to make a language choice - there are far bigger factors.
     
  48. Teo

    Teo

    Joined:
    Oct 31, 2009
    Posts:
    564
    Amazing how many peoples still use Javascript.
     
  49. minionnz

    minionnz

    Joined:
    Jan 29, 2013
    Posts:
    391
    I think it comes down to whatever people are comfortable with. Some know Javascript better than C#, so UnityScript seems the obvious choice. Then they realise that they're better off learning C# :)
     
  50. Deleted User

    Deleted User

    Guest

    Would someone like to tell me why BOO is still about? Seems like unnecessary overhead to me.