Blog

Slack

I hate wasting time. If you have time don’t wait for (more) time, that’s one of my favorite savings.When I started working I had a small commute by car and some time got wasted waiting for the traffic light to become green. So I started reading books in those waits.
With my MS-Windows becoming slower and slower at startup, I decided to spend the waiting time reading books. At work I started a copy of “Slack” by Tom De Marco. Being a book on efficiency I found fitting to read it in recycled time.
If you work in software development (or if you are a “white collar” at large) you ought know who Tom De Marco is. Or, at least, you should have heard about the book he wrote with Timothy Lister – Peopleware. This is one of the most referenced book, almost every book on project management written in recent years quotes Peopleware.
Back to Slack, this is a book intended to be read in a short time to convey good an bad practice about efficiency, innovation and risk taking in today’s organizations.
The author states about an hour and half as reading time, I guess it is somewhat more even if you read from page 1 to the end at the same time (and not scattered over a couple of month of PC boots), nonetheless the thought-provoking stuff is very dense. Chapter are short and almost everyone made me think.
It is possible I will write a resume of it in the future, but I strongly encourage you to read by yourself.
Tom hacks through myths trying to grasp what is needed by an organization to survive in times of change and crisis. First myth to fall is the one of total efficiency. Total efficiency means total rigidity. An organization that maximizes efficiency cannot withstand change because lacks of the buffer and the spaces to react to change and adapt.
Then he digs through the (wrong) assumptions about making the organization more productive – pressure, competition, fear and so on.
Eventually he bashes the Management By Objects and illustrates what really means to deal with risk.
For example planning should be an estimation and as a such should offer a range defined by: cannot complete before X and surely completed after Z, with a best estimation at Y, with X <= Y <= Z. Now that’s a planning, that’s quite different by setting a goal. From my experience, someone defines a planning, someone else carves it in stone and says that’s the goal. This way of operation ignores the risk, ignores that an estimation is just an estimation, not a commitment, and it is just a sure way to have a delay on the completion. In fact, even if the most likely date (Y in the example above) is taken, this is usually achievable only with a probability of 33%.
De Marco also marks “Management by Objectives” (MBO) as “don’t”. I already read about criticisms at MBO, but more about the bonus system rather than objectives by themselves. De Marco states that it is hard, if not impossible, that the defined objectives for employees lead the organization toward company objectives. Also in a time of changes it is hard to hit an objective even if the actions taken are excellent for the company.
I found this particular opinion a little forced on software development. I think that an objective and bonus scheme over the course of a project, if properly done, could be helpful. Maybe MBO is just crap if applied to vending or other areas.
I liked the book a lot and I think it is not just for managers (regardless of their level). The more widespread the ideas here contained the better the life of fellow programmers.

BSG-75

It is nearly a week I finished watching the last episode in Battlestar Galactica series. After reading the long interview to authors about the finale (thank you Jok), I decided to watch it again.As I wrote some time ago the show is damn good and I really enjoyed it from episode 1. A number of interesting topics and dilemmas are tackled during the 4 seasons of the show and the outcomes are never simple as black or white, or idealistic.
How does the finale work for me? (Spoiler warning, you may want to read below only after you seen season 4.5, finale included).
Well I am not sure, but it is mostly good, even if it didn’t fully convinced me. First there are basically two finales. The first is the rescue of Hera featuring the last battle of Galactica. This finale is epic, action-packed, 100% space opera. This finale explains the visions about the Opera House, provides the closure of the story of Gaius Baltar with a very satisfying full redemption and features the defeat of the evil Cylons (and the salvation of the good Cylons).
The second finale is the arrival on Earth and the decision of start anew, letting go technology, knowledge and science. This finale is poetic, romantic and aching. I have been nearly in emotional overload a couple of times.
There are two more closings, the first set today in NY featuring those I learned to be called Head Characters (i.e. Head Six and Head Baltar) chatting in N.Y. This finale is about hope, the head characters (angels or entities, no explanation is given) grow the confidence that this time the history won’t repeat because the loop has been broken.
Eventually there is a brief footage of nowadays robots. This is quite useless, and worse is completely dissonant with BSG, you can stand it only because it is preceded by the N.Y. scene.
Thinking on the finale I found that there are a number of quite evident “plot devices”, i.e. cheap ways for authors to solve complex situation. More precisely they employ the mystery. For example the Earth is found by Kara Thrace, setting as jump coordinates the notes of a melody her father taught her and the little Hera drew. Fine, but… the underlying explanation is totally missing from who/what is Kara Thrace (she just resurrect along with her Viper), what the melody is, who the Kara’s father was and so on. The best explanation is given by Gaius during his speech – there is an unknown Power at work. Head Characters are unexplained as well. Also the question why on this Earth there are humans compatible with those on Galactica, is left unanswered.
Also what I feel somewhat cheap was the total consensus about the decision of everyone to restart from blank. We are talking of about 40k people. A fleet that never agrees even about the most straightforward matters, now votes at unanimity to sink ships in the sun, to forget everything about science, medicine, technology, literature and, just to restart anew, to go toward suffering and die for something as stupid as a cold.
Not to talk about the choice of letting Kara Thrace just disappearing. Sounds like the authors: “Hum, what we have to do with Kara?” “Don’t know” “So let her just disappear!”
But don’t get me wrong, I really liked the finale, I found it quite balanced in the emotions that inspires and a good closing for the series. Being quite rational I would have liked some more explaining… (I have a question since episode 1 – how did Baltar survive to the nuclear blast? Just by hiding himself behind Six?)
Anyhow, authors promise some new revelations in the tv movie “The Plan” that I promptly pre-ordered 🙂

