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

It's not JavaScript, it's UnityScript

Discussion in 'General Discussion' started by coderarity, Feb 3, 2012.

  1. coderarity

    coderarity

    Joined:
    Feb 3, 2012
    Posts:
    9
    Hello,

    Throughout the website, there seems to be a general usage of the term "JavaScript" to signify Unity's custom C++-like scripting language that I shall refer to as "UnityScript" henceforth. It is understandable to mistakenly use this terminology, seeing how JavaScript is the world's most misunderstood programming language. It should be noted, however, that UnityScript fails to follow in the spirit of JavaScript, with a completely different method for object orientation and a new type system. Therefore, it is only logical that the website represent these significant differences by appropriately labeling it UnityScript, as opposed to the misleading and incorrect labeling it as "JavaScript."

    This terminology can be very misleading and almost acts as a false selling point. Many JavaScript users may come to this language thinking they'll be using the same language they're accustomed to, when in fact they are using a different language. As a responsible company, it is Unity's duty to fix this misleading advertising that is consistent throughout the website. In addition, Unity should proceed to notify all of their customers of this mistake and the fixes that have been made. After all, misleading advertising is illegal, and it's the right of the customers to know that this has been fixed.

    I hope to see a response from Unity on this soon. Thanks,

    -CodeRarity
     
  2. scarpelius

    scarpelius

    Joined:
    Aug 19, 2007
    Posts:
    966
    On the other hand, C# it is really C# so use that instead :)
     
  3. Starsman Games

    Starsman Games

    Joined:
    Jan 30, 2011
    Posts:
    2,152

    DUDE! Really!?
     
    Last edited: Feb 3, 2012
  4. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286
    Actually , i agree , as even in the docs , it is referred to as js. It definately should be changed.
     
  5. doomprodigy

    doomprodigy

    Joined:
    Dec 12, 2010
    Posts:
    87
    Unityscript (As most people who post regularaly on the forum / and advanced users refer to it as) resembles to JScript.NET which is an implementation of Javascript. As "Javascript" is a word people use to cover all the different implementations of Javascript even though they all have differences between them. So I think it is ok for the Unity folk to refer to it as Javascript as Javascript is not implementation specific, So there is no illusion, sure if someone picks up a book on Javascript but it isint specific to JScript.NET and more to ECMAScript there might not learn specific things, but then they should have done research on the topic and what books to buy.

    Then again it seems like your panties are in a twist, whats up with that?

    I myself program in C# cause I find it easier :)
     
  6. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286
    Haha , yea the *legal thing is pretty funny
     
  7. Starsman Games

    Starsman Games

    Joined:
    Jan 30, 2011
    Posts:
    2,152
    +1

    You agree with a passive implication/threat for [possible] legal action [by quoting some potential illegal activity] over this?

    [Written before reading the previous post, keeping it to make clear what i was referring to in the previous post.]
     
    Last edited: Feb 3, 2012
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I agree on two points:

    1. it is kind of misleading (though not maliciously so)
    2. it is the wrong name

    But to go overboard like the op is a bit extreme since the issue is harmless and frankly, irrelevant since we can correct people. I use the term unity js or unityscript myself. Prefixing it with unity seems to work for me and stops me from curling into a foetal position and crying myself to sleep.
     
  9. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286


    Read again, maybe you dont quite understand.... No where did i quote any legal action , in fact , i even reposted laughing at it...IN FACT , i didnt quote anything until jsut now. hmm someone seems a little anal.
     
  10. Starsman Games

    Starsman Games

    Joined:
    Jan 30, 2011
    Posts:
    2,152
    It's cool, I saw your laughter a bit after I posted my post (was not t here when I started writing it and this forum does not refresh the entire page after posting.) But if you read MY post (the one I take it you replied to since you started with "actually I agree with him") I was really just highlighting his threat and attitude.

    Although I agree with Shallows. If there should be a rename it should be to JScript.NET, though, not UnityScript.

    A bit unecesary, dont you think?
     
    Last edited: Feb 3, 2012
  11. squidbot

    squidbot

    Joined:
    Jan 4, 2011
    Posts:
    128
    Since "JavaScript" isn't a standard (ECMAScript is) I don't think your legal argument holds water. JavaScript can be anything you want to call it. And since ECMAScript Harmony includes classes and static typing, I think it's fair to consider UnityScript to be JavaScript with non-standard extensions... something you see in any pretty much any language developer by a company rather than a standards organization.
     
  12. Starsman Games

    Starsman Games

    Joined:
    Jan 30, 2011
    Posts:
    2,152
    So... we call for the world to apologize for calling ECMAScript JavaScript, and get browser makers to apologize to the world for their error and rename all instances of the JavaScript usage to ECMAScript... and reminder of illegal marketing? :p
     
  13. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286
    heh , could be ...

    at any rate , its cool.
     
  14. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    That would be misleading. (For one, JScript.NET has no generics.) If you're going to rename, might as well make it an accurate rename. The only thing that's accurate is UnityScript, or some other unique name.

    --Eric
     
  15. squidbot

    squidbot

    Joined:
    Jan 4, 2011
    Posts:
    128
    More like go back in time and trottle the execs at Netscape who changed the name from LiveScript for marketing purposes (though I guess it worked, it's pretty damned ubiquitous now.)

    P.S. I agree with calling it UnityScript, and I do so myself. I just think the op's arguments don't have much of a leg to stand on.
     
  16. doomprodigy

    doomprodigy

    Joined:
    Dec 12, 2010
    Posts:
    87
    I agree with Eric, if they are going to rename all of their documentation where they have put the word "Javascript" they should use "Unityscript". As I said in my previous post Unityscript only resembles JScript.NET (It is similar but not exactly the same as JScript.NET), Unityscript is its own .NET implementation of Javascript.

    Though I stand by what it said, the term Javascript stands for all of the implementations of Javascript as that is what everyone referes to all of the different implementations of Javascript so thus UnityScript being an implementation of Javascript it can be called Javascript.

    Peace,
     
  17. Alric

    Alric

    Joined:
    Feb 17, 2009
    Posts:
    331
    I have yet to see an expert Javascript programmer come to Unity full of enthusiasm and fail at Unityscript :p
     
  18. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    I agree that it’s wrong to call it JavaScript as when people start out they may search for JavaScript tutorials and go in the completely wrong direction, I would have got stuck with this a few years ago but thankfully I searched "Unity tutorials" and came across the tornado twins.

    It doesn’t really bother me but they should rename it something original :D
     
  19. BIG-BUG

    BIG-BUG

    Joined:
    Mar 29, 2009
    Posts:
    457
    I think UnityScript is a nice name. The only thing missing is a documentation of this language...
     
  20. coderarity

    coderarity

    Joined:
    Feb 3, 2012
    Posts:
    9
    That's because most programmers don't learn JavaScript as a first language.

    No, there's no legal argument, you guys are right. I'm just pointing out that it's frowned upon to mislead people that would buy a product based on something like this. (Think about a company using Unity saying they require "JavaScript" experience).

    When most people refer to JavaScript, they refer to ECMAScript. This is important, because the reason Unity calls it JavaScript is that they want people to think that their prior experience will transfer over. However, very few people who would say they know JavaScript actually are familiar with JScript.NET.
     
  21. dogzerx2

    dogzerx2

    Joined:
    Dec 27, 2009
    Posts:
    3,964
    I'm going to keep calling it javascript...

    :p
     
  22. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    maby unity should also state that you must know how to use a mouse and keyboard, oh and know how to open a exe.
     
  23. actuallystarky

    actuallystarky

    Joined:
    Jul 12, 2010
    Posts:
    188
    I agree that they should drop the "javascript" label. Now that Unity has a lot more brand recognition "UnityScript" should be a term they can proudly promote.

    But I still think they should just drop this ridiculous three language support and just go with C#. Either that or add some custom functionality to UnityScript (like Unrealscript's awesome language-supported state machines) that makes it worth having. Either way, supporting only 1 language cuts your documentation work by two thirds.
     
  24. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286
    But .. most of the docs are in unityscript... I am not sure , but i dont believe that all the examples , reference articles have c# examples, but they do all consist of UnityScript examples. I really cant see UnityScript ever being cut from Unity, but who knows.
     
  25. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    I think keep UnityScript as its much easer for people just starting to learn and C# becase its better... but get rid of Boo no one uses it.
     
  26. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    That would be really obnoxious.

    It's already worth having by not being as annoying as C#.

    Hardly; they have an automated tool which converts Unityscript code to C# and Boo. (Not always 100% successfully.) Most of the work is explaining how stuff works anyway, which is the same in all languages.

    --Eric
     
  27. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286
    lol
     
  28. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Sounds like you never went further than C# 2.0 if you put up such a claim as the only thing where C# is not ahead is handling of struct properties where unityscript fake pretends what its doing by claiming that transform.position.x = xxx; can be done at no price
    For everything else C# 3.0 and 3.5 and the partial 4.0 thats present are lightyears ahead of unityscript.

    Already the variable datatype, anonymous closures and objects, linq, real generics and delegates, event handlers and last but not least default values in functions make it more than worth it and that the variable declarations are 'chained up from the horses ass' making it readable (compared to unityscript developers missassumption that cryptic names to stay short is acceptable) are enough ...

    if we add on top of it that C# has professional IDEs while UnityScript primarily has kids toys and 'dumb text editors' usable for small codes just nails the coffin (MD is a 'focused kids toy' but compared to VS 2008 / 2010 + resharper / visual x and similar addons with true and smart intellisense its really like trying to create a space shuttle with stone and wood ... anyone missing unitron really never got what true IDEs are about and what productive coding means. Blind guessing, typing the whole stuff yourself and remembering every single function offered by the Unity API are good signs that you work with a 'stone and wood' text editor and might prefer visual coding as thats likely at least as productive as the text editor you use at the time. Or you simply have way to many hours to blindly waste during your day)

    And as hard as it sounds: The bugs in UnityScript don't make it better. We all know that your very own Asset Store sold systems had more than one bug in them yet worked just cause unityscript was even more bugged. Examples of that were accesses to private variables in other classes which you had to fix when 3.4 came around as vectrosity simply failed, so please keep such thing on your plate too when calling C# as annoying. Especially when we have to bear with the annoying UnityScript users that whine whenever UT finally fixes one of the many bugs in UnityScript which breaks their incorrect scripts that relied on UnityScript being broken.
    Correct and strict always is superior to good guessing that might work as desired or simply F*** it up, this is coding after all, meant to be translated to the only 100% strict language aka machine code.
    This is not the text for a history presentation or lyrics for some backstreet rap where syntactical correctness is nice to have but no requirement ;)
     
    Last edited: Feb 4, 2012
  29. actuallystarky

    actuallystarky

    Joined:
    Jul 12, 2010
    Posts:
    188
    @Eric5h5

    To be honest, I'm not really fussed. It hasn't seemed to slow them down so far. Just seems to cause needless confusion and threads like this.

    I'm not sure what's so "obnoxious" about c#. It's a little more verbose when it comes to modifying Vectors and Colors but offers so much more when it comes to features and actual language documentation. It has an excellent event system built right into the language. How good is that? But each to their own I guess. Good games are good games in any language.
     
  30. coderarity

    coderarity

    Joined:
    Feb 3, 2012
    Posts:
    9
  31. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    Eric5h5 + dreamora = POP-CORN TIME!
     
  32. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Give it a rest, dreamora. ;) I know what I'm talking about, my current project is 50% C# and 50% Unityscript; after I've been programming US for a while, C# can be really irritating to me. You don't program in US so you don't realize the actual differences.

    There's a lot more to it than that, and the feature delta is smaller than you think, but I've been over it enough times by now. C# nazis need to realize that it's mostly a matter of opinion. ;) There are certainly things about US that are annoying, too, but overall it doesn't bug me half as much as C# can. US is custom-made for Unity and it shows.

    --Eric
     
  33. paulygons

    paulygons

    Joined:
    May 6, 2010
    Posts:
    164
    I love you guys.
     
  34. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    I dont understand why there arnt lists in UnityScript, thats the only thing i hate about it :(
     
  35. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    There are?
     
  36. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    i though that its like:

    Code (csharp):
    1.  
    2. //C#
    3. list = new List<GameObject>();
    4. //also has arrays like this:
    5. arr = new Array ();
    6. arr = Float[];
    7.  
    and javascript only has the last to?

    How do you do a list in java script? it would be helpfull for my game.
     
    Last edited: Feb 4, 2012
  37. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The same as C#, but with an extra (annoying ;) ) dot.

    Code (csharp):
    1. list = new List.<GameObject>();
    You don't use Array. Ever. Never ever. It was only there in Unity originally to make Unityscript more like Javascript, and List didn't exist (I don't think even in Unity's C# at the time, only ArrayList), but since we've established that Unityscript isn't much like Javascript at all, and since you can use List, and since Array is evil, it should be destroyed, because Unityscript is not Javascript. See? That's how you get stuff back on topic. :)

    --Eric
     
  38. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    Oh my gosh, i cant belive that lists exist in Unityscript now ive got to remake my scripts :(

    Edit: never mind i made my game without them becase i dident know they existed
     
    Last edited: Feb 4, 2012
  39. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    My customers happen to use both so I work with both automatically too as I provide the solution in the language they want. I also have ported more than one 3rd party system from UnityScript to C# to have a consistent codebase.

    I'm just none of those supporting any UnityScript user questions nor promoting it as good for beginners with U3 anymore (was fine as 'beginner language' in Unity 2 due to the C# 2.0 limitations and UTs ignorance towards C# documentation requireing you to work with VS or MD to get the correct out / ref pamaremeters from intellisense) as C# 3.0 and 3.5 have cleared most of the 'problems' for which UnityScript used to be a solution / justification. Nor am I trying to force anything onto the UnityScript side, as its simply far more limited (as even your knowledge shows, or did I miss something, not even you can solve trivial generic function and event handler situations in US which are no brainers in C#? US is getting bloated with new 'look alike' features from C# whenever it gets expanded isntead of focusing on its traits, trying to attract 'real programmers' for whatever reason - and to make it worse their barely never updated examples are only in UnityScript too) without offering me any productivity gain at all when I've VS 2008 Pro + Resharper 6 on the other side. That MD is starting to support UnityScript is definitely a step forward but in the quality its right now ... well you know what I want to say here, you work and suffer from it likely more than most others here

    Lets face it. if a language were to be dropped it would be UnityScript, as its named incorrectly (on purpose), its lacking stuff that one would expect on ECMA languages, its bloated with C# stolen features implemented incorrectly, incomplete or .NET incompatible and all in all its just a layer on top of Boo with less capabilities than boo and with less userfriendlyness and funny enough with even less language documentation than Boo
    Its beyond me why US is that favored beside luring ActionScript and Web programmers into believing 'its the language they know' when both alternatives to it in unity are stronger.
     
    Last edited: Feb 4, 2012
  40. doomprodigy

    doomprodigy

    Joined:
    Dec 12, 2010
    Posts:
    87
    Good God, dreamora, you are amazing. I completely agree with you.

    Returning to the Topic, if the Unity folk do post here it would be nice to see their opinion on the matter. But I still think they should rename it all to Unityscript showing to the new people that it is their own implementation of a .NET Javascript and not so misleading as it is currently.

    Then again no legal action could be taken based upon lame "False Advertisement" charge as I said previously Javascript stands for all implementations of it's language. So Unity can get away with calling it Javascript even though misleading. So it is really there choice on whoever is in charge of their engine advertising and documentation. Cause calling it Javascript will entice all "Javascript implementation" programmers thus more people with Javascript background picking up Unity. Then again those people should be able to get accustom to Unitys implementation of it.

    It is only misleading to beginners which Unity seems to attract like bugs to lightbulbs. (Horrible Simile)

    That sorta sums up the topic.

    Peace,
     
  41. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    I think if unity stopped supporting Unity script sales of Basic licenses would drop, also its already there so why take it away its not like you have to use it.
     
  42. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286
    Meh, maybe, but its not that hard to adapt to c#... but more so , as i said previously, i seriously doubt Unity will drop it all together, unless for some reason it prooves to have some major flaw which cant be worked out.

    Im in no position to even pretend understanding the complete under the hood workings of UT's UnityScript, but IMO they have done an upstanding job in production, and again, i find it very unlikely that they would just toss it all away.

    One more thing, somewhere in here someone made mention to throw out boo, cause no one uses it. Not true, theres a few souls out there that bravely admit using it. Not i , but i know its true. Myself, when i think of boo, i think of my little hamster ... wait that party got wiped by Sarevok.
     
  43. taumel

    taumel

    Joined:
    Jun 9, 2005
    Posts:
    5,292
    a) Both, Unityscript and C# suck due to various reasons, that's where languages like Ruby are great.

    b) Who says that you can't write cool games with little code in toy box like tools?

    c) Renaming Javascript to Unityscript to early would have taken away a marketing effect of Unity.
     
    Last edited: Feb 4, 2012
  44. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    No one would say that, but having the right tools can certainly help.
     
  45. coderarity

    coderarity

    Joined:
    Feb 3, 2012
    Posts:
    9
    That's the point. The entire reason Unity marketed it as JavaScript is so that people would think their experience transfers over. Since the entire reason this appeals to people is that so many people know ECMAScript-styled JavaScript, it's misleading to market it as JavaScript. It's essentially getting them traffic for reasons that aren't really valid, which is why it seems dishonestly misleading to me.

    This is an especially realistic scenario since Unity3D has a web player, and far more relevant now because of the Flash player export. (I might also note that Adobe Flash doesn't refer to ActionScript as JavaScript because of vague connections)
     
  46. coderarity

    coderarity

    Joined:
    Feb 3, 2012
    Posts:
    9
    Preventing that is a good enough reason to only support 1 language. (not necessarily C#)
     
  47. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Ideally, but so far there isn't a single language that would be ideal. Definitely not C#, and not Unityscript as it currently stands either. Or Boo. In any case, there aren't any functionality issues with using two languages, and they're used for two separate areas of code (it's kind of like two projects in one), so it's not really a problem.

    --Eric
     
  48. dogzerx2

    dogzerx2

    Joined:
    Dec 27, 2009
    Posts:
    3,964
    I don't understand, if it's not javascript, why is it called that way inside unity?
     
  49. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286
    Probably because its so simliar that no one that knows how to program it, would come along and *not* be able to use it. But its well known that its not true javascript. Thus the topic at hand.

    On that note, i havent met to many programmers with experience , that couldnt open up most languages , and adapt.
     
  50. paulygons

    paulygons

    Joined:
    May 6, 2010
    Posts:
    164
    People keep saying things like "its not that hard to adapt to c#". I came from using Macromedia's Lingo, and I can honestly say had it not been for the "baby step" of learning US, the time it took me to become productive using C# would have at least been doubled, or even defeated me completely. Compared to C#, US was easy. It was so similar to Lingo that I could read it the moment I started using Unity. Once I figured out how to use #pragma strict in US, suddenly C# became understandable (if not writable) for me. Setting the marketing strategies aside, the path to learning C# required US for me to even get started. I've got a LONG way to go before I'm comfortable writing C# the way I am with US, but at least now I can read it, and more importantly use it, as long as I don't have to start from nothing.

    And I just realized I probably derailed from the topic heading even more. Sorry!