Search Unity

Choice of scripting language

Discussion in 'Scripting' started by godstroke, Nov 17, 2009.

  1. godstroke

    godstroke

    Joined:
    Nov 17, 2009
    Posts:
    2
    Hi,

    I am a long time flash developer since version 4, I've just decided to start learning unity3d. Been reading many articles on unity but I am not quite sure about scripting.

    Here are my questions:

    1) Are all supported languages interpreted?
    2) Programming language does not matter, which is the most extensive and fast on runtime?
    3) Which language has best practices and has most tutorials written with?

    Thanks.
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    1) No language is interpreted, all are compiled to .NET assemblies. Actually the term "scripting" in relation to unity is very missleading as you are actually programming

    2) The most complete one is without a question C#, followed by boo and JS

    3) Unity Tutorials: Clearly JS as it is the only one mentioned in the documentation right now
    Generally: C# by far as it is the only large used standard language.
     
  3. godstroke

    godstroke

    Joined:
    Nov 17, 2009
    Posts:
    2
    Thanks.

    Than, my choice is C#. I know it's a good programming language.

    more questions:

    1) Is all coding done in unity3d's IDE?
    2) Is it good? With syntax highlighting , intellisense/autocompletion.. etc.
    3) I heard windows version of unity has visual studio support, whats available for mac?
    4) Code writing in flash is piece of crap, its like writing code on notepad. I'am using 3rd party IDE "Flashdevelop" to code. Is there any need for any 3rd party program for unity3d? If so, which are your suggestions?
     
  4. tonyd

    tonyd

    Joined:
    Jun 2, 2009
    Posts:
    1,224
    If you already know actionscript, Unity's javascript is probably the most similar, and will require a lot less typing than c#.

    You can also mix and match scripts, so if you do need something that isn't supported in javascript, you can write a function/class in c# and use it with your javascript code.
     
  5. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    1) its done in whatever you want :)
    I personally use the ones provided by Unity.

    2) UniScite does that to a large degree, the editor on mac has similar capabilities from what I remember (don't use them as they aren't on the standard shortcuts). For more you will need Visual Studio 2008 / MonoDevelop

    3) You can use MonoDevelop beside the unity provided editor.

    4) Depends on your needs and requirements.
    Generally you will want to have the Unity Script Reference html open in the background anyway so its mainly a matter of how much autocompletition you need.
     
  6. tonyd

    tonyd

    Joined:
    Jun 2, 2009
    Posts:
    1,224
    You can use whatever IDE you want, but the built-in one (on Macs) is Unitron, based on Smultron. It's one of my favorite editors, but does NOT support autocompletion or code folding.
     
  7. matthewminer

    matthewminer

    Joined:
    Aug 29, 2005
    Posts:
    331
    If you've used FlashDevelop in the past you might want to take a look at UnityDevelop, a modified version of the editor specifically for Unity's JavaScript.
     
  8. Timmer

    Timmer

    Joined:
    Jul 28, 2008
    Posts:
    330
    Use whichever has the syntax you're most comfortable with: this is worth its weight in gold.

    No, no coding should be done inside Unity. Real code is written in emacs ;)
    Whichever editor you're comfortable with. TextMate is a very nice Mac editor and even has support for Unity (C#/Boo, not sure on JS but probably).

    If you want to go cross platform, emacs and vi are hard to beat, too.

    I highly recommend using a non-Unity specific editor. Once you learn it then you can use it on whatever else code you happen to write on.

    I wouldn't trade a good editor for anything -- they become an extension of yourself :)
     
  9. VCCGeek

    VCCGeek

    Joined:
    Nov 17, 2009
    Posts:
    89
    Just my own experience, here.

    I started out trying to write everything in C#, since it's what I know best, but I ended up switching over to Javascript. There were a lot of things that I couldn't figure out how to do in C#, even though I like it better, and Javascript is enough like it that it was an easy transition.

    The other thing that helped was the fact that Javascript isn't strongly typed like C# is. I know, it's a bad habit to declare untyped variables, but I've run into several situations where doing so saved me a lot of trouble.

    Just my two cents.
     
  10. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    the problem with the not strongly typed is that it will bite your ass again should you ever want to move anything over to the iphone :)
     
  11. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    It's only a bad habit if you're after the best speed. Otherwise, as you noted, code can be a lot simpler and more elegant in some cases if you don't have to care about the type.

    --Eric