December 23, 2011

People it is worth following

Among software development there are a lot of resources, a lot of people worth of looking at it, but to find out who is good enough to follow may take some time. That's why's I'm summarizing the people I enjoy reading/listening to in any topic related to software engineering and development in general.



Robert C. Martin
The 'Master Craftsman', I've read some of his books and are pure gold, his experience and knowledge are outstanding, and you can still see him coding!


Joel Spolsky
One of the heads behind StackOverflow, a hardcore developer that has been doing really cool things for more than a decade. His blog posts are extremely interesting and very, but very useful.


Jeff Atwood
Another of the heads behind StackOverflow, a very skillfull developer that has been delivering lots of tips, principles and advices for years.


Miguel de Icaza
He is the mind behind the initial Gnome project, started with Mono and now it's driving his own company called Xamarin. He might be controversial at times, but for sure it is worthy to follow him.


Scott Hanselman
One of the most productive developers I've seen, he's a .Net evangelist with years of expertise. His projects and blog are just amazing. Besides that he's a podcaster with various memorable recordings.




November 26, 2011

SE: The house

Burndown to hell

Some basic but very useful burndown chart we used for building a house model.

November 13, 2011

Object Calisthenics

Yet again I come here to share something learned from very smart people. Initially when I saw these rules my head exploded. Even though they are reasonable rules, they break the traditional non-object-oriented I've been doing for a while.



  1. One level of indentation per method
  2. No else keyword
  3. Wrap all primitives and strings
  4. Use only one dot per line
  5. Don’t abbreviate names but keep them short
  6. Keep all entities small
  7. No more than two instance variables per class
  8. Use first-class collections
  9. Don’t use any getters/setters or properties
I'm still trying to wrap a prototype project around them, and the partial results are astonishing.

Sources

November 4, 2011

Software Architecture, lessons learned

There are very good developers, that can create great products out of nowhere without thinking too much. Well, I'm not one of those, it takes me a while to get the right idea, and several times I had to throw everything I've bee working on and start from scratch.

But even in situations like these, there are some things you learn from time to time.


Minimalism

This is something I learned from Robert Martin's Clean Code (but I think it just takes common sense). When your components are not meaningful and don't relate to each other in an almost 'natural' way, you need to refactor it. Your system might work beautifully, but your internal structure is a mess and it will create problems to future maintainers.

Keep it simple

Complex design leads to complex code, complex code leads to complex tests, and the mess has now started. The design has to be as simplest as possible, and your code has to be consequent to this. And by code I mean production code and the test units related, because that it's maintainable code too!. Check KISS Principle on Wikipedia.
 

Life time

System components and inner objects must follow the natural law, die. While shorter your objects live the better, are easier to handle, to test, and to refactor. Including memory usage improvements, as your objects are created and dropped as soon as they are used. This is something I find very useful, and I discovered by playing around with Google's Guice project.

Patterns

Check the patterns once a while, review your architecture, don't reinvent the wheel. There are several good references for it, but I tend to enjoy Martin Fowler's patterns (and the articles describing them). Have a look at the LMAX architecture.

November 2, 2011

Ubuntu usage report: 2 months after

So far I've been using Ubuntu as my laptop's system for two months, did a lot of things with it, including serious applications development.

For doing it so, I performed several package installations and system configurations, including very low-level scripting and server-oriented configurations.



Considering everything I did, this are some things I find very useful in Ubuntu:
  • Package management system, this is perhaps its most obvious feature, it's really simple to install any package present in a repository.
  • User experience, this is also something very well worked. The system is built to make user's life as simple as possible,
  • Boot speed, it makes the difference.
  • Security updates, very robust updates that don't break anything.
  • Software center, a huge amount of software applications available for simple click-installations.
  • Huge community, it's perhaps the biggest Linux community I've ever seen.
But, it has some things that can get potential users away of it:
  • Dependency hell, do you mean I have to install the entire open-jdk stack if I want to install Maven? even if I already have sun-jdk installed?
  • User constraints, if you touch some system configurations that Ubuntu is keeping track of, you are going to have problems.
  • Configuration complexity, Slackware is a heaven compared to this.
  • Imposition, once you update the distribution, you will get your beloved desktop replaced by an awful Unity desktop.
  • Unofficial packages, I had very rough moments try to install something Ubuntu doesn't support, I ended up compiling all the custom software I required.

October 19, 2011

Test Driven Development: Small tutorial

Some weeks ago I did a TDD presentation and for that matter I prepared a small tutorial of how to do it.
Details
  1. I used Robert Martin's approach to TDD.
  2. The example idea was taken from James Shore.
  3. The QueryString(built in the tutorial) component is a simple HTTP parameters parser.
