g******e 发帖数: 3760 | 1 例如引入了Properties这样没什么用处的东西? |
g******e 发帖数: 3760 | 2 刚刚开始接触c#, 望各位先进拍砖
【在 g******e 的大作中提到】 : 例如引入了Properties这样没什么用处的东西?
|
l*s 发帖数: 783 | 3 welcome and
等版砖吧. hehe
【在 g******e 的大作中提到】 : 刚刚开始接触c#, 望各位先进拍砖
|
N********n 发帖数: 8363 | 4 Properties are necessary when data binding.
【在 g******e 的大作中提到】 : 例如引入了Properties这样没什么用处的东西?
|
g******e 发帖数: 3760 | 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.
|
d***q 发帖数: 1119 | 6 if you use java you usually have to write dual get/set method.
that causes some cumbersome
【在 g******e 的大作中提到】 : 例如引入了Properties这样没什么用处的东西?
|
s****u 发帖数: 118 | 7 有什么不一样吗?property的话还要记住不同的格式
【在 d***q 的大作中提到】 : if you use java you usually have to write dual get/set method. : that causes some cumbersome
|
d****d 发帖数: 133 | 8 C#3.0有default property(不知道是不是这个名字)
【在 s****u 的大作中提到】 : 有什么不一样吗?property的话还要记住不同的格式
|
f*****e 发帖数: 5177 | 9 property有什么不同的格式?
【在 s****u 的大作中提到】 : 有什么不一样吗?property的话还要记住不同的格式
|
g******e 发帖数: 3760 | 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
|
|
|
g******e 发帖数: 3760 | 11 He said property and getter/setter are two different formats.
【在 f*****e 的大作中提到】 : property有什么不同的格式?
|
G*O 发帖数: 706 | 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. :-)
|
L*********r 发帖数: 92 | 13 按照你的逻辑其实ctor在C#和java 中也是没什么用处的东西.
【在 g******e 的大作中提到】 : 例如引入了Properties这样没什么用处的东西?
|
l*****a 发帖数: 166 | 14 accessor methods (get/set): 2 interfaces
property: one interface for two behaviors (get and set).
A type of polymorphism? |
g******e 发帖数: 3760 | 15 确实是这样,感觉C#冗余的keywords是比较多。可能是我比较习惯Java的缘故
【在 L*********r 的大作中提到】 : 按照你的逻辑其实ctor在C#和java 中也是没什么用处的东西.
|
c**e 发帖数: 2558 | 16 care to share an example?
【在 g******e 的大作中提到】 : 确实是这样,感觉C#冗余的keywords是比较多。可能是我比较习惯Java的缘故
|
c**e 发帖数: 2558 | 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的缘故
|
g******e 发帖数: 3760 | 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?
|
c**e 发帖数: 2558 | 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.
|
b*****n 发帖数: 2324 | 20 我不给你举了好多例子了吗,我说的话你总忘
【在 c**e 的大作中提到】 : care to share an example?
|
|
|
b*****n 发帖数: 2324 | 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.
|
g******e 发帖数: 3760 | 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
|
g******e 发帖数: 3760 | 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
|
l*s 发帖数: 783 | 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.
|
c**e 发帖数: 2558 | 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.
|
L*********r 发帖数: 92 | 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的缘故
|
s****u 发帖数: 118 | 27 是啊,用起来很不爽,不知道他为什么有时候提供几种做同一个事情的方法
【在 g******e 的大作中提到】 : 确实是这样,感觉C#冗余的keywords是比较多。可能是我比较习惯Java的缘故
|
k****i 发帖数: 1072 | 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 的大作中提到】 : 是啊,用起来很不爽,不知道他为什么有时候提供几种做同一个事情的方法
|
s****u 发帖数: 118 | 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
|
c**e 发帖数: 2558 | 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
|
|
|
s****u 发帖数: 118 | 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
|
a*******t 发帖数: 47 | |
c*********s 发帖数: 85 | 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给我的感觉很好 : 不过为了钱。。。。 -_-
|
i***c 发帖数: 301 | 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?
|
i***c 发帖数: 301 | 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.
|
C****n 发帖数: 2324 | 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 |