Alice e il cuore

Festa dell’oratorio organizzata dai ragazzi delle superiore per i bambini. Mariana ci racconta:”C’era anche Alice”
noi: “Alice chi? La maestra di Juan?”
Mariana: “No, Alice”
noi: “Ok, ma Alice chi?”
Mariana: “Alice dei paesi!”
noi: “Ah, Alice nel paese delle meraviglie!”
Mariana: “Si!”
noi: “E com’era vestita?”
Mariana: “Il solito”.

Ma Mariana non è solo una incredibile cabarettista. Sabato prepara il disegno per il battesimo della cuginetta G. e disegna una bambina dentro un cuore. “E questa chi è?”, e lei risponde: “E’ G., è dentro al cuore perchè non è ancora nata”.
Se non si nasce prima nel cuore, nello spazio interiore che mamma e papà hanno preparato, allora nascere dalla pancia è solo un evento ed essere figli o famiglia sono solo parole vuote.

Il duro cammino della scienza

Il telescopio compie 400 anni. Mi sembrava una bella cosa da dire ai miei figli spiegando cos’è un telescopio, a cosa serve, chi era Galileo, ecc. ecc. Dopo qualche minuto dentro il discorso, Mariana chiede: “a chi lo stai spiegando papi?”
Incasso, provo ad andare avanti un pochino parlando di Galileo e della persecuzione subita e, questa volta Juan: “Ma è ancora vivo?”.
io – “ehm, no, sono passati 400 anni”.
Juan – “perchè è morto?”

The Ultimate Guide to Videogame Writing and Design

Video gaming is for sure one of the reasons I got so addicted in computer programming. Being forced out of the videogame industry in 2004 had not been an happy experience at all and I am still trying to make sense out of it. But life goes on and if I am not really capable of “letting go” that part of my life, I am gardening the (possibly false) hope of making some games in my spare time.I am just a programmer and I know my game design skills will never rival with even to the scantest game designer. That’s why I bought and read this book. Not with the intent of becoming a game designer, rather with the desire of filling some of the gap and better understand the techniques and the mechanics of their work.
The book is easy to read and concepts are easily grasped. I found some little inspiring pearls. The first is the introduction itself. Authors claim that in an ideal world they would have suspended their work for at least one year in order to properly write the book. Actually this is impossible, as is impossible to do with much of the work they do – multiple projects are developed in parallel and the successful worker has to deal with this rather than complaining.
The first drawback is, IMO, a direct consequence of this – the book is not very well organized. I found that some chapters are out of order and oftentimes an overall picture is missing. It is not too bad, you may argue that is just “creative” at work.
Another interesting concept is that writing a game (o a show, a movie) is not “art” but “craft”. I.e. “art” is about inspiration and cannot be relied on for day-to-day work. “Craft” is something that gets thing done, in the best way, even when your muse is on vacation.
The book propose a good number of exercises. I started with the intention of doing them all, but some of them are too time consuming to be done on holiday, with an inviting sea in front of you (and your children yelling around).
The other big drawback is that this book is much more about “writing” than “designing”. The distinction may be thin, but “writing” pertains to the story, while “designing” pertains to the mechanics of the game. Most of (if not all) the problems are seen from the story point of view. Therefore characters are examines and created starting from their story, their internal struggle, their relationship, i.e. everything that is story, rather than from “powers” and which “actions” they perform.
This is not bad per se, it is just that the title may result a little misleading.
I have mixed feeling about suggestions given in the book about the job at large. At one extreme are good advises about how to deal with conflict in the team or with other project stakeholders (even if not everything is applicable in working context other US). At the other end are obvious suggestion (don’t live over your possibilities and subscribe a pension fund).
The book proposes a set of templates for the definition of characters, parties and world. The approach is good and likely the tables contain the right set of questions. In fact I found myself to develop an unexpected and quite awesome background for the videogame I am working at.
To sum it up, read this book if you are interested at story in videogame.