Http Parameters format: http://myhos.org/test?param1=value1&param2=value2




SE books you must read: Effective Java

Although this book is kind of old, is still valid. All its concepts and best practices are still being used and its author is an authority in the development world > Joshua Bloch.

This was the first book I read when I got into professional development, and believe when I say that is one of the mandatory books to read if you want to write something functional in Java.


Effective Java at Amazon

PS: I would like to share the ebook version of it, but I'm not sure about the licensing/copying policies.

October 10, 2011

Why reading is important

I had a long conversation today with a very close uncle, he's one of the most knowledgeable persons I've ever met. He learned to read and write on his own, while working and raising a family.

Right now he's in his 70s but the topics he shares are amazingly interesting, starting from Greek mythology, wars, and ending up with urban legends.



Perhaps his wisdom is the result of many years of experience and living, but I couldn't say. So tonight I asked him about his stories, where they come from? how did you get so good at telling them? how can you remember so many things?

His answers were short and concise, most of the stories were taken from other people, some others are life stories where he was involved, and some others are taken from books. But at the end he told me something that I can't leave aside:

"No matter how long you live, the world is big enough to leave you abandoned if you don't cope with it, read as many books as you can. Because there's something  you can always rely when all your senses start failing, your memory. Sometimes it can trick you, but with a little of practice you can train that little bastard...".

That's something that always has intrigued me, I know a lot of people who reads because they have to, or because they don't know what else to do. Books are the best source of information in world (and digital books count as books), I can't understand how so many people can avoid history, stories, articles and tales just because they prefer to watch it on TV or when a movie is released. It's a waste of potential, human beings should know they environment and what's happened in the world before us, we have to learn history, science, literature, etc.

As the great Steve Jobs said once "Stay foolish, stay hungry".

October 2, 2011

Library management with Ivy

Back in the day, when I was a child, I used to manage all my project's libraries by hand, copying and moving everything I needed for a project into its respective folder.

I was happy with this for some time, but then I had to scale, handle several projects with a mixed set of dependencies. My original idea was to use a grown up tool like Maven, but its XML-hell led me out of it.



The alternative I chose is Apache Ivy, a dependency management tool that only does dependency management, and it's highly configurable (if you do it right).

In this way you can keep several projects linking a common libraries repository that is entirely handled by Ivy, you just configure it.

I recently updated some of my projects to this, the configuration files are quite simple and do all the work, including the Ivy-ant task installation if not available.

Ivy configurations for my Paginator-project

References

September 28, 2011

Migrate Oracle backup script to H2 (mode=ORACLE)

Some work I've been doing today.

September 27, 2011

Code freeze

When you are developing something in a constant pace and everything is moving smoothly, how do you test?

Do you stop coding and then test what you've done? and then go back to code?



This may work for some people, but I struggle when I have to multi-task (this does not apply for TDD) and some of the people I know have the same feeling.

A while ago I worked in a project where there was a 'code freeze' day, in this day nobody could commit anything to the repository and everything you had to do was to test and register the bugs you've found.

This was something conflictive for us, our how development model was to produce something and to deliver as soon as possible, trying to fix the bugs as soon as they were registered.

Advantages

  • One of the advantages we found using this practice was that the bugs were found faster.
  • We could plan and estimate all our bugfixes.
  • All bugs were easily reproducible.
  • All bugs were registered and assigned properly. 
  • We switched roles, for one weekday we turned into testers (and loved the idea of relaxing while working).
Interesting links

September 26, 2011

Robert C. Martin: Programming Languages

Robert C. Martin has been an authority in computer science for many years, most of his work and publications are taken as must-do in Software Engineering.

Here we have it at RailsConf giving us an history lesson about Programming Languages and the evolution of computing science.


September 21, 2011

SE books you must read: The Pragmatic Programmer

Once I started working of professional software development, I was eager to learn what the world was doing at the time. I had left university and working for a considerable payment was new for me, I wanted to deserve it.

Then I started reading a lot, several books about programming an engineering, some of them were obsolete and a complete waste of time. But every once I found a jewel, and this is a very good one:



Every person getting into software development should take a look at this book, I'm not saying that everything it's written in it has to be followed religiously, but it has very good advices and practices.

September 18, 2011

Podcasts I enjoy listening

Precedents
While going to work or when I'm walking from work to the university, I tend to get bored. A year ago I got an iPod due to some obscure business, but that's not the point of this story, and I got reallz interested in its Podcast feature.
Although it's just a radio program meant to be played in a mobile device, it is an amazing source of entertainment and information. I started listening podcasts about technology and engineering because of my English-level. But after some weeks of practice I started listening to some programs that I considered "advanced".

In summary, here they are:

September 17, 2011

Mi forma de aprender

