Archive for the 'General' Category

Ruby Cookbook: Rough Cuts Version

Antonio Cangiano January 30th, 2006

Ruby  Cookbook

Currently online O’Reilly is selling the rough cuts version (basically the beta version) of the Ruby Cookbook. It’s a pleasure to see that many good books about Ruby are being published.

This book authored by Leonard Richardson and Lucas Carlson is particularly special to me. In fact, I have contributed to the book with three recipes and related full-length explanations. My recipes are about using RMagick to achieve common image manipulation tasks, as I love photography and I like RMagick a lot!

The recipes are Thumbnailing Images, Adding Text to an Image and Converting Among Image Formats. While these tasks are quite easy to achieve thanks to Tim Hunter’s library, I tried to go the extra mile and provide a good sort of introduction to the library, within the limits of the problem/solution framework of these kind of books.

It’s my first contribution to an O’Reilly book and I’m humbly proud of it. I look at it as a stepping stone until the day when I’ll publish my own book about Ruby :-)

Ruby rocks and Java sucks?

Antonio Cangiano January 22nd, 2006

Java VS Ruby

Many hackers are quite religious about their programming language of choice, but I’m not. Whenever possible I try to be rational about things that matter to me. For this reason you won’t hear me saying things like: “Ruby rocks, Java sucks!”. Indeed Ruby rocks, but it does so for me, for the kind of development that I love to do and for the way I like to think and express my thoughts in code.

I am quite confident that Ruby would be a great programming language for a broad audience of hackers worldwide, but this doesn’t mean that we should belittle those who happen to work with Java, C# or other “bureaucratic” language. On the web there are thousands of threads about “Java vs Ruby”, “PHP vs Rails”, “Python vs Ruby”, “C# vs Java”, and so on… this is mostly non-sense. Of course all these languages have differences that will determine your life as programmer, but you really need to go and try them out for yourself. Spend time selecting and learning your development platform, experiment, and if possible learn more than one language and framework. Different paradigms can be a huge gain for the programmer in terms of flexibility. I really love to work with drills, but sometimes you need a screwdriver, or just a hammer. “Buy some tools” keep them in your toolbox, and then use the ones that will let you do the job better. Or that are requested by the company were you work or by the client, or again that you enjoy using the most.

Some programming languages let you be more productive than others in particular circumstances, create a more maintainable code and so forth. Assembler is definetely less “human-friendly” than Python for example. But in the field of general purposes languages, the real bottleneck is often the programmer not the language! It’s your level of mastery of the language, that makes the difference in most cases. I love Ruby and it is in my opinion, a slightly better language than Python, but at the moment I am not half as productive in Ruby as Alex Martelli is in Python. :-)

One day my wife asked me why I was so passionate about Ruby, while I used to be interested in C# a lot. She asked me what the difference is and the advantages are? Now, she is a very smart woman, but she hasn’t a programming background so I tried to explain to her without going into details like dynamic languages, meta programming, ORM, and so on. She mostly got what I meant but I was looking for a more effective and direct way of illustrating the concept.

A few days ago I remembered the funny photo that you can see on the top righthand side1. That’s probably the best answer: simplicity. Ruby doesn’t get in the way and it lets you express your ideas, because Ruby is as simple as possible but not simpler as Einstein would say. You don’t need a dozen books to master Ruby or Web development with Rails, you just need a couple of books, a brain and some practice.

(1) I’d like to give credit to the author of the photo, but I don’t know who originally took the picture. I’ve only added the Einstein quote and rounded the corners.

Moved to Typo

Antonio Cangiano December 31st, 2005

I finally got a good Rails hosting service for a fair price. As soon as I had access to the account I installed Typo. My blog is now powered by Typo, Rails, Ruby, MySQL, Apache and FastCGI. I have copied all the previous posts from blogspot. I apoligize for any inconvenience that this may create; if you are following my blog, please update your bookmarks and feeds.

puts “Hello, Ruby!”

Antonio Cangiano December 22nd, 2005

Long winded introductions are either boring or brilliant. More often than not the former. I often skip the preface and acknowledgments in technical books, to find a more interesting entry point a dozen pages later. I will therefore save you from the burden of a boring, egocentric and narcissistic presentation while still introducing myself.

