Development thoughts

I build web stuff with JavaScript and Node at @SocialBro. // Interested in distributed systems with Scala & Akka // @erasmusu cofounder

Development thoughts

Iván Guardado personal site

Consejos para un chico de 13 años que quiere aprender a programar

El otro día amanecí con una mención en Twitter de mi colega @javilop, en la que me sugería que diese alguna recomendación a un chaval de 13 años que había acudido a él para pedirle consejo sobre cómo empezar en la programación.

Aunque me gustaron los consejos de Javier, la pregunta no salió de mi cabeza durante el resto del día. Continuamente me venían ideas a la cabeza de cosas importantes que un joven cómo él, apasionado y con muchas ganas de aprender, debería saber antes de meterse en este mundillo. Esto es lo que añadiría a la respuesta de Javier.

Proponte retos

Leer uno, dos o un gritón de libros de programación no va a hacer que te conviertas en programador. Para mi la forma más eficaz para aprender es estando en primera línea de fuego, es decir, escapar un poco de los típicos ejercicios teóricos trabajando en un proyecto que tenga sentido en la vida real.

Elige uno que te motive y ponte manos a la obra cuanto antes, así te enfrentarás a un montón de dudas que de otra forma ni se te pasarían por la cabeza. Cada duda resuelta es una duda menos que tendrás en tus futuros proyectos, y es que como en todo, necesitas practicar para mejorar.

Aprende del Open Source

Otra forma muy buena de aprender y mejorar es ver como están desarrollados otros proyectos por gente con experiencia. Leer código de otros tiene muchas ventajas: entender cómo estructurar tu código, aprender algun hack, descubrir nuevas librerías o clases, cómo hacer tests, etc…Asique no dudes en buscar algún proyecto Open Source que te fascine, descárgalo, hazlo correr en tu ordenador y… (¿por qué no?) intenta hacer modificaciones, aunque sean pequeñas :)

Continua estudiando

Una vez controles tu primera tecnología… ¡enohorabuena!, ¡ya estás listo para seguir aprendiendo! Aunque estés centrado en una tecnología o lenguaje de programación concretos, es importante que no te estanques y sigas aprendiendo otros nuevos, ya que estos ayudarán a ampliar tus horizontes y nutrirán de manera muy positiva tu manera de ver la programación.

No importa si lo haces mal

No te frustres si no consigues que tus programas se vean tan limpios, organizados y perfectos como se supone que deberían ser según la teoría. Aprender a programar es relativamente fácil, aprender a crear código organizado y escalable es lo realmente difícil que algunos llevamos años intentando mejorar. Simplemente recuerda esto: es mejor hacerlo mal, que no hacerlo.

One year developing SocialBro

This month is the first birthday of the SocialBro tech team and I think it’s a good moment to get my blog back and look at how I’ve lived this year.

My joining to the team was a pretty crazy. I applied for the job at Thursday night and the next day, while I was in a Madrid journey, and only after one interview by phone with Alfredo Artiles, the CTO, I was notified that they wanted me in the team. I had to join with the full team one week later. One week, an unknown city with unknown people…but it was an opportunity that I couldn’t let it get away.

At that time I felt stuck in my job. I’d been working with the same technology for years: PHP, Javascript, Mysql and a bit of sysadmin basically. While I could build all my projects with them, I had the feeling I was missing something. SocialBro offered me that breath of fresh air I needed: a single-page application, supported by a NodeJS, MongoDB and Redis backend. All recent technologies, which I hadn’t experience with. Could I find anything better? No, that’s the reason why I couldn’t get it away.

Beginnings were hard because I had, on the one hand, to learn to master the new technology stack, and on the other hand, to get on with the project code, which was already huge at that moment. In addition, I started as Frontend Developer, rol which I wasn’t played at 100% ever. Luckily, I love my job and I willingly faced that challenge and everything was easier.

One month later everybody was comfortable with the project and we had a roadmap to accomplish, so we started to push to put SocialBro on a higher level. Users have seen a lot of new features for this year, as well as a lot of improvements on the old stuff, for example, gradual changes to the look and feel. At the code level, we’ve cleaned and debugged a lot, in order to make more stable and more scalable the application.

All that glitters is not gold. When I saw the frontend code at first time, I realized the huge amount of work we’d have to do to in the next months. We’d need to refactor the whole CSS and frontend JS in order to keep it organized and understandable. But we were smart enough to know that time is the most valuable resource in a startup, so we decided to make that refactoring gradually. In order to improve the code with small steps, I like to apply The Boy Scout Rule: “Always leave the campground cleaner than you found it.”. Now we are a bit happier programmers, although we have still a lot of work to do.

During this year, we’ve also seen the whole process until raising a $1.8M. Although the team in charge of that worked in UK, we were visited by an investors team in our Spain offices. We also had a IT Due Diligence, which I absolutely didn’t know at that time.

One year later, it’d be very difficult to summarize what I learned in a post, and it also isn’t my intention.  My intention is starting to post about what I work everyday, and now my focus is in AngularJS and web performance on the frontend side, whereas everything related with NodeJS and much Grunt surely on the backend side.

At last but not least, I want to congratulate the full team for this year and I really hope to write next year again talking about the amazing things we lived this year.

"Opportunities are found by those who look for them. The bee has a sting but honey too… so look at every negative and make a positive out of it."



Create DOC, PDF and ODT files with PHP (but easily)

One year ago, I was assigned the task of create MS Word documents from PHP dynamically. After much research, I can’t find a library to accomplish the task easily, I found payment or complex solutions. So I decided to make it by myself.

I created a small project to generate DOC (MS Word), PDF and ODT (OpenOffice) files based on a ODT template. You only need to create the template and assign it the data from PHP.

Now, I have decided to release the code in order to help people who need it and to get help from community contributions. I would very happy if you decide to contribute the project.

On my github, you can access to the project PHP EasyReport

Hello world!!

This is my first post on tumblr… I’ll share solutions, doubts, snippets and other resources about software development in general and web development in particular.

I hope you like my blog and don’t get angry with my english writing errors :)