Recuerdan cuando estaban en primaria y no podían multiplicar, sin importar cuanto lo intentaban?. Yo tuve ese tipo de problemas durante toda mi vida, el estudio en su estado puro nunca me llamó la atención, tal vez por una falta de atención patológica o simplemente por pereza. Incluso no llegué a leer un libro completo hasta los 15 años, realmente los odiaba.

Ahora soy un ávido lector y me emociona el hecho de afrentar algo nuevo, de aprender y de hacer que las cosas sean posibles. Qué cambió desde esos años de sufrimiento?

Sencillamente, solamente cambié la forma de ver las cosas, si no podía aprender como multiplicar, trataba de hacerlo divertido o al menos interesante, durante esa época solía trabajar con mi padre lavando autos, y eventualmente recibía una paga por ello. Me interesó el hecho de pensar en cuanto me tardaría juntar dinero suficiente para comprarme lo que yo quisiera. Y ahí está!!, empecé a tomar las operaciones matemáticas como algo necesario y que me llevaba hacia algún lado.

Empecé a leer libros que tenían historias increíbles y hacía, todavía hacen, volar mi imaginación más alla de los límites físicos. El hecho de ver el aprendizaje como algo mas allá de lo rutinario cambia la forma de visualizar el conocimiento, durante los años iniciales de trabajo, tuve serios problemas al ser un hispano hablante de segunda, trabajando en una empresa con un entorno de inglés puro, una pesadilla!.

De nuevo, el reto, la forma de atacarlo?, durante ese tiempo me interesé bastante por los mangas, léase comics, japoneses, eran la nueva barrera de la imagicación. Entonces por qué no intentar leerlos en inglés y ver como va la cosa. El inicio fué duro, el inglés no-técnico es todavía un reto para mí, pero el entorno de aprendizaje no puede ser mejor, tienes imágenes que relatan la historia!!.

Sin atajos en eso, fuí capaz de aprender un inglés rudimentario pero comprensible en unos cuantos meses. El resultado del aprendizaje no debe ser el premio al final de un camino duro, el aprendizaje no tiene por qué ser difícil, yo critico mucho a los docentes empaquetados que dictan sus materias como si fuese una lectura de grupo, eso no es enseñar.

September 14, 2011

Quick and dirty LOC counter written in Ruby

A few weeks ago I needed urgently to measure some projects I'm interested in, but I didn't have an internet connection to download the latest application that would do the work for me. So, I decided to write my own LOC counter.

I didn't want to write it in Java because of the time consuming for it, and as I am learning Ruby, I just gave it a try.

Result

A very short and dummy implementation that took me nearly 15 minutes, reading some API docs and testing, I don't know how to express it, but it feels right. If I would have done it in Java would work even better, but I like this approach, clean and short.


September 5, 2011

El saber de lo desconocido

A pesar de que el ser humano intente controlar todos los aspectos de su existencia, es inevitable prevenir lo que dicta el transcurso del tiempo.



Cuántas veces me he dicho a mi mismo que el destino es sencillamente una secuencia de eventos que consecuentemente conllevan a un resultado inverosímil. Cientos de veces la lógica intenta calar todo lo que hago, pero algunas veces el pensamiento se rinde al instinto y al condicionamiento.

Quien declame que no somos animales es un ciego al mundo, así como aquel que niega lo desconocido y lo que no puede explicar. El ser humano nunca ha buscado controlar su propio destino (interesante palabra relacionada paradójicamente a la cultura sectaria), sino el porqué de las cosas.

Basta pasar un día con un niño de 3 años para entender todo lo que hemos perdido durante el transcurso de nuestra vida. La sociedad nos organiza en una entidad coherente con un objetivo común, utopía de sociedad, pero no inesperado del instinto humano desvía esta sociedad fuera de los límites. El ser humano, así como los animales, somos difíciles de dominar, y el colectivo respalda al caudillo cuando este alza su voz.

El condicionamiento de la mente es saludable en una sociedad, pero aniquila el intelecto humano y la capacidad de auto-superación, desgranándola a niveles tales que ya nadie recuerda cual es el sentido de la existencia.

Recuerdo Fuera de Tiempo

Tal vez un poco tarde, pero no quería dejar esto e lado.

Hace ya 5 años perdí a una de las personas mas honestas que haya tenido el gusto de conocer, estoy seguro que mi impresión de esta persona se replica en la mente de todos los que lo conocieron y disfrutaron de su presencia en este mundo.



Yo era una persona desinteresada por completo de lo referente a la muerte y sus consecuencias, nada mal viene el dicho "nadie sabe lo que tiene hasta que lo pierde", no puedo explicar de forma tan sencilla todo la marea de sentimientos encontrados que sufrí(y todos sufrimos) al enterarnos de la noticia.

