C# and Visual Studio

Hi All

So I’ve decided to jump into scripting, using C#.

My company has software agreements with Microsoft which means it’s quite easy for me to get a copy of Visual Studio 2010 (and subsequent upgrades).

My question is - is it worth it? I’ve never programmed before apart from some small javascript and maxscript work, so I’m not sure exactly what VS2010 would bring to the table over, say, the built in editor.

So, if you were in my position, would you get VS2010 and do your coding in that?

Thanks

I use VS C# express, which is free, and it is amazing. I don’t know what I would do without it. Advanced autocomplete can write whole blocks of code. All kinds of neat shortcuts like auto-adding namespaces (“using…”), rename names across an entire project so if you change the name of a method that is used in 20 files it will auto-update them all! I use these features every time I sit down. Priceless time savers.

I think i have learned more about the Unity API from inside VS than from the docs. For example, type a ‘.’ and you’ll see a list of all members (sometimes with documentation) or in method braces, type a comma ‘,’ and see a list of all overloads (versions of a method.)

Great, this is exactly what I was hoping.

Thanks Rafes!

Yes, but, what about debugging?

As far as I’ve got, you won’t be able to step into any function when attaching VS2010 to the Unity instance.
I don’t if you can achieve it in the Pro version, definitely you can’t with the Free one.

The scripting pipeline would be then, writing your code in VS2010 and when things go wrong, 100% of times especially if you are a beginner with Unity like me, switch to Mono. Not so beautiful and smooth though :S

I will be more than happy to be wrong.

I use VS 2010, and from my experience this is indeed the case. It can be a real pain, but I just cant bring myself to actualy code in Mono given how use to VS I am. I really wish Unity would integrate with VS more closely to allow debugging.

MD (the built-in editor) is fine. It can be a little flaky but it is free, has everything you need in terms of autocompletion refactoring (the things Rafes mentioned also exist in MD) and you can debug in it without switching to another program.

If you’ve never programmed before it is unlikely you will use the more super-advanced features that VS provides. The only things I miss from VS are the live “compile as you type” feature and the way it highlights all visible instances of selected text.

I use vs2008. And its true you cannot debug with it.

The few times i’ve used monodevelop its been because i’ve wanted to debug code to find problems. Unfortunately when i’ve needed to do this, monodevelop crashed with unity crashing ( which defeated the purpose of trying to debug ).

At anyrate i’d suggest to use MD over vs even though i really love VS and have not used MD very much at all if i was in a position where i used MD i feel like that would be a better position to be in overall. But again as long as i’m on Windows i’ll most likely stick to vs.