hi I’m a newbie and I just want to know when using unity what knowledge would I likely used? Java or JavaScript?
Javascript if you’re planning to use UnityScript (that is almost Javascript) and Java if you’re planning to use C# (that is very similar)
In which case though… don’t bother learning Java before coming to Unity if you plan to use C#. Just learn C#.
I’m no expert but I would say learn C# or UnityScript (sometimes referred to as ‘JavaScript for Unity’). But if you choose UnityScript, I’d say use tutorials that are for Unity, because if you start going through “JavaScript” tutorials on other, non-Unity related sites, you may find yourself learning about JavaScript for totally unrelated things, like web design. I’ve never touched JavaScript outside of Unity before, but apparently it’s a bit different from what is used in Unity.
If you’re now thinking “what is the best one to learn?”, before asking it, perhaps have a read on the following simular thread. Read at least the entire first page though. Short answer is that it doesn’t really matter at this stage;
What is the best FPS language?" thread
That thread starts off with a bit of an odd question, but changes into a discussion about what is the best language to use in Unity in general.
Future tutorials on that unity study site will be in C# so that might be worth the wait.
what?
Oh so I should pick C# right?
what? cant get your point.
You are fine with Javascript too. Or BOO. You don`t win or loose anything of Unity with one of the languages, featureswise. All three languages runs in the same speed, uses the same words, and works just fine with Unity.
I would suggest to do a forum search. This topic is discussed to death. With always the same result: it`s a thing of personal preference. And where you come from. The different languages are made so that somebody with a Javascript background or a C# background or a Python background can pick up Unity immediately without the need to relearn a new language.
Unitys Javascript is a bit easier to learn than the other two languages, and is a bit more forgivable. That
s the biggest difference.
Java and Javascript are two completely different languages. That`s the point.Java points more towards C++ or other strong programming languages. And Javascript gets usually used for web development needs.
Learning C# would be your best bet for Unity.
I just love your clear explanation for your reasons
I was saying that if you wanted to learn C#, don’t start with Java, just go with C#.
But if you wanted to use unityscript, it’s based on javascript, so start there.
Tiles conveniently forgets that you can lose out on a ton of features by choosing US over C# - by carefully choosing his words to refer to the unity API alone [one small aspect of programming IMO].
Same words?
That’s just plain false.
It’s also far less featured, far less supported outside of unity, and lacks the vast quantities of resources that C# has.
It may be a personal preference - but that doesn’t mean one should ignore the very real differences between the two languages.
Saying it’s “far less featured” is not true either. How about we not descend into Language Pissing Match #2,573, K? Thanks.
–Eric
I’m happy to have a C# vs US language feature show down, but unless I’m suddenly shown a dozen or so US features that I didn’t know existed [thanks to non-existent documentation] it’ll be short and brutal.
ummm
unityscript is certainly a far less featured language than C#
It’s not to say unityscript is crap or anything. It just lacks certain features.
unityscript is based on javascript and it lacks many of the following:
delegates
events
method overloading
structs (technically)
strict anonymous functions
full strict typeing in general (is kind of there in unityscript, but with a few oddities)
note though, C# lacks dynamic typing… as well as the eval(…) funciton (which is very nice)
I personally prefer C#, but that’s only because I come from a .Net background. I write C# and VB for work, as well as a few other languages (C++, BASIC, PHP, python, lisp, etc), none of which are javascript. So unityscript is the odd one out for me.
Has those.
Indeed not.
Of course it has that (but not named parameters).
It has those, technically. They are real structs exactly like C# even if it doesn’t use the “struct” keyword.
It has anonymous functions; not sure what you mean by “strict”.
Certainly has that.
So…1/6. Better luck next time.
Doesn’t work on iOS though. However there a number of other things that Unityscript has that are nice to use which C# lacks, but again, it’s kind of pointless getting into it. One thing that’s true is that US still doesn’t have official documentation, which is a drawback, and contributes to the myth that it has “far less features”, since people (understandably) can’t just look them up.
–Eric
Anonymous Types.
Named, Optional, and ‘param’ parameters.
Extension Methods.
LINQ keywords.
Partial Classes [Unless US has this?]
Shorter Lambda’s.
Properties. [esp. Auto Properties]
Cool Object Collection Initializers.
Implicitly typed arrays.
Full Generic Support.
Nullable syntax [int?, ??]
C# actually does have a bunch of dynamic features, though not in U3D’s version IIRC.
Another feature not yet included is async.
While we are at it… does US have support of operator overloading et al? And how does one define an interface?
Now I await your list of awesome US features. I can think of 2~3.
http://docs.unity3d.com/Documentation/Manual/MonoUpgradeDetails.html A little outdated and not a substitute for real language documentation since it only covers a few things, but better than nothing at all.
Cool story bro.
–Eric
@npsf3000 - I was only naming a few, but thanks for the extended list.
the dynamic features though are a new .Net 4.0 thing, and not available in mono 2.1 which is what unity uses. I didn’t mention those kinds of features because unity doesn’t have them available… this includes optional params too.
@Eric5h5 -
delegates - nope, doesn’t have them. It has a Function type for referencing functions, but it lacks delegate typing.
events - lacks it, you agreed
method overloading - new to me (it’s not part of the ecma standard, which I’m more familiar with)
structs - note I said technically, just like you did… hrmmm
strict anon functions - I mean type safety you dingle nut… strict should have been that key word
fully strict typing - no it doesn’t, unityscript, based on javascript is a dynamic language. It’s one of it’s features that makes js/us a useful languages. It has a strict pragma, but it isn’t fully featured like C#'s is. (note my ref to strict anon functions)
also note the many features npsf3000 pointed out as well…
Keep in mind, I have no problem with unityscript/javascript. I personally don’t use it, but think it’s a very powerful language. It just lacks certain features C# has (and vice versa). It may have hack ways to pull off certain aspects, or you can use alternate design patterns to work around others, or you can forfeit certain strict features that I personally like to get them. But in the end, they are features it doesn’t have. Note what the word ‘feature’ means.
feature - a prominent or conspicuous part or characteristic
As I already said, lacking said features does not make it shit. It makes it unique. It’s WHY there are multiple languages available. We don’t want every language to be identical… otherwise what’s the point of having different languages.