Why you should learn C# and Javascript

Just a word of advice to everyone learning to program starting with Unity .
Theirs no real reason to not learn a bit of C# and Javascript . Even outside of Unity their remarkably alike . The great thing about learning both is you open up far more career paths for your self . I started with Javascript , but NGUI basically made me learn C# and I found after a few painful weeks, it wasn’t nearly as scary as I figured .

Just my 2 cents , also , and this is for anyone with bills to pay , keep your options open . Don’t restrict yourself to gamming , the pay sucks and you can make far more coding boring stuff .

I don’t use C# for anything besides game dev, I prefer Java for desktop applications and stick with php for web dev but it’s always good to know more.

Hi I’m a beginner with Unity, I have some c# knowledge but not much of animation. How do i apply what i know in c# into unity, I’m trying to transfer a board game i built using windows form to 3D using unity. Cheers!

Leckan, if you already know C# you will do well in Unity. Just read through the scripting reference here. UnityScript examples are default, but you can change to C# or Boo if you so wish by clicking the dropdown menu next to an example.

Thanks Rab236 [quote=“UnknownProfile, post:4, topic: 498363, username:UnknownProfile”]
Leckan, if you already know C# you will do well in Unity. Just read through the scripting reference here. UnityScript examples are default, but you can change to C# or Boo if you so wish by clicking the dropdown menu next to an example.
[/quote]

My two cents. Bear in mind that learning UnityScript is not exactly the same as learning JavaScript. If I had to choose one for real-life use, I’d choose probably C# for software development as a main side-use, and JavaScript (not UnityScript) for web programming.

Oops, just answered here to a post written after mine and suddenly it dissapeared!

Yep. Gaming teaches you logic, and logic makes $. And I like money, because today, you either have it or you don’t. I prefer to be in the former.

For me once I took the first step the rest was far more accessible . Thats why I think its OK to start with Unity , you see immediate results for you coding efforts

Javascript can only be used for ‘web programming’ on the client side. You still need a server-side language, in which case C# and ASP.NET MVC are tops. But yes, to make good modern web apps you need a good mix of Jquery and JavaScript.

Not strictly true… but sure, C# and ASP.NET MVC are probably what I’d choose too, given the option.

no… http://nodejs.org/ is quite popular.

Yup, most of the time your assertion is correct. However I didn’t want to get into the whole “Webby” topic, but only point out that there are differences between UnityScript and JavaScript, and that C# and JS are usually employed for different tasks commonly (despite being, at the end of the day, programming languages, capable of doing most of what each other does). That’s all :wink:

In fact they very different… they just look similar. UnityScript has much more in common with C# than with real JS. JS is dynamically typed, UnityScript and C# use static typing; JS is a prototype based language (there are no classes), UnityScript and C# are class based.
I wouldn’t bother to learn UnityScript, if you know C# it’s easy to read UnityScript, and C# is a more powerful language.
Boo is quite nice, it offers powerful features found neither in C# nor UnityScript, you can use macros and write custom attributes, and it’s clean syntax makes the code much shorter (compared to both C# and UnityScript) and very easy to read.

Correct, UnityScript is NOT JavaScript in the same way that Boo is NOT Python. The syntax is similar but that’s about it. It varies quite a bit in actual implementation.

Also, UnityScript is actually written in Boo.

As far as learning them , and syntax , their similar . Funny that you mention Boo since no one really uses that .

I’ve done JS outside of Unity and I found it very similar to JS in Unity . Just my 2 cents .

the similarities are superficial really… dig deeper into real JS and you will find out I mean.
It’s a shame no one uses Boo (well, almost no one, I’m using it :wink: )! Simple things are usually much easier to do in Boo, and some things you can do in Boo are impossible in other languages. And I really mean impossible, not just hard to do!

Not really, C# and JS are very similar in feature and mindset, with C# being pretty much a superset of JS, they used to be very different in the C# 2 era, but with C# embrasing functional programing you can write pretty similar code in both with the syntax actually being the place they’re most dissimilar and obviously also the more naturally dynamic nature of JS. As long as you’re writing local code and not architecturing large solutions, they’re very similar now (if you really go deep then yea, inheritence / prototypes are pretty different)

If you write a few lines of code they might seem similar… We could argue now how similar languages have to be to call them similar, but I guess we can agree that it would be rather pointless.
I just thought I would point out the differences, knowing and understanding them saves you a lot of headaches. I’ve seen a lot of people (including me), coming from the statically typed class based world to JS (or vice versa) without understanding this, suffering for their ignorance.

Not really. Even writing a whole game they should be pretty similar. Modern c# modern js are similar to me as long as you’re not writing an api.

Js is dynamic but honestly, how often do you do dynamic only features in js? And js core diff with c# (syntax aside) was it being a functional language, which isn’t a difference anymore since c#3