Per quest’anno non cambiare…

… stessa spiaggia, stesso mare.
Ormai siamo entrati nella routine della vacanze, se di routine si può parlare, dove il problema maggiore è costituito da in quale ristorante andare a mangiare la sera. Non crolliamo ancora dal sonno e quindi possiamo spendere due parole per tutti gli ansiosi (e anche i meno ansiosi) all’ascolto.
Innanzitutto il viaggio. Era una delle nostre maggiori preoccupazioni: come avrebbero reagito Juan e Mariana ad un viaggio pesantuccio anche per un “cresciuto” di quasi 3gg. In realtà hanno sopportato benissimo: non hanno battuto ciglio per le levatacce, per le difficoltà pratiche di mangiare e dormire in viaggio. Anzi sul traghetto alla fine si trovavano così bene che quasi abbiamo dovuto convincerli a scendere.
Certo qualche ansia c’è stata, qualche scossa da sballottamento. Cioè quelle cose che per i nostri figli probabilmente succedono indipendentemente dalla lunghezza del viaggio (probabilmente anche con 1h di aereo), ma come conseguenza del fatto che si cambia ambiente. Quindi hanno passato i primi giorni a litigare tra di loro, a martellare sulle relazioni con noi con una ricerca continua di attenzione. Per contro in spiaggia si sono sempre divertiti come matti, i primi giorni avevano un entusiasmo, una voglia di assaporare fino in fondo quell’attimo come se dovesse finire da un momento all’altro.
In acqua sono una cosa incredibile… certo c’è l’orgoglio di genitori, ma sono davvero incredibili. Juan era un po’ più rigido, timoroso, il primo giorno, adesso bisogna ricordargli di stare dove tocca quando non ha i braccioli. Si è impadronito della maschera e non la molla nemmeno quando si riscalda al sole. Mariana non ha mai avuto timori, a dispetto anche di qualche bevuta. Arriva, parte, dà ordini (tienimi, lasciami, tienimi, lasciami). Ha voluto provare senza braccioli e si è buttata a nuotare… ovviamente è andata sotto, ma questo non l’ha minimamente dissuasa a rientrare in acqua (con i braccioli).

Siamo in onda!
Grand Slam!
La Barbie ha fatto i fanghi… adesso ha una pelle bellisssssima.
Facciamo uno scherzone al papà, quando passa gli facciamo “bu!”
Un cucciolo di gatto e una serata intera a spiegare perchè non possiamo portarlo dall’Alice (senza parlare poi del dubbio che la mamma gatta non lo curasse bene).

Sole, mare, pizza, mandolino

Messaggi per il mondo:Juan: ho fatto un tuffo sul mare molto grosso, un bacione a tutti. Io ho mangiato le polpette con il riso e tante belle cose buone. Ho visto i pesci sotto al mare. Erano belli e piccoli.
Cari cuginetti oggi mi piace tanto il mare e mi tuffo anche e faccio anche il bagno dentro. Abbiamo fatto anche la pista per le biglie con le gallerie e abbiamo giocato con le biglie.

Mariana: Oggi l’amore a tutti. Bacioni a tutti. Mariana ha comprato l’asciugamano di Hello Kitty.

