C#作为编程语言 [英] C# as a programming language

查看:97
本文介绍了C#作为编程语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的肥皂盒上花两分钟。


我喜欢C#。我很有成效,这太荒谬了。但是使用糟糕的设计原则编写代码很容易。示例:仅使用
变量public而不是使用属性。另一个例子:传递

对表单的引用到其他类,以便他们可以修改东西(紧的

耦合)。所以从本质上讲,有很多方法可以做很多事情,其中​​很多只是平淡无奇的设计。


我只是想知道什么语言(如果有的话)更有限的方式来做b / b
这样做会迫使程序员使用更好的设计原则?

I want to spend two minutes on my soapbox.

I love C#. I am so productive in it it''s ridiculous. But it''s so easy to
write code that uses poor design principles. Example: just making
variables public instead of using properties. Another example: passing
references to forms to other classes so they can modify things (tight
coupling). So in essence, there are so many ways to do things that many of
them are just flat-out poor designs.

I''m just wondering what languages (if any) are more limited in the ways to
do things so that they force the programmer to use better design principles?

推荐答案

它并不完全是关于设计原则,但有一种语言

至少强制格式化格式 - 它是空白敏感的python。


我不知道任何会以某种方式迫使程序员使用的语言

确切的设计原则。


我相信Visual可以将Studio配置为在用户编译代码时通过FxCop运行代码,并在某些

FxCop规则未满足时拒绝编译。


" Dave" <无** @ nowhere.com>在消息中写道

新闻:u8 ************** @ TK2MSFTNGP02.phx.gbl ...
It''s not exactly about design principles, but there is a language that
forces exact formatting at least - it''s the whitespace sensitive python.

I don''t know of any language that would somehow force programmer to use
exact design principles.

I believe Visual Studio could be configured to run the code through FxCop at
the time when user compiles his code and refuse to compile when certain
FxCop rules are not met.

"Dave" <no**@nowhere.com> wrote in message
news:u8**************@TK2MSFTNGP02.phx.gbl...
我想花两个在我的肥皂盒上分钟。

我喜欢C#。我很有成效,这太荒谬了。但是编写使用糟糕设计原则的代码非常容易。示例:仅将变量公开而不是使用属性。另一个例子:将对表单的引用传递给其他类,以便它们可以修改事物(紧密耦合)。所以从本质上讲,有很多方法可以做很多事情,其中​​许多只是平淡无味的设计。

我只是想知道哪些语言(如果有的话)更多是否限制了做事的方式以便他们强迫程序员使用更好的设计原则?
I want to spend two minutes on my soapbox.

I love C#. I am so productive in it it''s ridiculous. But it''s so easy to
write code that uses poor design principles. Example: just making
variables public instead of using properties. Another example: passing
references to forms to other classes so they can modify things (tight
coupling). So in essence, there are so many ways to do things that many
of them are just flat-out poor designs.

I''m just wondering what languages (if any) are more limited in the ways to
do things so that they force the programmer to use better design
principles?



我认为程序员是谁已经通过C ++(或其他原生的

语言)的路径欣赏C#的许多功能。


然而,我认为任何学习编程的人在C#中,几乎无法用C ++开始编程。


C#鼓励非结构化程序。


Dave写道:
I think programmers who have come through the path of C++ (or another native
language) appreciate many of the features of C#.

However, I think that anyone who learns programming in C#, would find it almost
impossible to start programming in C++.

C# encourages unstructured programs.

Dave wrote:
我想在我的肥皂盒上花两分钟。

我喜欢C#。我很有成效,这太荒谬了。但是编写使用糟糕设计原则的代码非常容易。示例:仅将变量公开而不是使用属性。另一个例子:将对表单的引用传递给其他类,以便它们可以修改事物(紧密耦合)。所以从本质上讲,有很多方法可以做很多事情,很多人只是在讨论糟糕的设计。

我只是想知道哪些语言(如果有的话)更多有限的方式来做事情,以致他们迫使程序员使用更好的设计原则?
I want to spend two minutes on my soapbox.

