- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Edit Admin
My money is on this being a WTF.
But it is conceivable that it can be used to change the collection size in much the same way that StringBuilder.Length is used. I have on occasion used StringBuilder for doing things like comma separated lists where the last item must not have a comma and I can achieve it like so:
Edit Admin
My best guess would be that it began life as a sort of proto-C++, back well before the arrival of C++98's STL, or maybe even just plain C, and was then "ported" to C-flat, and management said, "You shall port all the old code, really all of it. We'll get someone from outside to audit what you did, and if the auditors find anything that wasn't ported, there will be seventy-three kinds of Hell to pay!" So they did exactly what they were told, and left nothing of the old code out of the port, for fear that management really meant "three hundred seventy" when they said "seventy-three".
No, wondering about it is not a WTF. Well, maybe it is. Maybe the correct verb is "despair"...
Edit Admin
I mean, writable length properties are not really that special, System.IO.Stream has one of those as well, as do various builders like StringBuilder.
Edit Admin
A lot of people just automatically make getters and setters for all properties because they don't really know why they're supposed to have private variables.