Redian新闻
>
好像c#为了DotNet牺牲了不少
avatar
好像c#为了DotNet牺牲了不少# DotNet - 窗口里的风景
g*e
1
例如引入了Properties这样没什么用处的东西?
avatar
g*e
2
刚刚开始接触c#, 望各位先进拍砖

【在 g******e 的大作中提到】
: 例如引入了Properties这样没什么用处的东西?
avatar
l*s
3
welcome and
等版砖吧. hehe

【在 g******e 的大作中提到】
: 刚刚开始接触c#, 望各位先进拍砖
avatar
N*n
4
Properties are necessary when data binding.

【在 g******e 的大作中提到】
: 例如引入了Properties这样没什么用处的东西?
avatar
g*e
5
As I understand it is mainly for VB compatibility... For C# itself I don't
see the need.

【在 N********n 的大作中提到】
: Properties are necessary when data binding.
avatar
d*q
6
if you use java you usually have to write dual get/set method.
that causes some cumbersome

【在 g******e 的大作中提到】
: 例如引入了Properties这样没什么用处的东西?
avatar
s*u
7
有什么不一样吗?property的话还要记住不同的格式

【在 d***q 的大作中提到】
: if you use java you usually have to write dual get/set method.
: that causes some cumbersome

avatar
d*d
8
C#3.0有default property(不知道是不是这个名字)

【在 s****u 的大作中提到】
: 有什么不一样吗?property的话还要记住不同的格式
avatar
f*e
9
property有什么不同的格式?

【在 s****u 的大作中提到】
: 有什么不一样吗?property的话还要记住不同的格式
avatar
g*e
10
In the time of great IDEs those code can be auto generated. But the language
itself looks more clean. This is only my own opinion. If you can live with
one keyword don't create two. :-)

【在 d***q 的大作中提到】
: if you use java you usually have to write dual get/set method.
: that causes some cumbersome

avatar
g*e
11
He said property and getter/setter are two different formats.

【在 f*****e 的大作中提到】
: property有什么不同的格式?
avatar
G*O
12
exactly.

language
with

【在 g******e 的大作中提到】
: In the time of great IDEs those code can be auto generated. But the language
: itself looks more clean. This is only my own opinion. If you can live with
: one keyword don't create two. :-)

avatar
L*r
13
按照你的逻辑其实ctor在C#和java 中也是没什么用处的东西.

【在 g******e 的大作中提到】
: 例如引入了Properties这样没什么用处的东西?
avatar
l*a
14
accessor methods (get/set): 2 interfaces
property: one interface for two behaviors (get and set).
A type of polymorphism?
avatar
g*e
15
确实是这样,感觉C#冗余的keywords是比较多。可能是我比较习惯Java的缘故

【在 L*********r 的大作中提到】
: 按照你的逻辑其实ctor在C#和java 中也是没什么用处的东西.
avatar
c*e
16
care to share an example?

【在 g******e 的大作中提到】
: 确实是这样,感觉C#冗余的keywords是比较多。可能是我比较习惯Java的缘故
avatar
c*e
17
http://www.javalobby.org/java/forums/t90862.html
i didn't read all of it but it seems relevant

【在 g******e 的大作中提到】
: 确实是这样,感觉C#冗余的keywords是比较多。可能是我比较习惯Java的缘故
avatar
g*e
18
readonly
new (as a modifier)
sealed
I know they all have their usage and meanings. It looks like the designer of
C# likes to give only one meaning for a keyword other than make fewer
keywords but give them different meanings in different situations.

【在 c**e 的大作中提到】
: care to share an example?
avatar
c*e
19
i think the idea is to make things very explicit to
cut down on errors and confusion. also, i think keywords
like readonly and sealed are more descriptive of
their nature and thus are more readable.

of

【在 g******e 的大作中提到】
: readonly
: new (as a modifier)
: sealed
: I know they all have their usage and meanings. It looks like the designer of
: C# likes to give only one meaning for a keyword other than make fewer
: keywords but give them different meanings in different situations.

avatar
b*n
20
我不给你举了好多例子了吗,我说的话你总忘

【在 c**e 的大作中提到】
: care to share an example?
avatar
b*n
21

不同意
同意
不同意
of
其实最无聊的是property还有几个其他的。

【在 g******e 的大作中提到】
: readonly
: new (as a modifier)
: sealed
: I know they all have their usage and meanings. It looks like the designer of
: C# likes to give only one meaning for a keyword other than make fewer
: keywords but give them different meanings in different situations.

avatar
g*e
22
Hehe, I don't in Java world there is a cry for property. :-))
I actually don't agree even with the first statement of the article.
"Developers arguing against properties typically fall into two categories.
There are those who oppose language changes in general and those who don't
want it simply because C# has them."
I think most people against it are not in either of these two categories.
Most people just want to keep the language simple and neat (less is more. :-
))

【在 c**e 的大作中提到】
: http://www.javalobby.org/java/forums/t90862.html
: i didn't read all of it but it seems relevant

avatar
g*e
23
I agree. This is one approach of language design.
But sometime if one keyword has its natural meanings in different scenarios
maybe it is good to save some words. :-)
Like in Java, final can be used to define a constant, or if it is in front
of a method it means the method can not be overwritten.
Anyway, both approaches are fine. They are just the preference of the
designers and we have to follow.

【在 c**e 的大作中提到】
: i think the idea is to make things very explicit to
: cut down on errors and confusion. also, i think keywords
: like readonly and sealed are more descriptive of
: their nature and thus are more readable.
:
: of

avatar
l*s
24

