Ruby is in top ten programming languages

2007/09/30

According to the TIOBE Programming Community index (which gives an indication of the popularity of programming languages), Ruby jumped 3 places and made it to top ten. Congratulations !

If you look closely on the trends down on the page, the dynamically languages popularity has risen over 3.6% during year period. Which is A Good Thing (TM).

Should I make my personal Top Ten of the programming languages, ordering languages by my degree of comfort of using the language, the language beauty (which is, in the eye of the beholder ;-)). Factoring in also how much I do enjoy reading/writing code in that language and it’s usefulness from both personal as well professional point of view, the index would look like this:

  1. Java
  2. C#
  3. Ruby
  4. SQL (both T/SQL and PL/SQL)
  5. Javascript
  6. Objective-C
  7. Python
  8. Shells (mostly BASH)
  9. Perl
  10. VB.NET

First place is practically tie – as the Java / C# are in reality more two dialects than two languages. They were very close at the beginning and with latest versions (C# 2.0, Java 5) they got even close. As it looks like, in the future they may diverge more with all the LINQ stuff coming in C# 3.0. I like Java portability, amazing variety of open source code available – and the development tools are IMHO still better on Java side (Eclipse, IDEA, Netbeans), but C# syntax of properties is nicer and there are slightly more commercial opportunities with Microsoft platform (at least during last 3-4 years).

The only “real” compiled language in my list is Objective-C, for which I have absolutely no commercial use for right now, but I hope that will change one day when the greatest of all cats finally arrives. Neither C or C++ made the list – the only encounters with C these days are during installations of Ruby GEM on Linux or Mac platform – which often comes with native part in C source – and the installer barfs at me with some gcc error :-). And despite using Mac for over a year now, I felt no need to write anything bigger than Hello World in AppleScript

Advertisements

Netbeans Ruby IDE – great tool getting even better !

2007/06/24

I have spent last two days (and few evenings before) playing with Rails and using Netbeans Ruby IDE. What a great experience ! Unlike before, it is so much easier to have really good debugger that allows put breakpoints not only into the Ruby code in controllers and model – but even into the RHTML view files !

Netbeans team works hard on improving the tool. With latest build – 2434, I have noticed great addition – Rails console. The IDE had IRB window even before, but the environment did not load the Rails context and would not recognize e.g. ActiveRecord. Now with latest build, everything works like charm.

