7

This is very useful in organizing and browsing the code. Why is it not implemented? And if it would prevent some constructs why not have something similar for F#?

Kredns
  • 36,461
  • 52
  • 152
  • 203
Moonlight
  • 545
  • 5
  • 15
  • 1
    Why would code folding prevent other features of a language from being possible? That makes no sense. – mP. Jul 25 '09 at 05:52
  • 2
    Code folding is not a language feature - but is more or less a editing presentation directive. Its presense or lack thereof does not change the behaviour or execution of said program. – mP. Jul 25 '09 at 05:53

3 Answers3

6

I agree code folding is nice and we need annotations in the code, but I'd like something more generic than region/endregion; I'd like a generic way to give information to IDE, a generic way that's not checked by the compiler (so that IDEs can implement features, without requiring a change in the compiler).

That being said, code folding is not always a good thing. As Jeff Atwood points out in his blog post about code folding and some of it's pitfalls. Also this answer has some valid points.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Kredns
  • 36,461
  • 52
  • 152
  • 203
2

This is a feature that the F# team would love to add, but it is more of a "nice to have" sort of feature and isn't necessary to ship for v1 of the product release. We'll see more of these types of features make their way into F# in a future version of release of Visual Studio. For Visual Studio 2010, it's been a great deal of work to get F# to product quality.

Dustin Campbell
  • 9,747
  • 2
  • 31
  • 32
1

I would imagine F# is not yet mature enough to have all of the features of C# and VB.NET. I'm sure that if it is around for a bit longer the non-critical features such as code folding will follow.

Jason Irwin
  • 1,985
  • 2
  • 29
  • 42