"H. S. Teoh" <[email protected]> wrote in message news:[email protected]... > > Breaking changes tend to > happen inside a class, so if something doesn't *need* access to private > members, then it doesn't, and shouldn't, need to be a class member. >
Unless they need polymorphism :( > In retrospect, I do find myself frequently factorizing code *within* a > class such that most member functions don't actually need direct access > to private members, or if they do, they use as few private members as > possible to do what they need to do. So by Dr. Dobbs' standard, most of > these member functions ought to be external to the class proper. > > This is where UFCS really shines... now I *can* actually move these > members out of the class, and it doesn't even change the class API! > Plus, *users* can add new pseudo-members and it extensibly enhances the > class API while retaining that resilience to change. > It also has the benefit of shrinking the vtables of each instance. (Although I think 'final' might have the same effect if used the same way?) > D is getting more awesome by the day. Now I truly can't convince myself > to go back to C++! > Totally. But I had given up on C++ ten years ago. Unfortunately, as I may be getting into some iOS/Android game dev soon (likely with Marmalade, since Corona looks to be little more than a shiny overpriced toy - just like its older brother Flash), I may need to start using C++ again. Ugh. I love game dev, but I'm not looking forward to that aspect of it. Mature Arm support for D can't come soon enough! If there were a date, I'd be counting the days. > There are two ways to write error-free programs; only the third one works. Heh, once again, a gem. I also laughed out loud at the "That phone number is imaginary, rotate your phone 90 degrees and try again".
