Home > Properties > The Dot Notation Controversy
The Dot Notation Controversy
Posted on Friday, August 7, 2009 by android apps market for tablests
Sorry! It was Joe Conway, not Aaron who wrote the post. I've corrected the article below. The salient points are unchanged, but my apologies for mis-attributing
I knew that some developers didn't particularly care for Objective-C 2.0's dot notation, but I didn't realize how strongly some of them felt about it. Joe Conway of the Big Nerd Ranch has a very strongly worded post about the horrors of dot notation.
I have a lot of respect for Joe and the Big Nerd Ranch, and reading his post, I understand his complaints. He has identified some situations where dot notation can lead to confusion. In practice, however, I don't personally find the use of properties confusing in the slightest and think telling people to never, ever, ever use them is misguided imposition of a personal preference rather than sage advice. If there is anything close to a consensus on dot notation in the Objective-C developer community, it is that dot notation is a positive addition to the language.
Although, in terms of how they are implemented, dot notation and properties are orthogonal, I tend to think of them as working hand in hand. I always use dot notation for properties and bracket notation the rest of the time. Instead of making my code harder to read, I personally find that it makes it much easier. The only possible point of confusion I've had with this approach comes when accessing struct or union members owned by properties, but in practice, it just isn't a meaningful problem for me and it's offset by the benefit of separating exposure of state from exposure of behavior, something that has no language-level support in Objective-C prior to 2.0 and no language level support at all in most OO languages (though C# does, so kudos to Microsoft for that).
My only issue with dot notation, if you could call it an issue, is that since it doesn't mean exactly the same thing as it does in many other OO languages like Java or C++, it can be a bit of a stumbling block for experienced programmers who are new to Objective-C (and with the iPhone, there are a lot of those lately). It can be difficult for these people to make the transition because they subconsciously transfer their understanding of dot notation to Objective-C and think they understand something that they don't. The result of that is typically memory management problems that frustrate the hell out of them. But that's not really an issue with the language, it's just a training issue and hardly an insurmountable one. There are many happy, well-adjusted former C++ and Java programmers among the iPhone developer ranks.
So, keep in mind that although there are a few well-respected and knowledgeable developers who strongly dislike dot-notation, there are many more well-respected and knowledgeable developers who do use and like them (and I do too). You should definitely read Joe's post and give his opinion weight. He has been working with and teaching the language for quite some time and he's a really, really smart guy. But keep in mind that what you're reading is just one opinion.
Category Article Dot Notation, Other blogs, Properties
Powered by Blogger.
Blog Archive
-
▼
2009
(496)
-
▼
August
(65)
- Local Events and Activities Gadget
- Click-to-Flash
- Flash Post Mortem
- Nested Arrays
- Twitter Quotes Gadget
- Dog and Puppy Photos Gadget
- Just a Few More Vacation Thoughts
- GoComics Social Gadget
- You Guys Rock
- Flash is Dead! Long Live Flash!
- Jail Quotes Gadget
- Google Search results optimized for feature phones...
- Google Search results optimized for feature phones...
- Daily Horoscopes Social Gadget
- The bright side of sitting in traffic: Crowdsourci...
- The bright side of sitting in traffic: Crowdsourci...
- Chess Social Gadget
- Tile Game Social Gadget
- YouTube Mobile App Expands to Five New Languages
- YouTube Mobile App Expands to Five New Languages
- To Autorotate or Not to Autorotate
- Google Apps Connector for BlackBerry Enterprise Se...
- Google Apps Connector for BlackBerry Enterprise Se...
- iPhone Sketch Book Mini-Review
- NY Times Crossword Social Gadget
- Another Pimp My Code
- Photos Social Gadget
- "Knowledge speaks but wisdom listens."
- "Knowledge speaks but wisdom listens."
- New Image Search Results for Feature Phones
- New Image Search Results for Feature Phones
- Property-List Driven Detail Editing Pane
- SCRABBLE Social Gadget
- Stamps on Colnect Gadget
- Sentiment by Newssift Gadget
- Ultimate Waterfall Gadget
- Fish Aquarium Deluxe 3D Gadget
- Weather 3D Gadget
- Interesting...
- Contact EMailer Gadget
- Animated Nature Gadget
- Nice iPhone Application Idea.
- iPhone Sketch Book
- Blocks on iPhone
- On iPhone Competitors
- Workshop Done
- The Iterative Web App: Outbox for Emails in Limbo
- The Iterative Web App: Outbox for Emails in Limbo
- Boot Camp Imminent
- OpenGL ES Update
- My Last Word on Dot Notation
- Fish Tales Gadget
- Daily Picture Sudoku Gadget
- How to Use Dot Notation and Properties
- Dot Notation Redux: Google's Style Guide
- The Dot Notation Controversy
- Translations and Xcode
- Artistic Greeting Cards Gadget
- Tycoon Games Gadget
- Multi-Row Delete in 3.0
- NinjaWords
- A Mac App Store
- Me, the Hypocrite Apparently
- iSimulate
- This Concerns Me Greatly
-
▼
August
(65)