scenarios
This is definitely something .net try to avoid and the part I like: simple,
foolproof,robust and powerful.
Overall, I like c# much better than JAVA.

【在 g******e 的大作中提到】
: I agree. This is one approach of language design.
: But sometime if one keyword has its natural meanings in different scenarios
: maybe it is good to save some words. :-)
: Like in Java, final can be used to define a constant, or if it is in front
: of a method it means the method can not be overwritten.
: Anyway, both approaches are fine. They are just the preference of the
: designers and we have to follow.

avatar
c*e
25
咦,我说在哪里看见过你,原来是在这里。。

front

【在 l*s 的大作中提到】
:
: scenarios
: This is definitely something .net try to avoid and the part I like: simple,
: foolproof,robust and powerful.
: Overall, I like c# much better than JAVA.

avatar
L*r
26
internally, property is nothing but setter/getter.
you can argue that property does not bring too much to your class
implementation. but property is a syntax sugar to the client code which use
your class.
C#确实有很多的keywords. a lot of them are syntax sugar. 大部分还是很make
sense.

【在 g******e 的大作中提到】
: 确实是这样,感觉C#冗余的keywords是比较多。可能是我比较习惯Java的缘故
avatar
s*u
27
是啊,用起来很不爽,不知道他为什么有时候提供几种做同一个事情的方法

【在 g******e 的大作中提到】
: 确实是这样,感觉C#冗余的keywords是比较多。可能是我比较习惯Java的缘故
avatar
k*i
28
I assumed that you are comparing public variable and property. Think about
the followings:
1. What if you want to make a field readonly to other classes while writable
in the in the class it's defined.
2. What if you want to do something else(logging some information for
example) before writing to the field?
3. Think about the differences in reflection, intellisense and the
generation of the library documentation

【在 s****u 的大作中提到】
: 是啊,用起来很不爽,不知道他为什么有时候提供几种做同一个事情的方法
avatar
s*u
29
你的assume不成立啊,我只是说它的api比较臃肿

writable

【在 k****i 的大作中提到】
: I assumed that you are comparing public variable and property. Think about
: the followings:
: 1. What if you want to make a field readonly to other classes while writable
: in the in the class it's defined.
: 2. What if you want to do something else(logging some information for
: example) before writing to the field?
: 3. Think about the differences in reflection, intellisense and the
: generation of the library documentation

avatar
c*e
30
to evaluate an api fairly, you have to take into account
what users it targets. remember one of the goals
of .net is to bring users of different programming
languages to this common platform. it has to support
multiple programming styles to avoid imposing a
particular style on its users. with java this is
a non-problem because there's only one language,
so the language designer has much less to worry about
in terms of style.
i'm not sure why you think the api is too fat. someone
might be able to

【在 s****u 的大作中提到】
: 你的assume不成立啊,我只是说它的api比较臃肿
:
: writable

avatar
s*u
31
是这样的吗?我说的那个我只是有点印象,C#我一点都不熟
因为我最近做一些有review打分的东西,做C#的特别郁闷,因为很多函数
都要不停msdn来msdn去(因为一直被review说我哪里哪里这样写效率高,哪里哪里
这样写可以少写两句话扣分),相对来说java的api给我的感觉很好
不过为了钱。。。。 -_-

【在 c**e 的大作中提到】
: to evaluate an api fairly, you have to take into account
: what users it targets. remember one of the goals
: of .net is to bring users of different programming
: languages to this common platform. it has to support
: multiple programming styles to avoid imposing a
: particular style on its users. with java this is
: a non-problem because there's only one language,
: so the language designer has much less to worry about
: in terms of style.
: i'm not sure why you think the api is too fat. someone

avatar
a*t
32
re
avatar
c*s
33
I'm familiar with c#/.net and unfamiliar with java and I would say the exact
opposite (c# feels better to me). But I also know enough to tell me that
java can do pretty much exactly what c# can do if I can find the right
libraries to use. MSDN does that very well for me for c#, anybody have a
place (outside your head) for java reference?

【在 s****u 的大作中提到】
: 是这样的吗?我说的那个我只是有点印象,C#我一点都不熟
: 因为我最近做一些有review打分的东西,做C#的特别郁闷,因为很多函数
: 都要不停msdn来msdn去(因为一直被review说我哪里哪里这样写效率高,哪里哪里
: 这样写可以少写两句话扣分),相对来说java的api给我的感觉很好
: 不过为了钱。。。。 -_-

avatar
i*c
34
sun api

exact

【在 c*********s 的大作中提到】
: I'm familiar with c#/.net and unfamiliar with java and I would say the exact
: opposite (c# feels better to me). But I also know enough to tell me that
: java can do pretty much exactly what c# can do if I can find the right
: libraries to use. MSDN does that very well for me for c#, anybody have a
: place (outside your head) for java reference?

avatar
i*c
35
java also has
finally like sealed
may not good example

of

【在 g******e 的大作中提到】
: readonly
: new (as a modifier)
: sealed
: I know they all have their usage and meanings. It looks like the designer of
: C# likes to give only one meaning for a keyword other than make fewer
: keywords but give them different meanings in different situations.

avatar
C*n
36
I guess we need to define "Computing Language". By the end of the day, "C#,
Java, VB ... etc" are supposed to serve the same purpose as Natural language
like English, Chinese, to computer of course. It enables you to give
specific instruction to a computer. But it needs to be able to easily
understood by human being also.
If you can live "one" keyword, don't create "two", that's good for computer.
But not good for humanbeing. Unfortunately the language is writen by
humanbeing, and has to be unde
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。