Archive for July 15, 2013

Monday, July 15, 2013

Effective Objective C 2.0

Mark Bernstein on Matt Galloway’s Effective Objective C 2.0:

This book is organized and presented as an Objective C homage to Scott Meyers’ classic work, Effective C++. The new book is good and interesting and provides useful tips for working in Objective C, but it’s far less interesting than Meyers.

I agree that there could be more discussion of key-value observing and concurrency. Also, Item 48 recommends block enumeration over for loops:

In the case of a dictionary, you get both the key and the value without any additional work, thereby saving the extra cycles required to obtain the value for a given key. Instead, the dictionary can give both at the same time, which is highly likely to be far more efficient, since keys and values will be stored together in a dictionary’s internal data structures.

This makes intuitive sense, but I seem to recall reading that, in practice, a loop with fast enumeration is faster (perhaps due to function-call overhead).

Why Microsoft’s Reorganization Is a Bad Idea

Ben Thompson:

Apple is the exception that proves the rule; they are functionally organized, but that absolutely does not mean a functional organization is best. Understanding why almost all corporations are organized by divisions (and how Apple manages a functional organization) illustrates why I think Ballmer is making a grave mistake.

[…]

In my (very-biased) opinion, I believe collaboration is fundamentally broken at Microsoft. It is all about politics, not great outcomes, and that is absolute death in a functional organization, which has nothing but collaboration to hold together cross-functional product teams. At least in a divisional model all of the relevant team members have a common product and a common boss, meaning everyone has no choice but to work together. Unless the employee review and compensation model is significantly changed, this, along with the lack of mission and clear accountability, will grind progress to a halt.

Update (2013-07-24): Ben Thompson posits an uncanny valley:

However, a company organized functionally that does not have the necessary cultural ingredients for true collaboration is actually in worse shape for having tried; the disagreements will turn into conflict, and the agreements made through groupthink will arguably be worse.

LINQ Ruined My Favorite Interview Question

Scott Chamberlin (via Hacker News):

The question is “Return the top 10 most frequently occurring words in a string.” This year a couple candidates gave me a solution which I haven’t seen in 5+ years of asking this question—they solved it with a couple lines of LINQ. I decided to dig deeper in to these solutions post interview and I’m writing up what I learned.

See also: NSEnumeratorLinq and RXCollections.

Objective-C Garbage Collection, in 1991

Graham Lee:

Then I discovered a conference talk by Paulo Ferreira:

Reclaiming storage in an object oriented platform supporting extended C++ and Objective-C applications

This is a paper presented at “1991 International Workshop on Object Orientation in Operating Systems”. 1991. That is—obviously—11 years before GNUstep’s GC work and 17 years before Apple released AutoZone.

[…]

I’m really surprised that it took so long for me to find out about something that’s almost directly related to my everyday work. Mind you, maybe I shouldn’t feel too bad: the author of AutoZone told me he hadn’t heard of it, either.