#region 和 #endregion 在 F# 中不起作用是否有任何充分的理由

发布于 2024-07-29 18:20:26 字数 63 浏览 4 评论 0原文

这对于组织和浏览代码非常有用。 为什么没有实施? 如果它会阻止某些构造,为什么不为 F# 提供类似的东西呢?

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#?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一花一树开 2024-08-05 18:20:26

我同意代码折叠很好,我们需要在代码中添加注释,但是
我想要比区域/结束区域更通用的东西; 我想要一个
向 IDE 提供信息的通用方式,不是的通用方式
由编译器检查(以便 IDE 可以实现功能,而无需
需要更改编译器)。

话虽这么说,代码折叠并不总是一件好事。 正如 Jeff Atwood 在他的博客文章中指出的有关代码折叠和其中一些陷阱。 另外这个答案也有一些有效的观点。

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.

暮年 2024-08-05 18:20:26

这是 F# 团队希望添加的功能,但它更像是一种“很好有”的功能,并且没有必要在产品版本的 v1 中提供。 在 Visual Studio 的未来版本中,我们将看到更多此类功能进入 F#。 对于 Visual Studio 2010,要使 F# 达到产品质量需要做大量的工作。

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.

感性 2024-08-05 18:20:26

我认为 F# 还不够成熟,无法拥有 C# 和 VB.NET 的所有功能。 我确信,如果它存在的时间更长一些,诸如代码折叠之类的非关键功能将会随之而来。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文