3 ms·
I stopped reading at: "Things like factories, adapters, and other design patterns are all thankfully not there." Huh? Design patterns are "thankfully not there
by davedx 15y ago
I stopped reading at: "Things like factories, adapters, and other design patterns are all thankfully not there."
Huh? Design patterns are "thankfully not there"? What does that even mean?
- veyron 15y agoI took that to mean that the objective-C community as a whole is not obsessed with the gang of four. Though, to be fair, my exposure to the community is limited to AP CS AB (why they decided to use java is beyond me ...)
- saurik 15y agoNot that I agree with him, but I do understand what he meant by that, and might be able to explain slightly: many people believe that "design patterns" are something that languages like Java (quite in particular, this language is held up during these conversations) require to work around design deficiencies. Arguably, this is true: many of the patterns simply "fall away" if you have access to features like multi-method dispatch (Lisp+CLOS), message passing with transparent proxying (as in SmallTalk, and to some extent Objective-C), or continuations (Lisp/Scheme). However, the argument often goes even further into the realm of complaints against "all kinds of patterns, even those that tend to exist in all abstractions, even mathematical ones", deriding things like factories as "overly-complex" (in the same concept of "overly-complex" that make some people choose NoSQL over RDBMS not for scalability, but due to the common lack of schemas).
- dfox 15y agoFactory is actually perfect example of pattern that is mostly used to overcome the fact that passing classes around is unnecessarily complex in Java and thus it's favorable to wrap code calling constructor in it's own class and pass instances of it. In "dynamic" languages (including ObjC) you can simply use use the class object (and if the need arises: things that behave like class objects) itself instead of factory in most cases.
- zvrba 15y agoProbably that you can get stuff done simply, without writing a lot of boilerplate code.
- chubs 15y agoYup, that's pretty much what i meant, plus a bit of what veyron meant when he was talking about obsession with the GoF. Wow, you guys really are reading a lot into what i've written, keep in mind that this was written as a light-hearted and hopefully factual rebuttal to all the anti-iphone/objc trolling at my work. Peace :)
- fleitz 15y agoIt means that you type stuff like NSArray* array = [NSArray new]; And the implementation changes to suit what you're doing with the array rather than CollectionFactory colFactory = new CollectionFactory(); ICollection array = colFactory.getArrayOptimizedFor(100); Java: It's factories, all the way down.