My name is Antonio Cangiano, I am 25 and I am an Italian living and working in Ireland (for the moment). I am mainly passionate about programming, development and the Web. To be faithful to my personality I must comment that my interests are as wide as it gets. However the arguments that I’ll deal with in this blog will be quite narrow.

My favourite programming language is Ruby. A modern, dynamic, flexible and powerful object oriented language that has won my heart for almost a year now.
While I have used C# and Microsoft .NET for several years, I now do only a limited amount of work with them because of my great interest in Ruby. I have played with .NET since the first public betas debuted, and even started the first website in Italy dedicated to C# back in 2002. You can visit it at www.visualcsharp.it. As proof that I still utilize C#, I am currently writing a C# 2.0 concise guide in Italian. So please don’t get me wrong, C# is a language with substantial potential (especially version 2.0 and in prospective 3.0), the Foundation Class Library is extremely wide and ASP.NET 2.0 has achieved many improvements over its predecessors. My first publications in nationally syndicated magazines were articles about C#, VB.NET and ASP.NET, so in a way I should even feel “sentimentally” attached to these languages.

All this said, .NET is still like an Italian expression that says there is no point in “using a cannon to kill ants”. Like in the case of J2EE. It is an overly complex architecture that requires a very steep learning curve and years of experience to achieve a not so impressing level of productivity. In a world were everybody is a hurry, and time is money, the productivity of a language or a development environment becomes key. .NET achieves the maximum extent of its productivity mainly through expensive IDEs created by Microsoft.

I don’t like the logic behind this; I prefer much more a powerful language and framework that lets me express my ideas in a productive way with any IDE of my choice. Instead of using another one - that without a good, and often pricey, IDE - looses most of its power and RAD merits. Some go so far as to declare that C# and .NET are just ways to sell you Visual Studio .NET, their many books, certification, etc… Let’s be practical and fair though, if I need to create a heavily GUI based Windows application that will never require any porting to other platforms, I will probably use C# with Visual Studio .NET. Doing so will save me time spent on the UI design and make the client happy. This is just a practical the principles that makes me a pragmatic programmer.

More often than not Ruby is my tool of choice because it lets me quickly develop solid, cross-platform, beautiful and readable code. Furthermore through Rails (for example) I can write killer web applications in a fraction of the time that ASP.NET or J2EE require.

Ruby has a fantastic community of truly amazing programmers and individuals, who are friendly and always ready to help newcomers. The spirit of the Ruby community can be a paradigm for many other open source groups. As if all this wasn’t good enough, so far there are just a few books about Ruby, but they are truly fantastic gems (pun intended) that help you to wonderfully master the language. In a short time Ruby becomes like a second skin, and it lets you express your thoughts in code: a very rewarding feeling.

The previous long paragraph should be enough to explain why I decided to start this blog dedicated to Ruby, Rails and development in general. I am still learning Ruby, and far from being an expert so far. However from now on I am going to focus and dedicate as much time as possible to mastering Ruby (and also Rails for the Web).

Some may argue that there are next to zero Ruby jobs in Ireland, and very few worldwide. Despite this current situation I prefer to go ahead with Ruby (in a “non-religious” way of course) and invest a lot in it. While C# or Java are very sought after at the moment within the industry, I prefer to be/become a Ruby hacker rather than the average Joe programmer in a big multinational. Futhermore, Rails is getting very popular these days and this should improve the job market situation for Rails and Ruby programmers.

This leads to my plans for the future. I’d like to always continue to get more and more involved in consultancy work (coding and writing) and if possible one day found a startup that produces brilliant web applications for the masses. Ideally I’d like to move permanently to Canada (my wife is Canadian, eh!) or the USA. But life is what happens to you while you spend your life planning something else, so… we will see what the future has in store for me.

To conclude this long post that violates its own preface, I’d like to add that I am what might dubbed a “humanitarian rationalist”, who enjoys mathematics, web surfing, photography, poetry, literature and anything that stimulates one’s intellect and never ending curiosity. Blogging is an interesting experience which is beneficial for the author and hopefully for the readers as well, so I can only promise that I will try to do my best.

« Prev