No es el asunto inicial el por que, o el como, sino una tremenda sorpresa que ataca en lo mas profundo del "alma", o como quiera decirse. Es el sentimiento repentino de que has perdido algo tan preciado y tan poco considerado, la inmediata ayuda y apoyo familiar por supuesto que son un alivio. Pero jamás es suficiente; el sentido de la vida se pierde aunque sea por un instante, pero así es.

Nada puede reparar el dolor de una partida, no importa lo que digan, lo único que opta por hacer es seguir, no existe otro camino.

El dolor nunca se va, todos los días el recuerdo regresa, y tal vez, me da alguna fortaleza. No digo que no deban olvidar(aunque en ocasiones es deseable), pero no esta de mas recordar.

Prepárense para con sus allegados, nunca se sabe que frágil puede ser una vida hasta que se te escapa de las manos. Dense cuenta de lo que valen para su entorno, aunque no lo demuestren, el odio o peleas son algo, incluso una razón para mantener una relación.

Lo peor transcurre en la mente, el conflicto interno no es algo que se deba tomar a la ligera, mucho menos con personas de baja autoestima, es necesario ser fuerte. Nada prepara para estos momentos, y nada mas que el momento en si debería hacerlo.
No crean que nunca les va a pasar a ustedes, por que la vida es un momento, y así como llega pasa.

Amen lo que hacen, con quienes están, con quienes estarán. Por que el final de una vida no anuncia su llegada y la vida nunca es justa, por mas que la gente tenga fe en ella.

Migration

Sadly after several years of using Slackware as my main operating system, I have to leave it aside. The decision was taken after several attempts of installing networking tools and Perl patches, somehow I broke several libraries and my system was a complete mess.



Slackware taught me everything about Linux and software development, but the tinkering time for
me it-s over. I can no longer spend hours having fun compiling sources or testing different configurations. My system has to work with the most recent hardware and it requires some sort of support. The distribution I chose for this is Ubuntu, not because is the best one out there, just because its community. It's a huge system with lots of groups around the world following (in their own way) the Open Source initiative.

I still have Slackware running as a server, because it's without any doubt the *stablest* of all systems I ever used, that's a fact. But for my personal computer requires compatibility with many devices that are not open source and work fine with Ubuntu.

PS: This does not mean that I'm leaving Slackware at all, but for my personal computer. All my other machines are still using Slackware as the master system, and they'll keep in that as long as Slackware lives.

August 12, 2011

Huawei modem in Slackware Linux

Finally, after several minutes (Linux software is getting better) I made it work. I bought a Huawei modem USB a few days ago, and the phone company who sold it to me only supports Windows and Mac systems.

After a while and thanks to a great tutorial, the connection was performed; this is the article I used: http://www.techonia.com/install-huawei-usb-modem-slackware

Note: You have to set manually your DNS nameservers and the default gateway route, that's it.

March 23, 2011

Configure DiffMerge on MacOSX

Based on this article, I modified it a little bit in order to make it work on Mac:

[diff]   tool=diffmerge                                                                                                                   
[difftool "diffmerge"]                                                                                                                      
  cmd = exec /Applications/DiffMerge.app/Contents/MacOS/DiffMerge \"$LOCAL\" \"$REMOTE\"                                                                                                                                   
[merge]                                                                                                                                     
  tool = diffmerge                                                                                                                    
[mergetool "diffmerge"]                                                                                                                            
  cmd = exec /Applications/DiffMerge.app/Contents/MacOS/DiffMerge --merge --result=\"$MERGED\"\n\"$LOCAL\" \"$BASE\" \"$REMOTE\"                                                                                           
  trustexitcode = false     

February 19, 2011

Distributed software development

As you have seen through the entries of this blog, I'm a distributed-stuff fanatic. I really think that the future of software development is closely related with this concept.


Many problems arise when you are working in a project that involves more than 2 developers, and the problems are even worst if new developers are included into the development process. It's a mess.

But you can make it work if you follow a simple goal: Every developer should be able to do whatever he wants without bothering anybody else.

This is very important when you are working in a database-based application, if several developers test their applications against a central database, you will have inconsistency problems in a matter of minutes.

I have worked in projects where this kind of problems arose more than once every day, it's a complete mess when testing and even worst when you are trying to integrate the work.

But not everything is bad here, I have also worked in projects where everything was meant to be distributed. Working with local databases such as H2 and versioning tool like HG or GIT. It's a big difference to be able to test all your changes without messing with other people data.

If you are working in a project with 2 or more developers, configure the project to be self-sufficient in all senses: Database, compilation, deployment, execution, tests.

Your development process will be shorter and the integration problems will be reduced, I can assure you that.