Readable Code

Last week I talked about the importance of writing readable code. Also showed some basic tips and best practices to accomplish that. You can see the slides below.

Download: PDF

65% choose iPhone as next phone

A while ago I told some friends that iOS development should be a priority over Android development. They told me I was crazy and that the Android platform will became the most used one. In a survey of 400 consumers, 65% said they expected their next phone to be an iPhone. It seems I was right and that the iOS will be the most used mobile operating system.

Asked what phone they were going to buy next, 65% said an Apple (AAPL) iPhone, 19% said a Google (GOOG) Android, 6.5% said “not a smartphone,” 6% said “I don’t know,” and 2.5% said a Research in Motion (RIMM) Blackberry.

94.2% of iPhone users plan to buy an iPhone for their next phone, improving upon last year’s rate of 93%. If you throw in half of the 2.9% of iPhone owners who were still unsure, the re-buy rate rises to nearly 95.7%.

Android phones were measured at a re-buy rate of 60%, up from 47% last year. “While the improvement is a positive sign,” Munster writes, “Android is still losing 33% of current users to the iPhone. We also note that 38% of Blackberry users expect to switch to iPhone.”

Piper Jaffray

Source: Fortune

Casino games and computer games

Last week went to a casino and noticed that people feel very engaged at casinos. As a computer game player I feel like loosing that king of engage on games. So I started wondering about ideas to bring the concept of the casino games into casual computer and mobile games. So what really motivate that people at casinos? The answer is simple: the change to win more money than the money they invest. I started thinking that traditional computer games should use a similar reward system when the player achieve some level or finish the game. Below are some ideas I had about business models.

  • Put some money on the player’s credit card;
  • Give credit on the store where the player bought the game (Apple store, Google Play, Steam…) so the player can buy other games;
  • Give access to other games, or software, from the same software company;

There are also computer games that mimic casino machines. One example is partypoker that has two options. One is a free-for-play option where users can go and play without deposit real money, and other where players deposit of real money and play with it. Why not bring also a similar real money reward to the traditional computer game players? I think if I had a reward system that keep me motivated for playing I will feel a lot more engaged on playing computer games.

iOS-ification of OS X is inevitable

The iOS-ification of OS X is, at this point, inevitable, and anyone who doesn’t see it, or tries to neglect, is either software-blind or has some kind of interest in that way of thinking.

Federico Viticci

I agree with this quote. Shawn Blanc also added two relevant facts that supported this quote.

  • Apps that started as iPhone apps which then became iPad apps which then also became Mac apps (Reeder being the paramount example);
  • Apple itself making more and more of the features and designs in OS X feel and look like those in iOS.

I will add another one.

  • People want the most similar user experience on apps independently of the device that is running the app. They don’t want learn a new way of interaction if they want to use the same tool.

I think the concept of iPhone being a phone, iPad being a tablet and Mac being a computer will, sooner or later, converge to something unique.

Interactive animation of Vincent Van Gogh – Starry Night

A try to visualize the flow of the famous painting “Starry Night” of Vincent Van Gogh.
The user can interact with the animation. Also, the sound responds to the flow.
Made with openframeworks.


al3x’s Rules for Computing Happiness

Alexander Francis Payne, known as “al3x” in the Internet was one of the first Twitter employees. Back in 2008 he collected a list of rules so that we can have a happier computing experience, I still totally agree with him.


  • Use as little software as possible.
  • Use software that does one thing well.
  • Do not use software that does many things poorly.
  • Do not use software that must sync over the internet to function.
  • Do not use web applications that should be desktop applications.
  • Do not use desktop applications that should be web applications.
  • Do not use software that isn’t made specifically for your operating system. (You’ll know it when you see it because it won’t look right or work correctly.)
  • Do not run beta software unless you know how to submit a bug report and are eager to do so.
  • Use a plain text editor that you know well. Not a word processor, a plain text editor.
  • Do not use your text editor for tasks other than editing text.
  • Use a password manager. You shouldn’t know any of your passwords save the one to your primary email account and the one to your password manager.
  • Do not use software that’s unmaintained.
  • Pay for software that’s worth paying for, but only after evaluating it for no less than two weeks.
  • Thoroughly delete all traces of software that you no longer use.


  • Do not buy a desktop computer unless your daily computing needs include video/audio editing, 3D rendering, or some other hugely processor-intensive computing task. Buy a portable computer instead.
  • Do not use your phone/smartphone/PDA/UMPC for tasks that would be more comfortably and effectively accomplished on a full-fledged computer.
  • Use a Mac for personal computing.
  • Use Linux or BSD on commodity hardware for server computing.
  • Do not use anything other than a Mac at home and Linux/BSD on the server.
  • The only peripheral you absolutely need is a hard disk or network drive to put backups on.
  • Buy as large an external display as you can afford if you’ll be working on the computer for more than three hours at a time.
  • Use hosted services in lieu of hosting on your own hardware (or virtual hardware) for all but the most custom applications.

File Formats

  • Keep as much as possible in plain text. Not Word or Pages documents, plain text.
  • For tasks that plain text doesn’t fit, store documents in an open standard file format if possible.
  • Do not buy digital media crippled by rights restriction technologies unless your intention is to rent the content for a limited period of time.

Anchors Menu um plugin para o WordPress

Desenvolvi um simples e pequeno plugin para o WordPress que intitulei de Anchors Menu. Este plugin funciona no formato de widget e permite gerar dinamicamente um menu com links que apontam para as palavras que se encontrem entre as tags HTML que forem seleccionadas.

Foi inicialmente pensado para criar ligações que apontassem para as palavras entre as tags de headings do HTML (h1, h2, h3…), contudo é possível utilizar este plugin para outros tipos de tags.

O plugin foi elaborado para dar resposta a uma necessidade imediata e por isso pode apresentar alguns aspectos menos elegantes ou optimizados, pelo que agradeço todas as eventuais correcções ou sugestões que possam fazer.

Podem consultar a página do plugin e efectuar o seu download no seguinte link:

Erro em função recursiva


Imagem da autoria de Žiga Aljaž.

Ao ver esta imagem recordei as aulas de programação onde os meus Professores utilizavam sempre as Matrioshkas para ilustrar o mecanismo de programação recursiva.

Existem dois erros que frequentemente são cometidos e que acontecem por não se perceber bem este mecanismo de programação. Por um lado a incorrecta definição do ponto-de-paragem, neste ponto o problema tem de ser resolvido sem recurso à recursividade sendo muitas vezes algo semelhante a um limite superior ou inferior da regra geral. O outro erro comum é o facto da regra geral não estar a caminhar correctamente na direcção do ponto-de-paragem, sendo necessário que através da invocação recursiva se esteja cada vez mais a convergir para o ponto-de-paragem. Se não se cometerem estes erros e caso não se subestime a “força”* a programação recursiva pode ser uma ferramenta bastante útil.

* Darth Vader: Don’t underestimate the Force.

Mais informações sobre este tema: