这绝对是主观的,但我想尽量避免它变成争论。我认为如果人们恰当地对待它,这将是一个有趣的问题。
这个问题的想法来自于我对“你最讨厌的语言的哪五件事?”问题的回答。我认为c#中的类在默认情况下应该是密封的——我不会把我的理由放在这个问题上,但我可能会写一个更完整的解释来回答这个问题。我对评论中的讨论热度感到惊讶(目前有25条评论)。
那么,你有什么有争议的观点?我宁愿避免那些基于相对较少的基础而导致相当宗教的事情(例如,大括号放置),但例如可能包括“单元测试实际上并没有多大帮助”或“公共字段确实是可以的”之类的事情。重要的是(至少对我来说)你的观点背后是有理由的。
请提出你的观点和理由——我鼓励人们投票给那些有充分论证和有趣的观点,不管你是否恰好同意这些观点。
我通常持有相当有争议的、强烈的和响亮的观点,所以这里只是其中的一些:
“因为我们是微软的机构/合作伙伴/专家”从来都不是一个有效的论点。
我现在工作的公司首先把自己定位为微软专家。所以前面提到的论点被抛出了很多次,我还没有看到一个背景下它是有效的。
我不明白为什么要在每一个适用的角落推广微软的技术和产品,而不顾客户和员工的满意度,以及一般的实用主义。
这正是我对软件行业政治深恶痛绝的一个基石。
MOSS(微软Office Sharepoint服务器)就是一坨屎。
有点像第一个观点,但我真的认为MOSS应该被赶出市场。它需要花费大量的授权和设置费用,破坏了web标准,让开发者非常不开心。我还没有看到一个MOSS项目有一个总体积极的结果。
然而,一次又一次,客户找到我们并要求MOSS解决方案。
源文件太20世纪了。
在函数/方法的主体中,将过程逻辑表示为线性文本是有意义的。即使逻辑不是严格的线性,我们也有良好的编程结构(循环、if语句等),允许我们使用线性文本清晰地表示非线性操作。
But there is no reason that I should be required to divide my classes among distinct files or sort my functions/methods/fields/properties/etc in a particular order within those files. Why can't we just throw all those things within a big database file and let the IDE take care of sorting everything dynamically? If I want to sort my members by name then I'll click the member header on the members table. If I want to sort them by accessibility then I'll click the accessibility header. If I want to view my classes as an inheritence tree, then I'll click the button to do that.
Perhaps classes and members could be viewed spatially, as if they were some sort of entities within a virtual world. If the programmer desired, the IDE could automatically position classes & members that use each other near each other so that they're easy to find. Imaging being able to zoom in and out of this virtual world. Zoom all the way out and you can namespace galaxies with little class planets in them. Zoom in to a namespace and you can see class planets with method continents and islands and inner classes as orbitting moons. Zoom in to a method, and you see... the source code for that method.
基本上,我的观点是,在现代语言中,不管你把你的类放在什么文件中,或者你定义一个类的成员的顺序是什么,那么为什么我们仍然被迫使用这些古老的实践呢?还记得Gmail出来谷歌说的是"搜索,不排序"吗?那么,为什么同样的哲学不能应用于编程语言呢?