Objective-C isn't what you think it is
news.rapgenius.com
Objective-C isn't what you think it is
1–10 of 101 posts
Re: Objective-C isn't what you think it is
#2Re: Objective-C isn't what you think it is
#3Yes, it's dangerous. Clever, and not quite as easy as your favorite dynamic scripting language, but Obj-C supports it.
My favorite personal use case so far is an Objective-C state machine, where state names are strings, and state callback functions can be added to the code & called without declaration. It's not really saving much technically, but it eases just a tiny bit of mental & manual friction to be able to modify the code without having to update header files.
Re: Objective-C isn't what you think it is
#4Re: Objective-C isn't what you think it is
#5Please use this stuff sparingly though, especially things like resolveClassMethod: as it makes for some incredibly difficult to follow code that can segfault with some very strange error messages. Your future team members thank you.
Re: Objective-C isn't what you think it is
#6Re: Objective-C isn't what you think it is
#7With respect to the article, concision looks like an artifact of standard practices by the languages users rather than any part of the language specification. One can be just as concise in ObjC (or C or Java), but the tradeoff is still readability.
Re: Objective-C isn't what you think it is
#8Re: Objective-C isn't what you think it is
#9Personally I think it's an awful idea to use meta-programming without an exceptionally good reason in production code. Like excessive use of function pointers in C. Just because you can doesn't mean you should. Programming in this style causes more code complexity and will accelerate the rate at a which a codebase becomes a mess, not to mention it's really slow.
New developers (less than 10 years professional experience) seem to become fascinated by "cool" language features that let them do unintuitive things and then approach problem solving with a mindset of "What cool tricks can I do to solve this?"
Instead, the experienced developer will always approach a problem with "What is the simplest way to solve this problem?"
Re: Objective-C isn't what you think it is
#10> Ruby and Objective-C look like opposites: one is dynamic, the other's static;
EDIT: Just read that the author basically denies those claims in the next paragraph.