A SIMPLE C# PROGRAM
The best way to
learn a new language like C# is to write a few simple programs and
execute them.This will enable us to analyze and understand how C#
programs work.
We begin with a very simple program that displays a line of text.
class Sampleone
{
public static void Main( )
{
System.Console.WriteLine("C# is sharper than C++);
}
}
This is the simplest program of all C# programs.
We begin with a very simple program that displays a line of text.
class Sampleone
{
public static void Main( )
{
System.Console.WriteLine("C# is sharper than C++);
}
}
This is the simplest program of all C# programs.
PROGRAM CODING STYLE
C# is a freefrom language.We need not indent any lines to make the program work property.
C# does not care where on the line we begin coding.While this may be a license for bad programming.We should try to use this fact to our advantage for designing readable programs.Although several alternative styles are possible,we should select one and try to use it consistently.
For example,the statement
System.Console.WriteLine("Hello");
("hello!");
or even as
System.Console.WriteLine
{
"Hello!"
}
C# does not care where on the line we begin coding.While this may be a license for bad programming.We should try to use this fact to our advantage for designing readable programs.Although several alternative styles are possible,we should select one and try to use it consistently.
For example,the statement
System.Console.WriteLine("Hello");
("hello!");
or even as
System.Console.WriteLine
{
"Hello!"
}
knightsPosted Feb 3, 2011, 10:35 AM
Hi bhavesh, In my view the title can be changed to something relevant, the things you mentioned as "tricks" i believe can be reffered as sample programs.Do you think the example represents the coding style for the whole c# language.Summary of article or blog is nice to start with a capital letter.Thanks