5 ms·
Exactly. Obj-C/Smalltalk have events built in because objects can actually receive 'messages'... can't respond to it? Send it somewhere else, rewrite it, etc.
by fleitz 13y ago
Exactly. Obj-C/Smalltalk have events built in because objects can actually receive 'messages'... can't respond to it? Send it somewhere else, rewrite it, etc.
If C++/Java called events messages then it would reveal exactly how broken this vtable crap is as a replacement for actual 'messaging'.
Most of the GoF book is a giant anti-pattern for using a broken languages.
- dragonwriter 13y ago> Most of the GoF book is a giant anti-pattern for using a broken language. Software design patterns (at least, on the level where you would bother to write books describing them in terms of source code templates, rather than library code) are language-specific (or language-family-specific) workarounds for things that the language doesn't abstract well. OTOH, recognizing them in existing languages is both how you write better code with the language you have and start to develop/recognize better languages.
- canthonytucci 13y agocan you recommend a good design patterns book that you prefer? As someone who works with obj-c I'd be interested to hear your suggestion.
- fleitz 13y agoReading the code of frameworks / projects you like working with. It's especially interesting to look at older versions and see how it has progressed. Design Patterns books tend to miss the practice with contrived examples. Real code focuses on problems people actually have. Also, use other languages. For instance abusing categories is something I learned from rails, when I learned of objc_setAssociatedObject I started adding properties via categories (which you aren't supposed to be able to do via a category).
- deleted 13y ago[deleted]
- steveklabnik 13y agoI haven't used it with Objective-C, but you should check out Smalltalk Best Practice Patterns. The two languages are close enough that it should work, Rubyists refer to it all the time.
- hboon 13y agoKent Beck’s Smalltalk Best Practice Patterns is a great book. In Smalltalk, but it works rather well for good OO languages, in general. Very easy to read. http://amzn.com/B00BBDLIME?tag=hboon-20 http://amzn.com/B00BBDLIME?tag=hboon-20
- galaktor 13y agoI've heard very good things about this book: "A Mentoring Course on Smalltalk" [1] [1] http://www.amazon.com/A-Mentoring-Course-on-Smalltalk/dp/B00262QEKK http://www.amazon.com/A-Mentoring-Course-on-Smalltalk/dp/B00... Edit: better link
- pjmlp 13y ago> Most of the GoF book is a giant anti-pattern for using a broken languages. Are you aware that the book also has quite a few Smalltalk examples?