C Sharp/Compilers

From Wikiversity
Jump to navigation Jump to search

using System; class Program { static void Main() { char[] array = { 'z', 'a', 'b' }; // Convert array to a string and print it. Console.WriteLine("UNSORTED: " + new string(array)); // Sort the char array. Array.Sort<char>(array); Console.WriteLine("SORTED: " + new string(array)); } }

About Compiling[edit | edit source]

Source code is really just a string of text. You can open most source code in any text editor (like Notepad, vim, textmate, etc) and view the code. The amazing part of the coding process is the compiler. The compiler takes the text that you've written and will convert it to machine code (in the case of languages such as C++) or an intermediary language that can be executed by a Just In Time Compiler (in the case of languages such as C# and Java). You could follow the lessons and learn the basics of the language from reading alone, but you'll need to get a copy of a compiler to run the code in the lessons.

Visual Studio - Windows only[edit | edit source]

Visual Studio is the compiler and IDE created by Microsoft for Windows computers. Visual Studio has several versions. The professional version can compile C# code, as well as a number of other languages. However, this professional version is expensive. If you are a student you can obtain a free copy of Visual Studio 2008 Professional from Microsoft on their http://www.dreamspark.com website.

The free alternative to Visual Studio Professional is Visual Studio Express Edition. Visual Studio Express Edition is perfect for learning how to code in C#, and can be obtained for free from Microsoft on their http://www.microsoft.com/express/vcsharp/ website. This is probably the best choice for learning C# on Wikiversity.

MonoDevelop - cross platform[edit | edit source]

Mono is a project lead by Novell with goals to create a .NET compatible set of tools, including a compiler and Common Language Runtime (CLR). Mono is available as source for free, and can be compiled on Linux, BSD, UNIX, Mac OS X, Solaris and Windows. It supports x86, SPARC, PowerPC, ARM, S390, x86_64, IA64 and SPARC processors. You can also get mono as a package for most operating systems. Mono can be downloaded at the http://www.mono-project.com/Main_Page website.

MonoDevelop is the accompanying IDE for the Mono Project. It is also available from source, and has many features that make it an easy to use compiler.

Where To Go Next[edit | edit source]

Topics in C#
Beginners Intermediate Advanced
Part of the School of Computer Science