Search Unity

Will Javascript become deprecated?

Discussion in 'Scripting' started by Snackies, Jun 11, 2016.

  1. Snackies

    Snackies

    Joined:
    May 15, 2016
    Posts:
    3
    This is just out of wonder, because I saw in a answers post from a reputable guy that Javascript will become deprecated, and JS is the language I use and it's kinda making me paranoid?
    Will it become deprecated???
     
  2. JasonBricco

    JasonBricco

    Joined:
    Jul 15, 2013
    Posts:
    918
    I feel like they want to deprecate it. There's been rumors about it. I'm not sure if there's been any official statements on the matter or not, but it does seem like things are slowly heading in that direction.

    I suggest learning C#. I'd rather Unity focuses on one language and does it well, rather than spreading itself thin between multiple.
     
  3. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    4,606
    Unity has joined the .net team (or whatever they call it) so it's possible, however, unlike the last one they got rid of (boo), JS and C# are both really popular. So while it could happen, I wouldn't expect it to.

    The nice thing is, I don't find that c# is that hard to learn, especially since you know javascript already. For myself, I can look at javascript and tell you what is happening and could probably convert my c# to it if I really wanted to. So I don't think you'll have trouble if you have to switch.
     
  4. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,470
    dont know what unitys plans are, but once you know one langauge it is pretty easy to jump to others. Most of the time spent learning, is learning to program and not learning a language's syntax.
     
  5. Snackies

    Snackies

    Joined:
    May 15, 2016
    Posts:
    3
    ....
    hhhhh
    That's a bit of a shame. Why would they want to deprecate it?
    Honestly, I really hope they don't. I can learn C#, but i've put alot of effort in my game so far and I don't want most of it to go to waste in downtime.
     
  6. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,470
    if they get rid of it, im sure it will be in stages, if you look at what happened with boo, they simply got rid of the UI options for creating boo scripts, and stopped providing documentation for it. But legacy projects that contain boo will still compile and work.
     
  7. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    2,960
    That's what deprecation means - not supported for new code. C# is used by the majority now, and it has features lacking in UnityScript. Now is the time to learn it, before you get left behind.
     
    Kiwasi likes this.
  8. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,125
    The thing is, Unity's "JavaScript" (UnityScript) only exists in Unity. It's got nothing to do with actual JavaScript. This means that in addition to maintaining the engine, Unity has to maintain a programming language. When they finally update the runtime to support modern C# features, they'll have to:
    - spend a ton of time and resources upgrading UnityScript to support the new features or
    - let UnityScript exist, but without support for those new features or
    - deprecate UnityScript.

    They cut Boo because almost nobody was using it (except us!). UnityScript has a bunch more users, probably because it used to be the "default" language of Unity, but since Unity's switched to C# for their main examples and documentation, I'm expecting the number of users to steadily drop. I guess that once the numbers drop low enough, they'll kill it off.
     
    Kiwasi and Ryiah like this.
  9. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    14,297
    They didn't eliminate it entirely though. You can still create scripts for it (by importing blank .boo files) and UnityScript is actually written in it. Complete removal of one of them would practically guarantee the removal of the other at this point.

    That said I feel like they'll just allow it to function the same as Boo and provide zero support. If they provide any now.
     
    Last edited: Jun 11, 2016
  10. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,451
    Am I the only one that feels UnityScript has already been deprecated? Just nobody has bothered to write a blog post about it.

    As evidence
    • None of the new features have UnityScript examples
    • None of the learn material is in UnityScript
    • UnityScript gets zero mention in Unite
    • There is no documentation for the language
    These are all signs of a deprecated feature. It's just no one has told UnityScript yet.

    It's also worth noting that the actual "You can't use UnityScript anymore" moment is still a a while away. Features don't get officially removed unless there is a business reason to do so. My bet is that won't come till the .NET profile upgrade.
     
    JasonBricco and Ryiah like this.
  11. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    14,297
    No. You're not the only one who feels that way. There just aren't any official statements to back up that feeling.
     
  12. chrisk8er

    chrisk8er

    Joined:
    Oct 17, 2015
    Posts:
    2
    sadly, you're not the only one... i used C# before, then i switch to javascript until i learn node.js. i think Javascript is powerful with a tons of library out there.
     
    Last edited: Sep 23, 2016
  13. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    14,297
    How many of them work out of the box with Unity's implementation though?
     
    Kiwasi likes this.
  14. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,451
    Exactly zero. Remember we are talking about UnityScript, Not JavaScript.
     
    Ryiah likes this.
  15. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,036
    The idea of Unity deprecating Javascript terrifies me.

    I've been working on my game for six years and most of it is in Javascript/Unityscript. I can;t even imagine what this would mean. At the very least if they forced us to use c# the engine could still at least run old UnityScript, otherwise we would have to rewrite hundreds of files, and that wouldnt be possible with my manpower.

    Unity began as a very democratic piece of software - open and user friendly - and it was easy for web designers like me to migrate to it from Flash because we knew Javascript. Its like the door.

    I saw the same thing happen to flash (and wrote a popular blog post about it a few years before its decline) - Flash moved from a looser but more accessible Actionscript 2 to the more programmer oriented Actionscript 3. Better performance but it was too complex for many artists and we abandoned it.

    Please keep UnityScript in unity.
     
  16. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    6,616
    I don't necessarily see them obsoleting it.

    Note, deprecating and obsoleting are 2 different things.

    Deprecated means the functionality still exists, but it is no longer maintained, and is kept for historical purposes (existing code that uses it). Which means any errors/bugs with it will never be fixed. It is advised to not be used as it may be obsoleted at some point, if/when the developers port existing code dependent on the feature that is deprecated.

    Where as obsolete means it is no longer in use, should never be used, and may be removed all together at some point. This phase is intended to allow 3rd party users of the API to port their code as it means that 1st party has already ported all their existing code away from it.

    So basically things go through the phases of: common use -> deprecated -> obsolete -> removed

    I doubt that Unityscript will be removed ever as long as some sort of mono/IL compiler is utilized by Unity. Sure new features may not be added to the language, bugs may not be fixed, but it won't be nixed completely. I mean heck... technically speaking... boo is still supported in Unity if you happen to have scripts laying around.
     
  17. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,451
    I wouldn't panic yet. Nothing official has been announced.

    Even after the actual deprecation you'll still be able to use older versions of Unity that support UnityScript for a long time.

    Finally some clever entrepreneur will put up a compiler on the asset store that will convert UnityScript to IL. Unity is always going to support IL, so as long as you can get into IL you will be fine.

    So I wouldn't panic about changing things over for an existing project. I would advise going to C# for new projects.
     
    TaleOf4Gamers and protopop like this.
  18. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,036
    Ill try to keep chill:) Thank you. Although ive had problems using older versions of unity because they can't target some IOS devices and I cant use newer packages in them. Im still on Unity 5.2 because of some performance issues in newer versions on IOS and although its performance is rock solid, im running into those issues because im using it, so there is a shelf life for how far back Mobile developers can reasonably go.
     
  19. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,036
    That sounds abit better. I just think keeping both allows people like me easy access to a powerful piece of 3d software and people coming in from native webgl.
     
  20. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    14,297
    Is there really that much of a difference between C# and UnityScript that someone is able to pick up the latter when they can't pick up the former? I've had to assist with some minor scripts before and frankly the differences always felt very minor.
     
    lordofduct, TaleOf4Gamers and Kiwasi like this.
  21. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    789
    They are ridiculously similar its not even funny.
    I would say it takes about 5-10 minutes to translate a script. There is hardly anything new to learn all concepts are the same. Its like when I see people comparing VB.net and C# there are both .net so why the hell does it matter if you have to switch. Most of the code is the same.

    I will just leave this here:

    *Grabs Popcorn*
     
  22. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    789
    I wholeheartedly agree. My tutor was basically calling some student pussies as they went home because they had a "headache". The same applies here. There is nothing wrong but people still cower away.
     
  23. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    4,606
    There really aren't. Most of these languages are very similar these days and you can generally get a good idea of how they work.

    Plus, the amount of examples on the web for unity in c# is fairly extensive, so most people, even non programmers, should be able to pick up the general idea fairly easy. The Unity forum is generally pretty supportive as well.

    Keeping both is a nice idea, but at some point, you have to make decisions as a company that may change things, but hopefully will allow for improvements. Like dropping boo, discontinuing 32 bit, etc. While there is no decision on UnityScript right now, most of the guesses are theories that it may end up that way. C# has a pretty decent backing from Microsoft (VS 2017 includes installing for Unity as an option now) which I think is also a big help.

    As was mentioned, nothing wrong with keeping your old projects as is, just don't hesitate to start looking into c# so IF you have to switch you aren't caught completely off guard.
     
    Ryiah, protopop and Kiwasi like this.
  24. Dameon_

    Dameon_

    Joined:
    Apr 11, 2014
    Posts:
    505
    Just make the switch. C# has too many advantages over UnityScript to pass up. Even if you ignore the features you gain, you learn a language that you can use to make desktop applications, or even interactive webpages (via ASP). There are walls you will hit in UnityScript that do not exist in C#.
     
    Kiwasi likes this.
  25. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,354
    Also C# isn't harder (and frankly in unity context) not much different to unity script (js).

    It's just ignorance and fear preventing the switch. I know because I've released a couple of games in js and made the switch myself. C# *will* result in most people having less bugs because it's a little more obvious what is going on when you're reading the code.

    Plus I'm sure people mentioned that there's an entire internet worth of C# code and documentation available, of which there's very little for unity script (it's not javascript as you know it).
     
    Kiwasi likes this.
  26. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,036
    You guys are really harsh.

    "Cower"? "Pussies"? I"gnorance and fear"? This is how i imagine many coders see non coders, and i am am very upset to hear this said out loud.

    I don't make people feel bad because they cannot draw.

    I thought Unity was progressive and open minded to everyone, that that was their base philosophy.

    I have spent more than 10 years as a web designer learning Javascript and Javascript is the main reason I did not go to Unreal and Crytek.

    Asking everyone who is concerned about this to "just learn c#" is not very helpful or empathetic to the real concerns we have.

    I didn't expect this kind of behavior in the Unity forums.
     
  27. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,125
    You're right in that there's no reason to be mean. Don't imply that people are weak idiots because they dissagree with you, people! This is a forum, not US politics.

    That being said,

    UnityScript is nothing like Javascript. All the ways US is similar to Javascript in is ways that C# is also similar to Javascript. The only (real) differences between C# and US is how they handle coroutines, a thing that doesn't exist in Javascript.

    JS is a prototype-based, duck typed language about manipulating the DOM. UnityScript does exactly zero of those things. the only way UnityScript is similar to JavaScript is that they start the function declaration with "function".

    The point I'm making is that it's just as easy/hard for somebody that's written Javascript to learn C# as it is for the same person to learn UnityScript.
     
    hippocoder, Kiwasi and AndyGainey like this.
  28. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    4,606
    People were trying to give valid reasons on why learning c# is a better choice than unityscript.

    None of us work for Unity, so we are just guessing at what will happen or may happen and trying to help those not familiar with c# get a better idea of how easy it really is to learn.

    I can't draw myself and I know it. But if I was planning to do something with drawing, I'd see what the best options are for me and probably ask for advice from the artist at my work and take it! (seriously, even my stick figures are crooked)

    But as has been mentioned serveral times...Javascript is not UnityScript. What would be lost is UnityScript if Unity decided to go that route.
     
    Ryiah likes this.
  29. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,354
    It is ignorance and fear because they're virtually identical in unity context. For the most part people use the language for engine calls. Basically, unityscript is actually a mistake, that should not have been in Unity. It is little more than a marketing gimmick.

    And it was my own ignorance and fear of change that enabled me to make two impossible to maintain games in unityscript vs my current reusable C# codebase.

    This is harsh because you say it's harsh. There we agree to disagree.

    In a glorious future, I would rather see non-engine specific languages supported. Things like swift, or whatever hot-pluggable language...
     
    Kiwasi likes this.
  30. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,036
    I agree with you about the hot-swappable languages. A universal translator would be nice.

    There is little support here for continuing UnityScript which was exactly my concern. The answer i am being told is to switch to C#.

    Everyone's brains work differently. For me UnityScript has more accessible syntax, even if it is seen by many as inferior. Actionscript 3 was technically superior from a coders point of view, but it left many designers cold.

    Can i learn C#? Yes. I already use it in few cases where i couldn't find a UnityScript example. But it would not be an insignificant challenge to learn a new language and rewrite all our js files.
    As Brathnan says none of us work for Unity so I don't know what they are planning. But if they do deprecate or remove UnityScript I hope they will have a better plan for those of us who use it than just telling us to switch.
     
  31. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,354
    Well I did come to unity from actionscript 3. I'd been freelancing as a flash developer for a bit so there's that. I did know C++ but I felt C# was too much like that and I don't particularly enjoy C++. I'm thankful to say that I was completely wrong and once I simply moved the declaration to before instead of after, I found them to be the same.
     
    lordofduct likes this.
  32. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,451
    While none of us work for Unity, the path they are on is pretty clear. The best case scenario for UnityScript is as follows:
    • UnityScript continues for several more years in its current unsupported, but still an official language state.
    • Due to pressure from a dwindling fan base Unity officially deprecates UnityScript. It does this by pulling it from menus and docs, but the language remains usable for several more years.
    The worst case is something like this
    • Unity makes some change to the scripting backend that fundamentally breaks UnityScript.
    • Unity makes the commercial desicion not to spend money to fix UnityScript.
    • UnityScript becomes deprecated and obselete in a single version release.
    The first scenario is far more likely. I doubt the the second scenario will happen.

    What's not going to happen is this:
    • Unity decides that UnityScript is important again.
    • Unity puts UnityScript back into full support. Tutorial updates, document updates and the like.
    • Unity pulls support for C#, pushing everyone into UnityScript.
     
    protopop and Ryiah like this.
  33. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    14,297
    Except anyone willing to take the time to learn can draw. They won't be the next Rembrandt but they will still be able to draw.

    You've likely answered this in another thread but I don't remember seeing it mentioned. Have you actually tried to learn C# or did you jump straight into UnityScript due to past experience and/or recommendations?

    We have a universal language that the scripting languages are compiled into. You just don't write code with it. :p

    https://en.wikipedia.org/wiki/Common_Intermediate_Language

    Nothing prevents someone from writing an extension to bring additional languages to Unity. It's just not worth the effort because C# is generally that easy to pick up (if it wasn't those we have in Getting Started wouldn't be able to use Unity).

    We do have people on these forums that weren't able to pick it up but they usually weren't able to pick up UnityScript either.
     
    Last edited: Dec 7, 2016
    Kiwasi likes this.
  34. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    6,616
    Wooooh, AS3!

    Same here, did a lot of AS3 before coming to Unity.
     
  35. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,036
    That's a great roadmap - thank you - I think you're right.

    The possibility of UnityScrit going away never occured to be before yesterday.

    I know it's speculation but I should start preparing now. Your analysis gives me hope of a reasonable timeline to plan for this one way or another.
     
  36. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,451
    protopop and Ryiah like this.
  37. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,036
    that's a very interesting link. thank you.

    the part about old boo files still working backs up what you and lordofduct said about deprecation vs obseletion, that would be good at least if ols JS worked, and could give us time to write just newer scripts in c# (and more time to rewrite old ones)

    Also their mention of their JS to C# made me google the same and there's some auto convert scripts out there.

    I still prefer JS and think Unity should keep it, but its comfort to know that there's some options if this comes to pass.
     
    Kiwasi likes this.
  38. damonkeane2006

    damonkeane2006

    Joined:
    Jul 24, 2017
    Posts:
    1
    I have the beta version 2017.2.0b8 and you can't create javascript there.
    But you can import a javascript manually.
     
  39. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,451