Hungarion Notation已经出局但是...... [英] Hungarion Notation is out but..

查看:101
本文介绍了Hungarion Notation已经出局但是......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hungarion Notation已经出局但是..


我试图保持命名事物的概念它就是这样,命名为

那个


班级名称是一个有趣的一面。如果我们以有意义的方式命名它们并且

那么我们以一种有意义的方式命名一个实例,最终会有一个

语义冲突。

例如,


以VB6方式

dim oUser as new clsUser


In a .Net方式

dim用户作为新用户


当我阅读vb6示例时,无论我是否参考
,它都会向我跳出来
类型或实例。在.Net方式中,我不确定只是阅读它。

(我在类型或使用

实例的函数中使用静态函数)。 br />

我很想在后缀类型或前缀实例。但那就是现在没有.net的精神了。我是否应该习惯不立即

识别实例和类型之间的区别?


谢谢,

jeff

Hungarion Notation is out but..

I am trying to keep the notion of naming things "it is what it is, name it
that"

Class Names are an interesting side. If we name them in a meaningful way and
then we name an instance of in a meaningful way there will ultimately be a
semantic collision.

For example,

In a VB6 way
dim oUser as new clsUser

In a .Net way
dim User as new User

When I read vb6 example, it jumps out at me whether I am refering to the
type or the instance. In the .Net way I am not sure from just reading it.
(am I using a static function in a type or a function that uses an
instances).

I am tempted to either suffix the type or prefix the instance. But thats
not in the spirit of .net now. Should I just get used to not immediately
recognizing the difference between an instance and a type?

thanks,
jeff

推荐答案

因为什么时候匈牙利语符号出来了?我们一直在代码中使用它,并且每个我们使用过的主要开发人员都会使用它。

" Jeff Jarrell" < JJ ************ @ yahoo.com>在消息中写道

news:uH ************* @ TK2MSFTNGP12.phx.gbl ...
since when is hungarian notation out? We use it all the time in code, and
every major dev we''ve worked with uses it.
"Jeff Jarrell" <jj************@yahoo.com> wrote in message
news:uH*************@TK2MSFTNGP12.phx.gbl...
Hungarion Notation已经出来但是。 。

我试图保持命名事物的概念它就是它的名字,命名为


类名是一个有趣的一面。如果我们以有意义的方式命名它们然后我们以有意义的方式命名一个实例,那么最终将会发生语义冲突。

例如,

以VB6的方式用作新的clsUser昏暗的用户

以.Net的方式
昏暗的用户作为新用户

当我读到例如,无论我是在引用
类型还是实例,它都会向我跳出来。在.Net方式中,我不确定只是阅读它。
(我在一个类型或使用
实例的函数中使用静态函数)。

我我试图为后缀类型或前缀实例。但那不是现在的.net精神。我是否应该习惯不立即认识到实例和类型之间的区别?

谢谢,
jeff
Hungarion Notation is out but..

I am trying to keep the notion of naming things "it is what it is, name it
that"

Class Names are an interesting side. If we name them in a meaningful way
and then we name an instance of in a meaningful way there will ultimately
be a semantic collision.

For example,

In a VB6 way
dim oUser as new clsUser

In a .Net way
dim User as new User

When I read vb6 example, it jumps out at me whether I am refering to the
type or the instance. In the .Net way I am not sure from just reading it.
(am I using a static function in a type or a function that uses an
instances).

I am tempted to either suffix the type or prefix the instance. But thats
not in the spirit of .net now. Should I just get used to not immediately
recognizing the difference between an instance and a type?

thanks,
jeff


< br>

这不是我自己发明的想法。我已经在许多书中读过它(.net\hungarion

),第一次看到它时我的眼睛突然出现,

但实际上我找到了除了少数例外,我对这种风格很满意。

我不会转换现有的代码库或更改

继续代码库的编码约定。


但是我在工作中开始一个与

过去无关的新代码库。所以我试图保持.net惯例的精神。你可能想看看FXCop
。不过,我发现它对我的品味来说过于僵化了。


这是一个很好的讨论,不管是不是由于理查德·哈尔·肖(David Hale Shaw)。
http://www.richardhaleshawgroup.com/。 .. 03/03/20.aspx


jeff


" Brian Henry" <无**** @ newsgroups.com>在消息中写道

新闻:uM ************* @ TK2MSFTNGP09.phx.gbl ...
This isn''t a thought of my own invention. I have read it (.net\hungarion
not) in a number of books and my eyes popped out the first time I read it,
but in practice I found that with a few exceptions I am ok with this style.
I wouldn''t convert an existing codebase or change coding conventions on a
continuing codebase.

