-
VS.NET Collapsable code
A very cool feature. I can collapse the code for each class or method of a class, for example here is the full class:
Code:
class Person
{
private System.Random randomNumberGenerator;
public Person()
{
randomNumberGenerator = new System.Random();
}
public int NewFloorRequest()
{
//Return randomly generated number
return randomNumberGenerator.Next(1,30);
}
}
Here is the class with the methods collapsed:
Code:
class Person
{
private System.Random randomNumberGenerator;
public Person()...
public int NewFloorRequest()...
}
And here is the code with the class collapsed:
You can open the collapsed code whenever you want. Makes editing more rich. One of the features of VS.NET
-
>>You can open the collapsed code whenever you want. Makes editing more rich. One of the features of VS.NET
Hey..can VC++.NET do that too?
-
Write either managed or unmanaged C++ in the VS.NET IDE. The collapsible feature works with any code your write in any of the supported languages. It makes it a lot easier to scroll through a long program and organize.
-
Wow, that code looks so much like Java. It would probably be really easy for a Java Developer to learn C#, huh?
-
Not sure. I think they have some similar features, it's also similar to C and C++.
-
Be easy for pretty much ANYONE to learn C#...
and yeah, code collapsability is kinda nice I guess, but I don't really like it...I like to see all of my code.
-
You have the choice. If you want to see all the code than don't collapse any of it, but remember in C# you don't have include files and unless you create several .dll files than everything will be in one file. Without collapable code than that would be hard to read. The VS.NET IDE has a ton of features, but until a textbook comes out, collapsable code is a good way to do the housekeeping. Infact I don't think that I will want to go without it. It's just as good as the tabbed windows that I can easily use to jump from window to window. I even heard that if you have a second monitor than you can drag some of the windows to a second screen. Now that would be cool.
-
>everything will be in one file.
You still have the namespace/using concept, which is remarkably similar to #includes. And you can seperate your code into as many files as you like. Everything else would be complete chaos for larger applications. Like in Java, you do have to write one class in one file, there is no longer the .h/.cpp seperation of declaration and methods.
However, the colapsable code sections are a great idea and really help to look through your code easily.
-
Coming from a C++ and Java background I've been picking up C# very quickly. There are enough differences to make it interesting though. I think it's a pretty good language so far. I wonder what kinds of Benchmarks it has for performance. Gonna have to look into that.
-
>>I wonder what kinds of Benchmarks it has for performance. Gonna have to look into that.
I remember reading on a java board about a benchtest where C# on NET totally wooped J2EE.......
I didnt read any replies to it though.......and it was a M$ article I think :)