VS.NET Collapsable code

This is a discussion on VS.NET Collapsable code within the C# Programming forums, part of the General Programming Boards category; A very cool feature. I can collapse the code for each class or method of a class, for example here ...

  1. #1
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784

    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:
    Code:
    class Person...
    You can open the collapsed code whenever you want. Makes editing more rich. One of the features of VS.NET

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    >>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?

  3. #3
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    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.

  4. #4
    Registered User Fool's Avatar
    Join Date
    Aug 2001
    Posts
    335
    Wow, that code looks so much like Java. It would probably be really easy for a Java Developer to learn C#, huh?

  5. #5
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Not sure. I think they have some similar features, it's also similar to C and C++.

  6. #6
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    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.

  7. #7
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    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.

  8. #8
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    >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.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  9. #9
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    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.

  10. #10
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    >>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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extended ASCII Characters in an RTF Control
    By JustMax in forum C Programming
    Replies: 18
    Last Post: 04-03-2009, 09:20 PM
  2. Enforcing Machine Code Restrictions?
    By SMurf in forum Tech Board
    Replies: 21
    Last Post: 03-30-2009, 08:34 AM
  3. Values changing without reason?
    By subtled in forum C Programming
    Replies: 2
    Last Post: 04-19-2007, 11:20 AM
  4. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 12:38 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 06:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21