![Delphi constant set](https://kumkoniak.com/19.jpg)
![delphi constant set delphi constant set](https://www.chiefdelphi.com/uploads/default/original/3X/f/8/f8f270b580ce9d6142d096fb25fa3264baa0c3bc.jpeg)
Or maybe eschew prefixes altogether and use fully qualified references: this.name. Use a distinction that looks and reads different: m_name, _name.
![delphi constant set delphi constant set](http://etutorials.org/shared/images/tutorials/tutorial_110/fig12_02.jpg)
![delphi constant set delphi constant set](https://i.pinimg.com/736x/de/08/0f/de080fcc0239676d535fd06630959a14.jpg)
I don't want to reopen the whole case sensitivity debate, but using case to distinguish between variables is borderline irresponsible programming. The difference between name and Name is subtle at best. Distinguishing public and private using only case is an accident waiting to happen.Couldn't we ditch variables entirely in favor of properties? Don't properties do exactly the same thing as variables, but with better granular control over visibility? However, if the distinction between variable and property is such an ongoing problem, I wonder if a more radical solution is in order. Kevin Dente proposed a bit of new syntax that would give us the best of both worlds: It's a shame there's so much meaningless friction between variables and properties most of the time they do the exact same thing. Changing a variable to a property is a breaking change.properties, so if you rely on reflection, it's easier to use all properties. Reflection works differently on variables vs.Update: As many commenters have pointed out, there are valid reasons to make a trivial property, exactly as depicted above: If you truly need a property, then use a property. You can always refactor this later into a property if it turns out additional work needs to be done when the name value is set. Why waste everyone's time with a bunch of meaningless just-in-case wrapper code? Start with the simplest thing that works- a public variable. When is a property not a property? When it's a glorified public variable.I occasionally see code with properties like this:Īs I see it, there are three things to consider here.
![Delphi constant set](https://kumkoniak.com/19.jpg)