I love C#. I am so productive in it it''s ridiculous. But it''s so easy to
write code that uses poor design principles. Example: just making
variables public instead of using properties. Another example: passing
references to forms to other classes so they can modify things (tight
coupling). So in essence, there are so many ways to do things that many of
them are just flat-out poor designs.

I''m just wondering what languages (if any) are more limited in the ways to
do things so that they force the programmer to use better design principles?



Eiffel(包括Eiffel) .NET)支持接口契约。它强烈地鼓励他们使用但我不记得它是否会迫使你使用它们。


好​​的设计原则的问题在于我们可以他们都同意100%

,并且采用特定爱好马并将其转变为束缚和纪律的产品会立即限制市场产品。


作为一个例子,你可以说COBOL(包括COBOL.NET)支持80柱心灵并强制执行它...但大多数我们在这里可能

我真的不想像这样转回时钟;-)


做你建议的最好方法可能是IDE级别,在VS Enterprise 2003中使用

VS加载项和适当构造的策略

或VS Team 2005.该功能更多地针对需要

来强制执行他们自己的样式和程序以及工作流程,所以我怀疑

给出足够的资源你可以构建几乎所有的意识形态或要求,无论是技术还是政治。


最后的想法......引用弗雷德布鲁克斯的话,没有Silver

Bullet,所以在我看来,搜索完美方法论和

任务强制执行它可能是错误的。

http://www.cs.unibo.it /~cianca/wwwpa...ure/Brooks.pdf


这是一门科学技术,最终你想出来了

做正确的事情需要经验,内心,直觉,创造力和谦卑,因为它需要客观的科学分析。我更喜欢

来收集好的东西并从每个思想流派中抛出糟粕,并且

根据具体情况使用有意义的东西。因此,我真的不希望我的语言和开发环境过多或者说b
做出太多的假设。


Best,


--BOB


Dave写道:
Eiffel (including Eiffel.NET) supports interface contracts. It strongly
encourages their use but I don''t recall if it forces you to use them.

The trouble with good design principles is that we can''t all agree 100%
on them, and a product that adopts a particular hobby horse and turns it
into bondage-and-discipline immediately limits the market for the product.

As an example you could argue that COBOL (including COBOL.NET) supports
the 80 Column Mind and enforces it ... but most of us here probably
don''t really want to turn back the clock like that ;-)

The best way to do what you suggest is probably at the IDE level, with
VS add-ins and appropriately constructed policies in VS Enterprise 2003
or VS Team 2005. That functionality is targeted more at shops that want
to enforce their own styles and procedures and workflows, so I suspect
that given enough resources you could construct something around almost
any ideology or requirement, whether technological or political.

As a final thought ... to quote Fred Brooks, "There Is No Silver
Bullet", so in my view the search for the Perfect Methodology and the
quest to enforce it is probably misdirected.

http://www.cs.unibo.it/~cianca/wwwpa...ure/Brooks.pdf

This is a craft as much as a science, and eventually you figure out that
to do it right requires experience, heart, intuition, creativity and
humility as much as it requires objective scientific analysis. I prefer
to glean the good and eject the dross from each school of thought, and
use what makes sense depending upon the situation. As such, I really
don''t want my language and development environment dictating too much or
making too many assumptions.

Best,

--Bob

Dave wrote:
我想花两分钟时间在我身上肥皂盒。

我喜欢C#。我很有成效,这太荒谬了。但是编写使用糟糕设计原则的代码非常容易。示例:仅将变量公开而不是使用属性。另一个例子:将对表单的引用传递给其他类,以便它们可以修改事物(紧密耦合)。所以从本质上讲,有很多方法可以做很多事情,很多人只是在讨论糟糕的设计。

我只是想知道哪些语言(如果有的话)更多在做事方面有限,以致他们迫使程序员使用更好的设计原则?
I want to spend two minutes on my soapbox.

I love C#. I am so productive in it it''s ridiculous. But it''s so easy to
write code that uses poor design principles. Example: just making
variables public instead of using properties. Another example: passing
references to forms to other classes so they can modify things (tight
coupling). So in essence, there are so many ways to do things that many of
them are just flat-out poor designs.

I''m just wondering what languages (if any) are more limited in the ways to
do things so that they force the programmer to use better design principles?



这篇关于C#作为编程语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