|
That is precisely the point of the ReadOnlyReference modifier, which you would discover if you read that article all the way to the end.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
Which one? The article from 2017, talking about the in modifier and readonly struct s, which have already been released? Or the infoworld "subscriber only" article, which can't be read without signing up?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The article that you cited, about the in modifier is very explicit in it summary.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
Did I ever mention that I like C++?
... such stuff as dreams are made on
|
|
|
|
|
I use C++ from time to time, too, but how is that related to this thread?
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
It also solves some sticky issues when you want to ensure that a method cannot modify contents of an object. It would have been a lot of work before to protect data in an object so that it could not be modified. You would have to basically deep clone it and use the clone.
|
|
|
|
|
Especially given that you may need only a subset of its methods and properties, it's often easier to create and adapter that exposes the needed methods as read only properties of itself, and forwards the required methods to the private instance which it adapts. It's usually straightforward to create a basic adapter to meet an immediate need, which can subsequently be extended to support more read only properties and/or forwarded methods.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
If an adapter makes sense, then yes you can, but that may be a lot of adapters if there are many levels that need to be created for different objects, and if adapter does not make sense, them may be increasing maintenance significantly as need to provide different access to methods and properties.
|
|
|
|
|
All the better! If ReadOnlyReference enables you to dispense with multiple adapters, you are further ahead of the game in reducing code bloat. However, I usually prefer to extend an existing adapter over creating a new one, especially if the extension just adds a property. The exception to that rule is if that property is hidden to prevent information disclosure or leakage.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
David A. Gray wrote: lots of branches that add little value, and the extra objects make the assembly bigger
Don't worry, we'll never need more than 640K of RAM!
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Why does PHP not have mutable constants?[^]
Uh...
(Found through WTDWTF)
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
The WTF for me was in the comments. It exists.[^] Just... why? ![Confused | :confused:](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_confused.gif)
|
|
|
|
|
I wonder what problem somebody had that the only solution was to make constants mutable
|
|
|
|
|
I cry a little when I think of the years that I wasted on that language.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
PHP and JavaScript are remarkably similar, especially in the ways that make both so malleable, at the cost of being dangerous in unskilled hands.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
What do you get if you cross an Elephant with a rhinocerous?
"Elefino!
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
I just wanted to see why I should go to Office 2016 and found this: 13+ Reasons You Should Upgrade to Microsoft Office 2016[^].
Looking at it I just could not see any justification. I would love it if they would allow you to use C# or Visual Basic instead of vba for macro programming. I recently did some coding and it was such a pain because vba now has very little in common with even Visual Basic.
I would like to have a more reasonable listing for addresses, phone numbers, email address, etc. You cannot have an arbitrary number and no custom labels. Also the display is just as rigid as it was in 1997.
The location on the appointments has no flexibility, such as being able to use web lookups for things like restaurants, or local lookups for items in your address book.
What the hell has Microsoft Office group been doing for the last 20 years. Not much from what I can tell.
|
|
|
|
|
|
This is why Office365 is sold on a subscription basis. They have made so few real enhancements to Office over the years many people just don't update it. I have an old version, about that age actually, that works just fine for me and it will not be updated.
|
|
|
|
|
The only reason to go as high as 2007 in my mind is that is when they started using XAML for storage. Sure to have compatibility with programs that access the files.
I upvoted you.
|
|
|
|
|
I'm still on Office 2007. It's paid for. I don't see why I should pay repeatedly for 'features' that I'll never use. Also (and I hate to admit it but), all of my 'home' applications (media library, contacts list, accounts, etc) are written in MS-Access because it has a reasonable database for single user usage, good front-end, and adequate programmability - or at least it was in 2000 when I originally wrote them (in Office 97). I can get a free database engine and write everything in a free language e.g. C#; but what is the point of rewriting something that has work well for nearly two decades and any mods can be done directly in one place without needing compilers etc; especially just so I can pay for unwanted features. So, I agree with the others who say stick with Office 2007- I'm beginning to get used to the new (in 2003) ribbon UI as the old menu short cuts still work.
|
|
|
|
|
Actually I am on 2016, but that is only because I basically got it for free. Was on 2010 for the longest time.
Ribbon was the stupidest thing that Microsoft ever came up with. Basically just a fancy toolbar, and when originally implemented did not even have the ability to customize which absolutely sucked since they got rid of the menus and the only way to get to things was the Ribbon. Ribbon is fine for simple programs, but for complex ones it just has its limitations. Funny is that you see menus all the time in web apps including this one (codeproject).
I also use access. It does what it needs to do in one nice compact file which includes the macros. My problem is that, as stated, VBA is so different from anything current and struggled significantly with the syntax.
|
|
|
|
|
jsc42 wrote: and I hate to admit it but
It's a real pity that Access gets such a bad reputation around here when, as you mention, it works quite well for single-user apps...especially as just a simple datastore, without the VBA. Since we're confessing, my company still offers Access (v. 2002) as a database option for smaller customers.
In fact, I'm aware of one company that still uses access 97 for a commercial inventory system.
"Go forth into the source" - Neal Morse
|
|
|
|
|
The first company I worked for, had the whole personal management for worked hours / holidays and so on in Access for all 20+ workers.
It worked quite fine, I had only one problem in the over 2 years I worked there.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|