- 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
Admin
I once worked with someone like that, but never asked. There are times when I feel I need to distinguish some central object undergoing some transformation and "the" then seems like an option. However, most times, a better name can be found or is actually not necessary after all.
Edit Admin
Waay back when I was first learning tht new-fangled OO stuff, I'd encounter lines like
List list - new List ; declare a shiny new ListAnd it would really mess with my head. Because I was just transitioning from pe-OO languages that were case insensitive, or more accurately from languages and input systems that were all UPPERCASE.
So a) I wasn't used to even noticing the casing of words, and b) the idea of variable named the same as their type just felt dangerously ambiguous.
Mostly separate comment:
All around codebases and many tutorials we see stuff like:
List mylist - new List ; declare a shiny new ListThe use of "my" is common. And pretty dumb. IMO using "the" prefix is just an idiosyncratic form of "my". And both stem from a reluctance to name a limited scope variable the same as its underlying type.
Addendum 2025-12-09 06:55: Sorry about the typos in my code samples. they were supposed to be on separate lines below the leadup sentence. And the hyphen should be an equals.
Admin
It's often seemed to me that distinguishing the variable from the type solely by the capitalisation of the first letter is really just a highly specialised form of Hungarian notation