News for hackers. Stuff that matters.
Re:Coding Skill and the Decline of Stagnation by cstuder on Friday January 13, 2012 @03:12PM (#3462189)
No.

C# and Objective-C (And I assume similar languages too) can have public accessors which are not used like function. No need to add ()'s everywhere.

Re:Coding Skill and the Decline of Stagnation by InclinedPlane on Friday January 13, 2012 @03:21PM (#3462227)
The way current C# does accessors / properties is just about perfect, I wish more languages would adopt it.
Re:Coding Skill and the Decline of Stagnation by masklinn on Friday January 13, 2012 @06:08PM (#3462809)
> The way current C# does accessors / properties is just about perfect

As far as I'm concerned it's quite far from it, because C# still allows public fields, properties and fields are incompatible, properties and methods are separate and Microsoft specifies different naming conventions for fields on one hand and properties & methods on the other.

Perfection is Smalltalk's way of doing it.

And in a syntactic line closer to ALGOL, Ruby is about as good as it gets: no public fields, "properties" are normal methods (setters have a little bit of syntactic sugar, but not much) and auto-generating a bunch of getters, setters or both is a class-level method call.

Re:Coding Skill and the Decline of Stagnation by de90 on Friday January 13, 2012 @06:29PM (#3462869)
What is wrong with different naming conventions for fields vs. properties, and methods? It makes it immediately obvious what is what at a glance.

*Honest question - I first learned programming with C#, and so those conventions seem 'correct' to me.

Re:Coding Skill and the Decline of Stagnation by masklinn on Saturday January 14, 2012 @04:42AM (#3463903)
> What is wrong with different naming conventions for fields vs. properties, and methods? It makes it immediately obvious what is what at a glance.

Which is precisely one of the problems of properties in C#, it makes fields and properties look and feel extremely different from the outside which violates the uniform access principle.

As I noted, ideally C# should not have public fields in the first place.

Re:Coding Skill and the Decline of Stagnation by jarrett on Friday January 13, 2012 @06:35PM (#3462889)
I should have been more clear--I was referring to Java, which seems to be what the OP was talking about.
Re:Coding Skill and the Decline of Stagnation by adgar on Friday January 13, 2012 @03:51PM (#3462339)
You say "No." so defiantly, but the reality for Java - which is what everybody else was talking about in this thread and the article - the answer is quite often "Yes."