VS.NET Collapsable code [Archive] - C Board

PDA

View Full Version : VS.NET Collapsable code


Troll_King
01-04-2002, 02:49 AM
A very cool feature. I can collapse the code for each class or method of a class, for example here is the full class:


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:


class Person
{
private System.Random randomNumberGenerator;

public Person()...

public int NewFloorRequest()...
}

And here is the code with the class collapsed:

class Person...


You can open the collapsed code whenever you want. Makes editing more rich. One of the features of VS.NET

Fordy
01-04-2002, 04:06 AM
>>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?

Troll_King
01-04-2002, 04:16 AM
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.

Fool
01-04-2002, 10:50 AM
Wow, that code looks so much like Java. It would probably be really easy for a Java Developer to learn C#, huh?

Troll_King
01-05-2002, 05:40 AM
Not sure. I think they have some similar features, it's also similar to C and C++.

-KEN-
01-05-2002, 10:01 AM
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.

Troll_King
01-05-2002, 04:04 PM
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.

nvoigt
01-05-2002, 05:02 PM
>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.

taylorguitarman
01-06-2002, 12:42 AM
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.

Fordy
01-06-2002, 06:19 AM
>>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 :)