November 26, 2014
Hot Topics:

Programming with C# - - 101

  • November 19, 2001
  • By Bradley L. Jones
  • Send Email »
  • More Articles »

There are also other editors available for C#. Like Visual Studio .NET, many of these enable you to do all the steps of the development cycle without leaving the editor. More importantly, most of these color-code the text you enter. This makes it much easier to find possible mistakes. Many editors will even help you by given you information on what you need to enter and giving you a robust help system.

If you don't have a C# editor, don't fret. Most computer systems include a program that can be used as an editor. If you're using Microsoft Windows, you can use either Notepad or WordPad as your editor. If you're using a Linux or UNIX system, you can use such editors as ed, ex, edit, emacs, or vi.

Most word processors use special codes to format their documents. Other programs can't read these codes correctly. Many word processors[md]such as WordPerfect, Microsoft Word, and WordPad - are capable of saving source files in a text-based form. When you want to save a word processor's file as a text file, select the text option when saving.

To find alternative editors, you can check computer stores or computer mail-order catalogs. Another place to look is in the ads in computer programming magazines. The following are a few editors that were available at the time this book was written:

  • CodeWright. CodeWright is an editor that provides special support for ASP, XML, HTML, C#, Perl, Python, and more. It is located at www.premia.com.
  • EditPlus. EditPlus is an Internet-ready text editor, HTML editor, and programmer's editor for Windows. Although it can serve as a good replacement for Notepad, it also offers many powerful features for Web page authors and programmers, including the color-coding of code. It is located at www.editplus.com.
  • JEdit. JEdit is an Open-Source editor for Java; however, it can be used for C#. It includes the capability of color-coding the code. It is located at http://jedit.sourceforge.net.
  • Poorman IDE by Duncan Chen. Poorman provides a syntax-highlighted editor for both C# and Visual Basic .NET. It also enables you to run the compiler and capture the console output so you don't need to leave the Poorman IDE. Poorman is located at www.geocities.com/duncanchen/poormanide.htm.
  • SharpDevelop. SharpDevelop is a free editor for C# projects on Microsoft's NET platform. It is an Open-Source Editor (GPL), so you can download both source code and executables from www.icsharpcode.net.

Naming Your Source Files

When you save a source file, you must give it a name that describes what the program does. In addition, when you save C# program source files, give the file a .cs extension. Although you could give your source file any name and extension, .cs is recognized as the appropriate extension to use.

Executing a C# Program

Before digging into the Program Development Cycle, it is important to understand a little bit about how a C# program executes. C# programs are different from programs you could create with other programming languages.

C# programs are created to run on the Common Language Runtime (CLR). This means that if you create a C# executable program and try to run it on a machine that doesn't have the CLR or a compatible runtime, it won't execute.



Page 2 of 5



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Sitemap | Contact Us

Rocket Fuel