I’ve just started using Unity and I’ve noticed that its a very Virtual based program (Everything is pretty much done within the scene, inspector, and hierarchy pane) but the power lies within scripting and creating links between GameObjects. Here lies a problem for me. As far as languages go I know Basic (Not my fault I was forced to learn it in school), and a decent amount of C++. The only scripting languages available in Unity are it’s modified javascript, bool (Python), and C# (Supposedly easier to learn than C++ but I have NEVER gotten along with java I don’t know why I just don’t like it).
So, three languages which should I learn?
My first thought of course is headed straight for C# but then I start to question if UnityScript the modified javascript was intended to be more useful/powerful (Thus why it was modified), and as for bool well…from what I can tell nobody uses bool and I skipped Intro to Computer Science (where they taught python) so I’d rather not use it personally
Are there any intentions to implement different scripting languages within Unity? Which language do you personally use? Which language is most recommended by the Unity team?
c# and JS are both widely used and easy to grasp. There’s also a plethora of examples/ blogs/ tutorials and even books on using both of them with Unity. If I were planning on learning a new language, I’d go with C# as that can also be useful outside of unity’s world.
It’s really a matter of preference. Since you are coming from a C++ background both the Unityscript and C# languages are fairly similar in syntax. Both expose pretty much the same functionality from both a Unity and .NET perspective. C# used to have some additional features, like generics, but I think they buffed Unityscript up to support them. Not sure if there’s anything else remaining that C# can do that Unityscript can’t.
Unityscript has a lot of syntactic suger, so takes a few less lines of code to create a class, but C# is a much better documented language with many more tutorials and references out there. The monodevelop version that ships with Unity seems to work a lot better with C# as well.
I actually did do a search however the two pages of threads I looked through had no relevant information or were to specific in what they were asking. I read through the forums (How I got most of my info in the first post) I just didn’t feel as though my questions had been cleared up by my digging.
Give Boo (not bool) a try! You will probably end up loving it. At least, read the manifesto. It’s a new (and therefore hip) language. Boo is statically typed, but it has type inference. So that you don’t have to tell the compiler that the variable you just assigned the value “Hello” to is a string, but don’t try assigning it an integer value later. And of course, it removes unnecessary curly brackets and semicolons, and helps you prevent repetitive stress injury.
But you should use what works for you, be that Javascript, C# or Boo (it should be Boo. The correct answer is Boo )
Lol sorry my bad I instinctively typed bool for boolean Not as bad as ending a sentence with a semicolon though
I’ve never used anything like Boo but I’ll look at the manifesto and check out some Bootorials and see if I can’t give it a chance. (Always fun to learn a new and different language)
I’ll take all of them (except javascript or unityscript whatever its called, I hate Java) for a spin and see how they go
C# is proving relatively easy to understand except for some weird conventions it keeps throwing at me in the tutorials
Well dissidently, I have good news for you. Boo works on the iPhone, perfectly This has been verified by both Unity and Rodrigo B. de Oliveira (author of Boo). I’m working on some examples and articles, but that interest may fade
C# will be easiest for you, but all these languages are the same really. Just a little different with their syntax. It’s not like one of them is a “functional language”.
If you know one programming language, learning another is no biggie. A programming language is just a syntax.
Programming concepts remain the same regardless (i.e. Logic, OOP, COP, SOP, etc…).
Oh and javascript != java.
Lastly, what is it about java that throws you curve balls? Syntax-wise, it is nearly identical to C. The only difference is that, like C++, it is object oriented rather than sequence oriented (C++ is simply an object oriented layer to C). The only other real difference conceptually is that everything is a pointer and nothing is accessed by value. Since you say you are coming from a background of C++, I am assuming that you already have a strong knowledge of OOP, and pointers.
If you tell us what you are having trouble with, perhaps we can help you since C# is an object oriented language, just as C++ and Java are and in game design, everything is and should be object oriented.
This post isn’t meant as criticism, it is just to make an attempt to better understand your background and difficulties so that we can better aid your transition to C# or whatever language you choose.
Perhaps I should clarify a bit, I don’t hate java code wise it’s the programs themselves I detest. Applications I don’t mind but every time I see a game made in Java I die a little inside each time.
Runescape, Minecraft, ect.
And I personally don’t have any desire to learn a language that other than Unity will serve no purpose for me. I took visual basic as my first language (Learned plenty of bad habits there) and from then I’ve moved into C++ (Skipping into to computer science where they taught python). Essentially my dislike for Java stems from my personal belief that it IS and should ONLY be a web development platform, when people use it for cross-platform releases for example I get generally dissatisfied. I have similar feelings toward Flash (Worlds slowest plugin anyone?) and the Mac OS.
I won’t refuse to use them but I have no desire to code for something that I consider a bad thing. (Guess I’m just a stubborn person)
I’ve never really worked with java before (I did take an Intro to Flash in a Multimedia class which quickly turned into an Outro when Adobe’s software kept bugging out in class) so I wouldn’t actually know much about it’s syntax (I do know that C# is based on Java and C++ so maybe this is language to move me in that direction).
And if the curve balls you were referring to are from my last post then I was talking about C# which uses different syntax than C++ (and I keep trying to type C++ in C# and its making things go loopy) gotta remember it’s a different language with differences in syntax.
As to the person who mentioned functional languages the only one I know of is F# (Which we watched a presentation of in class) and I’ve never used it before.
I see, well since you seem to be ok with the OOP paradigm, and have a decent knowledge of C++, you should have no problem picking up C#. The syntax is nearly identical to C++ (And java for that matter) with the only real differneces being some extra options of doing certain things and certain safegaurds added in for bad coding practices. It is important to remember, however, that javascript is not the same as java. While java is a programming language, javascript was developed specificallly for scripting purposes. Their syntax is nothing alike and frankly, javascripts syntax just seems very clumsy to me.
Lastly, Boo: You will probably never have a use for t his outside of Unity and thus is why very little people actually take time to lean it. Why take the time learning something you will probably never use and has no benefits over the other two options which are widely used outside of Unity and have been for decades? Don’t waste your time with this.
Well, I’ve written C++ code for a very, very long time, and have only used C# for about 1.5 years. IMO, C# kicks the crap out of C++ so hard that if you worked with it for any length of time, and didn’t prefer it, I’d have to call you a crazy person :). C# is just SOOO much better for actually getting things done, and maintaining it, there’s just no comparison, IMO. I recently had to do some C++ work on a large team built codebase that was not mine, and it gave me a renewed respect for the little changes in C# that make for better code.
You might have a look at this specific thread: Boo, C# and JavaScript in Unity - Experiences and Opinions; it has both user experiences with the languages, with the people’s backgrounds (which I think matters a lot in the choice), as well as a poll in which by now 375 users have participated. While many people believe UnityScript is more popular than C#, it really is not. However, it’s just a small difference, so it’s probably safe to say that among the forum population, C# and UnityScript are both used by around 30% exclusively. And about as many people (around 30%) are using C# and UnityScript (both languages used by the same voter).
Personally, I recommend C#, one reason being that you can use professional IDEs like Visual Studio to code C# and that gives you a tremendous amount of benefits. UnityScript (and maybe also Boo) are catching up with MonoDevelop - but I just don’t like MonoDevelop very much (but part of this is because I’m used to Visual Studio; another part may be that MonoDevelop just is a bit “young”).
The “good thing” with UnityScript is that it’s less verbose. In other words: You have to write less, and read less. However, that’s really a matter of what you prefer: For me, that’s exactly the reason why I prefer C# over UnityScript: In C#, I know exactly what’s going on without having to think much or give the variables names that tell me what their types are. In UnityScript, especially many of the examples, it’s different: You really have to know Unity very well to understand what actually is going on there.
However, C# is getting more features like implicit types (using “var variableName = SomeMethodThatReturnsAnObject();”), so theoretically, you can write code in C# that’s just as hard to understand as UnityScript. However, I think people aren’t doing that this often
Thanks for the link Jashan the poll and the posts are a great help to making the choice.
It seems as though C# is going to be the general consensus for the most part though just for the sake of finding out. Boo is Python based right? How close is it to actual Python code (Lets remember I’ve never typed in python here lol)? If it’s not too different than I might take a look at it just for fun (No reason to learn a programming language which can’t be used anywhere else).
Actually Boo on MonoDevelop likely was ahead of UnityScript since day 0 as it had MonoDevelop integration before Unity even started using MD as IDE (its easy to forget but Boo unlike UnityScript is a common mono .NET language that was used outside for years already, while UnityScript just recently was declared “common” if we want to call it that way)