Dom's Blog

Technology, Leadership and Game Development

  • Home/Blog
  • Articles
    • Index
    • Unity3D
    • GameDev
    • Programming
    • Downloads
  • My Work
    • Projects
    • Clients
  • About Me
  • Imprint

Coding in C# or JavaScript (i.e. for Unity3D)

Posted by Dom on J July, 2008
Posted in: Programming, Unity3D.

When I started to experiment a bit with Unity3D, I used JavaScript. Unity3D uses Dot.Net as "scripting" environment and supports C#, boo and JavaScript. JavaScript is the one I already used in the past thus it's what I went for.

But something that really put me off after a while was how inefficient coding was without a good editor with solid syntax highlighting and Intellisense. In Visual Studio C++ I am using Visual Assist now for many years and don't want to do any  coding with out it!

There is a webdeveloper edition of Visual Studio 2008 Express which has intellisense support for JS, but if you want good performance in Unity3D you better use the strong typing language modification Unity Technologies added. Which btw. looks like this

var myFloat : float = 1.23f;

JavaScript itself is a dynamic language with dynamic typing. In the past developing with such a type of languages was a bit old school (execute and observe: "print, print, print .. ah something wrong here"), because you didn't have an environment with syntax highlighting and debugging.  So I guess that web-developer VS Express release probably gives a nice boost there. 

Dynamic languages have their strong points! I like being able to open the maxscript console (F11) in 3ds max, type in some lines, select them and press Shift+Enter. It executes the code with instant results – fantastic for prototyping. When done, you simply drag'n drop the code onto your toolbar (as example) and dang, new button that calls your code. A very fast way to extend a tool.

Microsoft seems to be aware of this as in a video with the 4.0 C# design team, they talk about use-case. Looks like C# might become a choice for embedded "scripting" language in applications.

An alternative is thus to use Visual Studio C# Express 2008 which is a great C# editor for free. And so far it seems to have very good intellisense and refactoring tools built-in. Another benefit is, that you can compile in VS as a verification step. On the G4 it took nearly up to 10 seconds until Unity3D recognized the recently saved script file and finished the recompilation. Compared to Virtools where VSL compilation is a matter of a second, it felt pretty annoying. On the other hand VSL is a less complex and complete language. VSL code tends to be in most cases short and without many dependencies (at least for me).

As my G4 macbook doesn't have Parallels, I finally rigged up a home-network with Synergy – like many people on the Unity3D forum do suggest and it's really good as now I can use the PC for coding in C#. This brings not only the benefit of using a good Editor – which is the main point – but also the benefit of using familiar Keyboard-Layout. 😉
That G4 keyboard and the unfamiliar way of selecting words or rows in one via the keyboard was a real slow.

Although now I need to learn C#, it's worth in order to use a good development environment. Moreover it might be very interesting for other tasks too. Actually I will start with some C# stuff outside Unity3D first. So Unity3D will have to wait even some more …

Recently I did a little log-analyzer tool in MFC and it really feels old. Luckily due many available resources online, it's still ok to use and especially it doesn't need the dot.Net run-time, which was my major decision point: easy deployment. Just one .exe and go. But I am interested in WinForms.

I played a little bit with WPF and XAML but it adds an additional layer, so I will stick to WinForms first.

Posts navigation

← Using Vista – Round 2
Unity 2.1 released and it looks impressive →
  • Search

  • Pages

    • About
    • Articles
    • Imprint
  • Categories

    • ARCHIVE: 2006 to 2010 (178)
      • CGI & 3DS Max (38)
      • Downloads (7)
      • Fun, Music and Games (10)
      • GameDev (126)
        • Game Based Learning (1)
        • Game Design (4)
        • Game Engines (6)
        • GPU Shaders (7)
        • OGRE3D (6)
        • Unity3D (23)
        • Virtools (73)
      • Programming (10)
      • Site News (16)
      • Society (6)
      • Uncategorized (3)
      • UX (11)
  • Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
Proudly powered by WordPress Theme: Parament by Automattic.