The Visual Studio is a powerful IDE (Integrated Development Environment). It provides some convenient features for speed up the coding. For example, if you want to write a switch statement to test each possible cases for a enum variable.
First step, is to type in switch and press TAB key, this will produce this.
namespace ConsoleApplication1
{
class Program
{
enum abc { a, b, c, d, e } ;
static void Main(string[] args)
{
switch (switch_on)
{
default:
}
}
}
}
And type in abc (the enum variable you want to use) and press Arrow Down key. This will list all possible cases for that enum variable.
namespace ConsoleApplication1
{
class Program
{
enum abc { a, b, c, d, e } ;
static void Main(string[] args)
{
switch (abc)
{
case abc.a:
break;
case abc.b:
break;
case abc.c:
break;
case abc.d:
break;
case abc.e:
break;
default:
break;
}
}
}
}
Similarly, you can do this with for: (Type in for and press TAB key immediately):
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < length; i++)
{
}
}
}
}
The auto-completing feature allows you to type less for more! For other programming languages, it is similar, this code auto completing feature is also enabled in Visual Studio.
–EOF (The Ultimate Computing & Technology Blog) —
261 wordsLast Post: Algorithm to Compute the Pascal Triangle's values
Next Post: Learning Haskell - Tutorial 1