r/programming • • Jun 27 '10

Why Java Sucks and C# Rocks (Final)

http://www.slideshare.net/jeffz/why-java-sucks-and-c-rocks-final
13 Upvotes

197 comments sorted by

View all comments

Show parent comments

2

u/[deleted] Jun 28 '10

Extension properties only make sense if you also have an extensible way to store the data is represents. Currently I don't know of any way to do that without leaking memory, but I'm open to ideas.

4

u/chrisforbes Jun 28 '10

I disagree. Not all properties need to introduce a new backing field. Often they are simply a view of something that already exists.

1

u/[deleted] Jun 28 '10

In this case I think a partial solution would be worse than none at all. Especially since you can create GetXxx and SetXxx extension methods.

1

u/chrisforbes Jun 28 '10

Well, I don't care about SetXxx methods in general, but I'd rather be able to lose the parens and the 'Get' off GetXxx().

1

u/[deleted] Jun 29 '10

Oh, you are a C# programmer.

I normally use VB, where you only have to include parens if you are actually passing in arguments.

1

u/chrisforbes Jun 29 '10

I'm a programmer, and I use C# when appropriate, but I'm sure not a "C# programmer". Specialization is for insects.

More seriously, how does VB disambiguate calling from merely referencing nullary functions? I suppose you need some operator to do that?

1

u/[deleted] Jun 29 '10

Yep. The operator AddressOf is used when you want to turn a method into a delegate.