Malgrado il vento forte Juan e Mariana hanno voluto provare il gioco che ha regalato loro lo zio Enrico.
Fragola e cioccolato.
Mariana si trova perfettamente a suo agio con l’acqua, anzi dopo aver provato con i braccioli ha chiesto di andare senza e di essere lasciata sola… è andata sotto, ma a parte un po’ di tosse, non si è spaventata.
Il castello di sabbia che diventa una pista per le biglie.
Il sole era un po’ più rosso di così…

Colombiani a Naxos

Dominando la tecnologia e la geografia non poteva mancare un piccolo update dalle vacanze.

Appena saliti sul traghetto si guarda fuori con un misto di preoccupazione e … preoccupazione
Voglio bene a mia sorella… potrei facilmente strozzarla adesso, ma non lo faccio.
Questa mucca sta girando se non proprio il mondo, almeno l’Europa.
Il primo giorno di spiaggia e mare, esausti per il viaggio, ma inconibilmente felici.
“A che bei gattini” e proprio mentre i bambini stanno per accarezzarli una premurosa signora tedesca ci avverte che il giorno prima, mamma gatta, ha spedito all’ospedale una ragazza che tentava di accarezzarli.
E poi c’è la spinosa questione “Ma dov’è il loro papà?”, “Magari quel gatto è il papà dei micini”…

Alla prossima!

The Web of Doom

I started programming a couple of days before yesterday, so I had several occasions of peeking a look at code written by others. According to Jeff best programmers are those who answer “mine” at the question “Which is the worst code you have ever seen?” Probably I wouldn’t qualify for the elite since I consider my code not so bad. For example, in the past days, I stumbled upon a piece of code quite crappy. Most out of curiosity I analyzed the dependency among modules. Note I am talking about real straightforward dependency, the one defined by module A calling a function in module B. I got the pretty picture you see here:

You may argue that F.c is quite independent, but the truth is that F.c is empty and not used in the project, I just included it in the graph because it was in the directory.

Now it would be just an awesome example of dependency-hell applied to programming (others may call “Big Ball of Mud”) would not be the case I have the task of adding features to this mess.

As every ball of mud of respectable dimensions, a number of anti-patterns have been consistently applied with generosity. For example, around 110 global variables have been defined in a .h file.

Ok, read that sentence again.

Variables have been defined in a header file, not just declared. This brings us to an interesting anti-pattern: each .c file has the corresponding .h file which is intended to be included only once by the .c file. I.e. F.h is the header file for F.c in the sense that just F.c has to include F.h. In this way, each header file has a section for prototypes of the module and a section for externs.

One of the most relevant members of the global community in this code is variable ‘i’. You may argue about the problem of having such a short name in such a large scope. This was my reaction until I realized that such variable was used everywhere for loop indexing. What the f*! I mean … why?! The compiler is expected to optimize away the index of a loop, possibly by moving the variable into a CPU register or by unrolling the loop. This is simply not possible when a global is involved since the compiler is not granted that someone else is using the global or it is affected by some side effect of the loop.

I tried to enter the mind of the original programmer… and I imagined a young at his (or her) first job, arriving a day at the workplace and claiming: “Yo! I had a wonderful idea! Why don’t we use a global for ‘i’ so that we don’t need to declare it everywhere!”

I won’t talk about common anti-patterns such as never-ending function body (900+ lines) or deeply nested (16 levels… a record I guess). The other aspects that stroke me are hilariously long lines and tactical comments everywhere.

80 columns per line may be a bit old-fashioned but I like it and force you to be concise and avoid too nesting, but long lines in this code easily reach 160 columns and I suppose there are some around the 200 columns.

Tactical comments are those notes left by the programmer explaining what every line is supposed to do. I am not fond of this practice that actually reduces the readability but this code reaches really unexplored worlds of tactics. Several functions have each line commented (from column 100 to column 160). If a single comment doesn’t fit in a single line (which could happen when you hit column 200) it is split along multiple lines even if the code no longer relates to the description.

Yes, I am convinced that I am not the best programmer in the world (nor one in the top ten), but I strive as I can not to write code such as this. And the reason is that a) I don’t want to lose my sanity trying to debug it (and possibly change it in the future) and b) I want everyone to live in love and peace… programmers included.