Aaron HillegassHo deciso recentemente di affrontare la programmazione Cocoa (in breve, programmare per MacOS X). Per me è un bel salto perché non ho mai programmato per un sistema operativo avendo lavorato solo con linguaggi di alto livello (per dire – e per chi sa di che parlo – non ho mai studiato il C né il C++, anche se conosco alcuni linguaggi che risentono della loro influenza).

Partire senza basi è molto difficile, ma va detto che il mondo dell’informatica ha sempre avuto a disposizione strumenti formativi eccellenti: tutorial online, libri, codice di esempio, forum di discussione etc.

Imparare a programmare quindi è molto più facile rispetto ad altre attività, perché insieme alla programmazione si è sviluppata di pari passo la necessità della documentazione: la programmazione è una disciplina che si è sviluppata insieme ai suoi stessi strumenti didattici. In ambito informatico c’è quindi una cultura genetica di attenzione alla didattica e i manuali sono quasi sempre piccoli capolavori di insegnamento per chiarezza, metodologia, ordine espositivo, presenza di esempi.

L’uscita di un paio di libri dedicati ai novizi mi ha convinto a fare questo salto. Uno di questi è la terza edizione di “Cocoa Programming for Mac OS X”, di Aaron Hillegass, veterano nel campo sia della programmazione Cocoa (che ha contribuito a creare) che dell’insegnamento.

La prefazione al manuale è una perla e la riporto pari pari, senza nemmeno tradurla. Sostituite “Cocoa” con qualunque disciplina e vedrete che il discorso torna in modo esemplare.

All sorts of people come to my class: the bright and the not so bright, the motivated and the lazy, the experienced and the novice. Inevitably, the people who get the most from the class share one characteristic: They remain focused on the topic at hand.

The first trick to mantaining focus is to get enough sleep. I suggest ten hours of sleep each night while you are studying new ideas. Before dismissing this idea, try it. You will wake up refreshed and ready to learn. Caffeine is not a substitute for sleep.

The second trick is to stop thinking about yourself. While learning somerthing new, many student will think, “Damn, this is hard for me. I wonder if I am stupid.” Because stupidity is such an unthinkably terrible thing in our culture, the students will then spend hours constructing arguments that explain why they are intelligent yet are having difficulties. The moment you start down this path, you have lost your focus.

I used to have a boss named Rock. Rock had earned a degree in astrophysics from Cal Tech and had never had a job in which he used his knowledge of the heavens. Once I asked him whether he regretted getting the degree. “Actually, my degree in astrophysics has proved to be vary valuable,” he said. “Some things in this world are just hard. When I am struggling with something, I sometimes think ‘Damn, this is hard for me. I wonder if I am stupid,’ and then I remember that I have a degree in astrophysics from Cal Tech; I must not be stupid.”

Before going any farther, assure yourself that you are not stupid and that some things are hard. Armed with this silly affirmation and a well-rested mind, you are ready to conquer Cocoa.