High Performance Browser Networking

Acabei de terminar a leitura do High Performance Browser Networking, uma ótima introdução ao tópico de como o browser lida com a infra-estrutura de rede.

Eu já tinha alguma noção de como a(s) rede(s) pode(m) impactar aplicações rodando em PCs, mas nunca tinha pegado pra ler material que discutisse isto sob o ponto de vista de aplicações mobile, principalmente de apps que rodam quando o celular está conectado a redes 3G, 4G, etc.

Dado que o acesso à internet se dá cada vez mais por redes wireless (Wi-Fi, 3G, etc), o tipo de informação contida no livro é fundamental para o projeto de sistemas que pretendam oferecer um mínimo de usabilidade a seus usuários.

O livro pode ser lido gratuitamente online em https://hpbn.co/, mas se prefere um livro um livro impresso, pode encontrá-lo na Amazon e outras lojas online.

 

Let it flow

A nice Sunday morning read:

http://code.flickr.net/2015/09/01/the-data-freshener/

But it amazes me that, as an industry, we’re still dealing with these kinds of problems (synchronizing data between different layers) after all these years.

I remember first coming across this issue back in 2003/2004 when developing a Windows Forms + ADO.NET front-end connecting do a SQL Server Back-end.

Sure, the technology stack is completely different and Flickr’s scale is way way bigger, but the problems are fundamentally the same.

One would have guessed that after all these years, we would have learned a couple of lessons from the database replication/synchronization field, applied them to the problem at hand and stopped reinventing the wheel.

Maybe we could all learn something from fluid dynamics.

Data should flow between the different layers the same way a shot of vodka flows when poured into a glass of cashew juice. Hic!

Growing software keeping things simple

Back in year 2000 I was running my own software development company and had a small kind of ERP system targeted at small companies.

Reading about all the advantages of interfaces such as the ability to switch implementations one for another at any time, I thought: "Wow! That’s amazing! I gotta do that!". So I went extracting the interfaces out of each class and making the classes refer to the interface. Soon I realized that in order to be really independent, I had also to change the methods and properties to point to the interfaces so I could change the object being passed to them.

Several weeks later I had it all done and working, but those were several weeks not adding new features. Only refactoring code at a time where we had no refactoring tools like today.

One could argue that I should have done interfaces from start and then I wouldn’t have had all that work. OK, I agree. The problem is that all that was new for me. Still, all the work would be compensated by the possibility of switching implementations whenever I needed!!!

The problem is that time never came! OK… To be fair, there were a couple of situations where I benefited from using interfaces. And that only became possible because I got a new insight, a new way of seeing the world – through interfaces. But for the most part, it was an overkill. When modifying a class, instead of having one place to change, now I had two!

It has been attributed to Albert Einstein that “Everything should be made as simple as possible, but no simpler

After so many years of developing software I came to appreciate simple designs.

I think about the ways the code might evolve in the future and instead of putting in things that pave the way to this predicted future, I tend to leave out the things that would otherwise make it more difficult to get there.

The reason for this is that the predicted future may never come to realization. So by putting in stuff now, I would eventually be throwing resources away. Resources that may be needed for something else.

It gets even worse when – driven by real needs – you find yourself having to accommodate changes that go in another direction that eventually are incompatible with what was initially predicted.

All of this has already been explained by people much better with words than I am. Take a look at YAGNI, KISS and DRY.

The bottom line is: Grow you software simple. Only add complexity when really needed. Even then, try to keep it as simple as possible, but no simpler. 🙂