But I am starting a new codebase at work that has nothing to do with the
past. So I am trying to stay in the spirit of the .net conventions. You
might want to look at FXCop. I find it way too rigid for my taste, though.

Here is a good discussion of hungarion\not by Richard Hale Shaw.
http://www.richardhaleshawgroup.com/.../03/03/20.aspx

jeff

"Brian Henry" <no****@newsgroups.com> wrote in message
news:uM*************@TK2MSFTNGP09.phx.gbl...
因为什么时候匈牙利语符号出来?我们一直在代码中使用它,并且我们使用过的每个主要开发人员都使用它。

" Jeff Jarrell" < JJ ************ @ yahoo.com>在消息中写道
新闻:uH ************* @ TK2MSFTNGP12.phx.gbl ...
since when is hungarian notation out? We use it all the time in code, and
every major dev we''ve worked with uses it.
"Jeff Jarrell" <jj************@yahoo.com> wrote in message
news:uH*************@TK2MSFTNGP12.phx.gbl...
Hungarion Notation已经出局但是..

我正在努力保持命名事物的概念,它就是它的名字,这就是它的名字

类名是一个有趣的一面。如果我们以有意义的方式命名它们然后我们以有意义的方式命名一个实例,那么最终将会发生语义冲突。

例如,

以VB6的方式用作新的clsUser昏暗的用户

以.Net的方式
昏暗的用户作为新用户

当我读到例如,无论我是在引用
类型还是实例,它都会向我跳出来。在.Net方式中,我不确定只是阅读
它。 (我在使用
实例的类型或函数中使用静态函数)。

我很想在后面添加类型或为实例添加前缀。但那不是现在的.net精神。我是否应该习惯不立即认识到实例和类型之间的区别?

谢谢,
jeff
Hungarion Notation is out but..

I am trying to keep the notion of naming things "it is what it is, name
it that"

Class Names are an interesting side. If we name them in a meaningful way
and then we name an instance of in a meaningful way there will ultimately
be a semantic collision.

For example,

In a VB6 way
dim oUser as new clsUser

In a .Net way
dim User as new User

When I read vb6 example, it jumps out at me whether I am refering to the
type or the instance. In the .Net way I am not sure from just reading
it. (am I using a static function in a type or a function that uses an
instances).

I am tempted to either suffix the type or prefix the instance. But thats
not in the spirit of .net now. Should I just get used to not immediately
recognizing the difference between an instance and a type?

thanks,
jeff




" Jeff Jarrell" < JJ ************ @ yahoo.com> schrieb:
"Jeff Jarrell" <jj************@yahoo.com> schrieb:
这不是我自己发明的想法。我已经在很多书中读过它(.net\hungarion
),第一次看到它时我的眼睛突然出现了,但实际上我发现除了少数例外我还好有了这种风格。我不会在一个持续的代码库上转换现有的代码库或更改编码
约定。

但是我在工作中开始一个与
无关的新代码库。过去。所以我试图保持.net惯例的精神。你可能想看看FXCop。我觉得这样的方式对我来说太过刻板了。



这是一个关于Hungarion的好讨论,而不是Richard Hale Shaw。
http://www.richardhaleshawgroup.com/。 .. 03/03/20.aspx
This isn''t a thought of my own invention. I have read it (.net\hungarion
not) in a number of books and my eyes popped out the first time I read it,
but in practice I found that with a few exceptions I am ok with this
style. I wouldn''t convert an existing codebase or change coding
conventions on a continuing codebase.

But I am starting a new codebase at work that has nothing to do with the
past. So I am trying to stay in the spirit of the .net conventions. You
might want to look at FXCop. I find it way too rigid for my taste,
though.

Here is a good discussion of hungarion\not by Richard Hale Shaw.
http://www.richardhaleshawgroup.com/.../03/03/20.aspx




在讨论使用匈牙利表示法是否合理之前

重要的是我们要确保我们都指的是同一件事:


使错误的代码看起来错误

< URL:http:// www.joelonsoftware.com/articles/Wrong.html>


我不认为Charles Simonyi介绍的匈牙利乐谱

完全过时了,甚至没有严格的打字和OO让它过时。


-

MS Herfried K. Wagner

MVP< URL :http://dotnet.mvps.org/>

VB< URL:http://classicvb.or g / petition />



Before discussing whether or not using the Hungarian Notation makes sense
it''s important we make sure that we are all referring to the same thing:

Making Wrong Code Look Wrong
<URL:http://www.joelonsoftware.com/articles/Wrong.html>

I don''t think that the Hungarian Notation as introduced by Charles Simonyi
is completely obsolete, not even strict typing and OO make it obsolete.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


这篇关于Hungarion Notation已经出局但是......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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