Click here to Skip to main content
15,892,674 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Another code for thought: public members Pin
Super Lloyd30-Oct-18 1:21
Super Lloyd30-Oct-18 1:21 
GeneralRe: Another code for thought: public members Pin
CPallini30-Oct-18 1:41
mveCPallini30-Oct-18 1:41 
GeneralRe: Another code for thought: public members Pin
Super Lloyd30-Oct-18 1:53
Super Lloyd30-Oct-18 1:53 
GeneralRe: Another code for thought: public members Pin
Pete O'Hanlon30-Oct-18 1:14
mvePete O'Hanlon30-Oct-18 1:14 
GeneralRe: Another code for thought: public members Pin
Super Lloyd30-Oct-18 1:19
Super Lloyd30-Oct-18 1:19 
GeneralRe: Another code for thought: public members Pin
Eric Lynch30-Oct-18 2:30
Eric Lynch30-Oct-18 2:30 
GeneralRe: Another code for thought: public members Pin
Marc Clifton30-Oct-18 2:39
mvaMarc Clifton30-Oct-18 2:39 
GeneralRe: Another code for thought: public members Pin
RandyBuchholz30-Oct-18 4:56
RandyBuchholz30-Oct-18 4:56 
I think keeping an interface perspective on Public is the right approach. But I differ on:
Quote:
Ideally, I really dislike properties / fields. Properties == state
I do see Fields as state, and (more then dislike) think public fields are pure evil Smile | :) . So by extension public int Foo {get; set;} supports your view on Properties. I view Properties (setters specifically) more as requests for "conditions" (i.e., a collection of states) => "put yourself in this condition". I see methods as requests for actions => "do this thing", (your condition becomes a side effect). So I don't think it is the tool (Property) that has issues - directly changing state, either through Property or Method, raises flags - the problem is the idea of directly changing individual state parameters. Like you said,
Quote:
pass everything that a method needs into the method and have it return everything that the caller needs
Though if the intent of the method is to change the condition of an object only (with void return), expressing that as a Property can, IMHO, add additional context to your intent.

I think the common 1:1 use of properties and fields has tainted the real value of properties, and obscured that they are really just another method syntax. Great Threads article BTW.
GeneralRe: Another code for thought: public members Pin
RandyBuchholz30-Oct-18 4:04
RandyBuchholz30-Oct-18 4:04 
GeneralRe: Another code for thought: public members Pin
David Crow30-Oct-18 4:17
David Crow30-Oct-18 4:17 
GeneralRe: Another code for thought: public members Pin
patbob30-Oct-18 6:01
patbob30-Oct-18 6:01 
GeneralRe: Another code for thought: public members Pin
Gary Wheeler30-Oct-18 6:03
Gary Wheeler30-Oct-18 6:03 
GeneralRe: Another code for thought: public members Pin
Mark_Wallace30-Oct-18 22:28
Mark_Wallace30-Oct-18 22:28 
GeneralWSO CCC OTD 2018-10-30 Pin
OriginalGriff29-Oct-18 22:57
mveOriginalGriff29-Oct-18 22:57 
AnswerRe: WSO CCC OTD 2018-10-30 Pin
megaadam29-Oct-18 23:15
professionalmegaadam29-Oct-18 23:15 
GeneralRe: WSO CCC OTD 2018-10-30 - We have a winner! Pin
OriginalGriff29-Oct-18 23:18
mveOriginalGriff29-Oct-18 23:18 
GeneralRe: WSO CCC OTD 2018-10-30 Pin
Mark Parity29-Oct-18 23:15
Mark Parity29-Oct-18 23:15 
GeneralRe: WSO CCC OTD 2018-10-30 Pin
OriginalGriff29-Oct-18 23:19
mveOriginalGriff29-Oct-18 23:19 
GeneralC# code survey Pin
Super Lloyd29-Oct-18 21:37
Super Lloyd29-Oct-18 21:37 
GeneralRe: C# code survey Pin
Jacquers29-Oct-18 21:56
Jacquers29-Oct-18 21:56 
GeneralRe: C# code survey Pin
#realJSOP30-Oct-18 6:08
mve#realJSOP30-Oct-18 6:08 
GeneralRe: C# code survey Pin
Wastedtalent29-Oct-18 22:04
professionalWastedtalent29-Oct-18 22:04 
GeneralRe: C# code survey Pin
CPallini29-Oct-18 22:06
mveCPallini29-Oct-18 22:06 
GeneralRe: C# code survey Pin
Jörgen Andersson29-Oct-18 22:23
professionalJörgen Andersson29-Oct-18 22:23 
GeneralRe: C# code survey Pin
CPallini29-Oct-18 22:37
mveCPallini29-Oct-18 22:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.