Using Rails and coding in Ruby is real pleasure and the only pain-point was (compared to using Eclipse with Java or Visual Studio 2005 with C#)  unavailability of a really good IDE. Yes – I tried RadRails and RDT plugin, but they still need lots of improvement and are not (yet) in the same league. Netbeans Ruby IDE is right now very likely best available free environment for Ruby and Rails environment. It allows work with both Ruby and JRuby with or without Rails – what more can you want 😉 ?

Thanks, Sun and the Netbeans team !


BOTD: Railscast

2007/06/19

Today’s blog of the day is not really a blog, but a screencast. Dedicated to Ruby on Rails, the Railscast offers (as of today) 46 episodes of short, targeted practical advice on various aspects of Rails development.

Unlike some other screencasts who try to record the screen action as MPEG movie, this one is perfectly legible. In addition to the Rails enlightenment, you can also enjoy the speed and aesthetics of using TextMate  – with many great Ruby editing shortcuts and beautiful OS-X typography.

Available as subscription in iTunes – search for Railscast.


Swing-ing back – to Netbeans

2007/06/11

It has been quite some time since I used a Swing based Java application. Compared to beauty and close-to-native feeling of Eclipse based application, Swing just did not feel right – it looked differently and behaved a bit differently. For long time, my desktop was Swing-free (not counting the JDK demo). Not any more, though.

What made me to reconsider, is new release of the Netbeans v 6. In the latest milestone builds (M6 to M9), Netbeans team built amazing Ruby development environment. Compared to Ruby plugin in Eclipse, it has way more functionality, better debugging, really impressive editing support and very cool Rails extensions. The full description of new features is here.

Best way how to start is to download pre-built IDE (inluding Mac friendly packaging) from NBExtras and give it a try. I was quite impressed. On modern hardware, the IDE is very responsive and Ruby development in Netbeans is even more fun as usual. The only small annoyance is frequent redraws and “flicker” of GUI when running on Windows – but it is likely one of the issues that may go away in final release.


Martin Fowler’s article on Ruby and Microsoft

2007/06/03

There has been lots of interesting news related to Microsof and Ruby recently, mostly about DLR’s support of dynamic languages. One of my favorite tech authors stirred the waters once again last Friday with an article that goes beyond this and tries to paint larger picture of the uneasy relation between Ruby platform, Agile movement, OpenSource Community and Microsoft.

One quote from the article:

The attitude to open-source is a large part of this problem. When Java appeared there were yawning gaps in its portfolio, and worse some dreadful standard tools in its API (visions of Entity Beans spring to mind). Those gaps and bad ideas were fixed by the open-source community. Ant gave us a build tool, EJB was displaced by Spring and Hibernate. .NET has also got its gaps, and again the open source community has stepped up to fill them. Yet Microsoft refuses to collaborate with these efforts, even seems to go out of its way to undermine them. I was particularly sickened by Microsoft’s reaction to NUnit – an excellent XUnit testing tool, elements of whose design were lauded by Anders Hejlsberg at OOPSLA. Microsoft ended not just bringing out a competitive library, but deliberately making it incompatible. That’s not the kind of reaction that encourages people to invest their time in the platform.

There has been many reactions, the most notable by Rocky Lhotka, Sam Gentile, Cory Foy. They do not necessarily agree with Martin Fowler (but quite often do), but mostly they do confirm, that there is indeed a problem with how to deal with Open Source. Microsoft on one side would like to be the center of grass-root movement, lead and inspire it and benefit from innovation coming from the masses – and at the same time keep full control over the community project’s direction and code base. This is impossible, as other companies (like Sun) found out the hard way.

Unlike the reactions above, there was also lots of very different reactions – as one could expect with such flame-baits in text 🙂 Like this one – proudly promising “deconstruction” of Fowler’s article. The author even found in the article lots of between-the-lines meanings like:

“Fowler is, in almost as many words, claiming Ruby is not a language, but a religion. Complete with values (commandments), a community (church), and a priesthood (himself, among a few others). I had to pick myself off the floor the first time I read that. ”

Strangely, even after re-reading the article, I did not see that. What I saw is confusion between the community passionate about platform or technology and a religion. Which only confirms that it is very hard for Microsoft’s hardcore fans to understand how open source movement and communities work. I think that an unbiased reader can find the Aaron’s article filled with more religious-like zeal than Fowler’s:

“LINQ, Lambdas, Expression trees, WCF, Workflow, WPF, Silverlight (again), IronPython, IronRuby, holy !@#$. A loud yawn? From whom? Certainly not from my clients or colleagues, who are salivating over this stuff. LINQ, more than Ruby, more than Java, will change the way we code – no other language since Foxpro has had this level of support for set operations directly in the language (yes, I know people that still do Foxpro, and they are laughing their *!#es off at how LINQ is a reinvention of what they have been doing for 20 years, but I digress).”

Truly enough, there is merit to the statement that mixing SQL (or SQL like) code with language used to code the user interface (which in a nutshell is one the LINQ “innovations”) has potential to change the way how we code. For the worse …

The other caveat is that it already did happen few times – and latest incarnation of this masochistic coding practice is used a lot in the PHP camp. And before PHP – let me think: DBase ? FoxPro ? MS-Access ? SQL-C ? None of these is exactly major enterprise software platform today, right ?

I also quite share the excitement for lambdas and other functional programming constructs, but do not quite get how should they be a LINQ or Microsoft’s innovations – or innovations at all. Apart from the fact that languages such as Python, Ruby, Haskell do have very powerful functional programming support for like 10-15 years – and IMHO better one than C# or LINQ – all this goes back to Lisp, which will be celebrating 50th anniversary next year.

But it is not the technology that is main source of tension and controversy here. It is the relation between open source projects and Microsoft. This relation was always problematic one – which is one of the reasons why are there so relatively few thriving OSS projects on Microsoft based platform, considering the Windows domination (I do NOT say that there are few projects, I am saying that with Windows owning maybe 90% of installed PC base, there should have been many more MS toolset based opensource projects than there are).

As one the reactions on Fowler’s article did put it: “Microsoft consistently moves to take the air away from its competitors, and it views successful OSS as competition. If you ask me why my team at Oxygen uses MbUnit instead of MS Test, Castle instead of ObjectBuilder, NAnt instead of MSBuild, and Subversion and CruiseControl instead of Team System, there are a few reasons. The first set of reasons are the standard OSS arguments: control, community, fitness to purpose, and price. The second set of reasons boil down to me being pissed off that Microsoft is trying to suffocate these projects instead of supporting them.”

Our recent experience with last two large .NET projects confirms this findings – we ended up using NAnt rather than MSBuild, because it was much easier for us to enhance and extend it, using CC + CVS/Subversion + MbUnit rather that VSTS – as there was no appealing reason to justify the cost and overhead.

As long as this is reality, the strange relationship MS vs OSS will probably continue. Which is too bad – because pragmatic software developers need the MS platform and MS needs developers and thriving communities. The .NET is pretty decent development platform – the best we had on Windows in last 20 years. After developing for many years for Windows in C with Win32, C++ with MFC and ATL, COM and DCOM, VB and doing ASP Websites I really do value how huge improvement is C#, .NET and the VS2005. It is therefore very sad to read that people and teams who work on improving the tools for the platform are attacked, rather than supported by the platform owner. Or hear about legal threats and possible patents lawsuits against open source …

To demonstrate how company cares for developers, shouting Developers, Developers, Developers does not really cut it – even if shouting is really loud and delivered by the CEO. Supporting and encouraging more really successful projects like DotNetNuke or Mono – or sites like CodePlex does.


Code in Ruby under ASP.NET: coming soon ?

2007/06/02

The support for using dynamic languages such as Ruby or Python to code ASP.NET pages was announced for future versions of ASP.NET in the ASP.NET futures.

Unless I am mistaken, it means that we eventually will be able to write control event handlers in Python or even Ruby – which is certainly more fun than in VB.NET or even in C#, but is it really so important ?

What would be *really* cool if the whole ASP.NET become more agile and more “rail-ish”. To make overall architecture more flexible – such as departure from not very flexible page-centric architecture towards MVC and routing. Maybe some version of ActiveRecord ? Or even multiple (and pluggable) template languages ? That would be really something.


Best book for Ruby on Rails

2007/05/07

During last two weeks I have been reading and playing a lot with Rails.  Now I am in the state where I think I started to “get it” and understand how things work under the surface. Which means I am ready actually start using the framework for real work and become proficient as I get my hands dirty.

To get to this state, absolutely essential and by far the best book is the classic one – Agile Web development with Rails co-authored by the original Rails designer and one of the Pragmatic Programmers. Like other books, the first part is sort of step-by-step code tutorial, which leads you through creation of a Rails application, shows you how you access data, create UI, use scaffolding, etc etc. Unlike other books, this does not stop there and the second part of the book is an excellent coverage of Rails internals – ActiveRecord, ActiveView and templating system. Very well written and offering great balance between covering important features without becoming reference manual.

The best feature of this and other Pragmatic books is that you can purchase it as e-Book in the PDF format (without any DRM restrictions, just customized with  your name in text) which is cheaper, very portable 🙂 and very search-able. As added bonus, you get free updates when Rails changes or an error is discovered. As matter of fact, I just got such email, only few days after I bought the book.

The above book is not the only e-book I have purchased from Pragmatic Programmers. After 9 years, I have decided to buy a book covering such basic and boring thing as an editor. My previous (and first ever) book focusing  on how to use an editor was “Learning GNU Emacs“, back in 1998. You may say that if you need a book to use an editor, there must be something wrong with that piece of software. That is certainly one possible view. But the other explanation is that the editor is so powerful, extensible, customizable that it allows many ways how to be used and deserves the book. In my opinion, the later is very true about Emacs. I was using it for few years, but eventually switched back to Windows alternatives or IDE’s such as Eclipse or Visual Studio.

Now there seems to be another editor that has promise to be such great, powerful and  extensible tool as Emacs was  – but different way. It is TextMate – an editor available only on OS-X platform. I have got the license as part of the Mac Heist charity sale over Christmas and so far I was only scratching surface of its capabilities by using it similar way how I use Notepad++ on Windows. So I have decided to spend 20 bucks and few hours to “unlock the power” – editor is such basic tool used for hours every day that improving and optimizing your work habits actually can make a huge difference. Besides, TextMate is “the editor” for Rails development on OS-X and I am now in “wow-phase” of discovering the power of bundles. If you are on a Mac, give it a try – it is worth it.