Skip to content

Instantly share code, notes, and snippets.

View andrewsardone's full-sized avatar

Andrew Sardone andrewsardone

View GitHub Profile
@jspahrsummers
jspahrsummers / gist:3089293
Created July 11, 2012 09:33
What programming language or environment features are important to you?

Many Cocoa programmers, myself included, want a more modern programming language than Objective-C, and a more modern programming environment than Cocoa. There's been some talk about what would better fit the bill, and engineers are ready to build that solution, but the question first needs to be answered – what are the most important problems to solve?

I've created the following unordered list of hypothetical goals for improvement to Cocoa/Objective-C, and would like to see how important each one is to the community. If you're interested in sharing your opinion, please fork this gist and order the below list. Feel free to add anything that you think might be missing.

Thanks!

Potential Goals

  • Functional programming, where function application is the main way to invoke code. This does not refer to using objects in a functional style.
  • Referential transparency, also sometimes known as purity or immutability.
@hollance
hollance / Explanation.md
Last active September 25, 2017 03:35
Communicate between objects using channels

Communicate between objects using channels

When you have two objects A and B, say two view controllers, that you want to have talk to each other, you can choose from the following options:

  • NSNotificationCenter. This is anonymous one-to-many communication. Object A posts a notification to the NSNotificationCenter, which then distributes it to any other objects listening for that notification, including Object B. A and B do not have to know anything about each other, so this is a very loose coupling. Maybe a little too loose...

  • KVO (Key-Value Observing). One object observes the properties of another. This is a very tight coupling, because Object B is now peeking directly into Object A. The advantage of KVO is that Object A doesn't have to be aware of this at all, and therefore does not need to send out any notifications -- the KVO mechanism takes care of this behind the scenes.

  • Direct pointers. Object A has a pointer to Object B and directly sends it messages when something of interest h