Subject: Oz Alert: Wrinkle discovery

From: Erase Fine Lines <[email-masked]>
Date: Wed, 14 May 2014 12:20:48 -0700

Get Ready to Travel Back in Time with DocOz . . . 

He's showing us how to look 20 years younger
In just 1 MONTH: 

** DocOz figured out a way to take 20-years off your face **
It took one determined doctor to figure out Celebs were secretly doing.

Heres the explanation for this insane transformations in Hollywood ->

/ http://www.buthen.com/Oz/Skincare/20yrs/younger.video

QZW Connections message settings http://www.buthen.com/hnfg.sgnf 
158 A v e c o r  Dr Vonore, Tennessee 37885

or I break your legs (or mine) (as he wanna prevent himself too)   Raphal Althaus Apr 14 at 6:58
  	  	
Haha. It is great solution. It's not completely solve the problem, but I don't think there is a way to do it better then this, so I will mark this answer as correct. Thanks    edencore Apr 14 at 7:04
2	  	
@edencore side note: you could probably use Roslyn to implement an exact "find all illegal field usage and warn about them" - the problem, though, is defining "illegal field usage" vs "legal field usage"   Marc Gravell Apr 14 at 7:22
  	  	
Another (equally ugly) approach would be to rename the field, for example private string textNoSanitationWhenWrittenToDontUseWeWillBreakYouegs;.   Jeppe Stig Nielsen Apr 14 at 7:43
This is true, however it is just another allocation. If one more allocation on the class is going to break your heart you can make the class a struct and then you're back to a single allocation for Setter and the string reference text. 99% of the time, for 99% of the software folks write, the extra allocation matters less than keeping the intent of the code honest. We don't all suffer Assult by GC, few of us work with StackOverflow type volumes :p   Binary Worrier Apr 14 at 9:56
  	  	
 . . with the obvious caveat that you'd need to implement the struct properly (i.e. as an immutable type), which means you're back to an allocation for every assignment . . . maybe don't make the class a struct.   Binary Worrier Apr 14 at 10:17
  	  	
creating a new struct each time is not an allocation; the size would be the size of the contained data, presumably a single string reference - so no larger than the original   Marc Gravell Apr 14 at 10:36
  	  	
So something like this.myDate = new DateTime(2014, 04, 14); doesn't cause an allocation? This I did not know. It looks like it does, the new to create a new struct, which would then be copied over the old. I may look into this and see how it actually works, thanks.   Binary Worrier Apr 14 at
@MarcGravell: indeed, there is one function set that is privileged since it is permitted to modify text and no other function is. One further function get is permitted to read but not write. That's the concept to be captured, but I don't know the state of the art in expressing that for static code analysis to enforce. Other than Binary Worrier's answer, of course, which expresses it neatly in language the compiler already understands.   Steve Jessop Apr 14 at 9:39 
  	  	
@Marc: With the utmost respect (and you do indeed have my utmost respect mate), see my comment on this answer of an old duplicate of this question :) stackoverflow.com/a/1299268/18797   Binary Worrier Apr 14 at 10:13
1	  	
@BinaryWorrier I followed that link hoping for an explanation rather than just "you should be shot"...   Rawling Apr 14 at 11:15
  	  	
@Rawling That's why it's funny   Binary Worrier Apr 14 at 11:25
  	  	
@BinaryWorrier somebody who is touching the internals of the same class is already implicitly inside the usual protection barriers...   Marc Gravell Apr 14 at 11:36
  	  	
Grand, but I still think this is a bad way to prevent the field from being accessed directly. The warning is only useful if 1) the dev checks the warnings 2) decides to heed the warning. I wouldn't use a hint to get you to do the right thing, when I can force you to do the right thing. If I thought every developer would look for and heed the warning, I'd probably trust them to look an inteli-sense comment. /// Use Text property, not this field would very nearly be as effective. I'd get the compiler to enforce this, not issue hints. My 2 cents.   Binary Worrier Apr 14 at 11:47