Skip to main content

Chapter 6: Ruby in the Rough

8 replies [Last post]
invalidname
Offline
Joined: 2003-06-09
Points: 0

Chapter 6 explores Ruby in depth as a possible successor to Java, or at least as a language that contains many of the traits you might expect to see in important emerging languages. "I don't want this book to be an exhaustive review of programming languages. I'd like to point out one language and two frameworks (one in Ruby and one in Smalltalk) that have something special to offer. In this chapter, I introduce one possible alternative language, Ruby. I want to show you that some languages can improve on Java, but that doesn't mean that Ruby will succeed, or that it's the best possible alternative. The best that I can do, for now, is to show you one possible alternative, so you can see if the case makes sense."

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rickcarson
Offline
Joined: 2004-03-04
Points: 0

> Your point is?

Obviously the point is a reality check.

Is Java (16000+) threatened by Ruby (406)? Hardly.

It provides a useful talking point for discussing the weighting of languages. The top 3 are what I would call 'application languages', and they have a commanding lead over the rest of the field.

> The fact that PHP, a language without any major
> company backing and a very specialized domain is so
> close to Java (12000 vs 16000) is interesting.

The next 3 (PHP, Perl, Python) after that are the most significant when it comes to scripting languages, and I think they collectively stand for the P in 'lamp' (linux, apache, mysql and perl/php/python).

Though PHP outweighs the other two combined.

There is a significant drop between the Java and C bunch, and PHP, another big drop to Perl, a smaller step down to Python, and then it tails off with the bunch that are about 2k each.

> > [b]17 Ruby 406[/b]
>
> The numbers can be a bit off, as there is
> http://rubyforge.org/ for Ruby-only projects.
>
>
> Message was edited by: murphee

The point with Ruby is that if it was 5 times larger it would only just make it into the top ten, and if it was another five times larger again (25x) it would only make it to number 5 on the list.

Someone made a remark about cutting Ruby some slack because it was a 'new' language, but my research indicates it is as old as Java (if you count Oak as part of Java).

Also, I highlight some of the other languages held up by others as being 'more productive than Java'.

How can we take those claims seriously when Haskell (for instance) is at #40, with Applescript close behind on #42?

Frankly, for the amount of smoke generated, I expected a lot more fire from those languages.

larth

[i]Here are the projects from sourceforge sorted by language:
Rank Language Projects[/i]

Is this list still around at sourceforge? Tried to a link there, and also via google. Only find a breakdown of the projects into cathgories... Thanks!

rickcarson
Offline
Joined: 2004-03-04
Points: 0

I saw something interesting in the pdf of the talk given by Tim O'Reilly. It was a fairly thorough comparison of the job adds broken down by language.

http://conferences.oreillynet.com/presentations/os2005/oreilly_magoulas....

Technology Percentage
SQL 18
Java 16
C/C++ 11
XML 9
.Net 8
VB 6
Perl 6
Javascript 6
C# 4
PL/SQL 4
SAS 3
PHP 2
VB.Net 2
COBOL 2
VBScript 1
Python 1
Other 1

The percentages add up to 100, so presumably they've dealt with jobs that require more than one skill, eg VB & SQL & C++.

Then I grabbed the latest stats from Sourceforge for the purpose of comparison (yes, there's a bit of apples vs oranges vs onions going on here, lets not get too picky).

Also, I grabbed the stats from the last time I ran them, so we can find out how much they've grown by.

Note that I've cut off where the Diff column hits 7, but everything under that had 4 or less (so anything not listed was not even growing half as fast as the 22nd item).

Note particularly the Fun/Jobs ratio. So we have 16% of the (new) Jobs in the market being Java, but 18% of the projects on sourceforge.

Note that here we're assuming that sourceforge projects are done in 'spare time' and that the primary motivation is 'fun'.

Conversely, we can see that lots of people (9%) have to use XSL on the job, but only 0.25% of the sourceforge projects use it, which gives us a fun/job ratio of 3%... from which we can conclude that XSL must be exceedingly painful to work with. :D

Visual Basic also has a very low Fun/Job ratio... :D

And before anyone points it out, I should note that this will make Ruby's Fun/Job ratio infinite (since noone gets paid to do it). Hmmm...

So the 'most fun' languages are:

Programming Language Fun/Job ratio
PHP 6.58
Python 4.87
C++ 1.63
C 1.55
Java 1.13
Perl 1.10
C# 0.80
JavaScript 0.51
Visual Basic 0.39
Visual Basic .NET 0.17
XSL (XSLT/XPath/XSL-FO) 0.03

Now, from anecdotal evidence, I'd suggest that most people probably find the languages below a 1.0 rating as difficult or tedious to work with. On the other hand, I've also heard the same thing about PHP. I suggest that PHP's high ranking is more due to it's nature - a language for the web with little commercial uptake.

On the other hand, if we take Paul Graham's essay at face value, then perhaps we can also conclude that Python is indeed 4x 'funner' to work with than Java.

Note also that C/C++ handily beats Java on this scale as well.

The good news though, is that Java is still king of the hill, and continues to gain momentum, since by far the greatest number of new projects (205) were in Java. So here's the data:

Programming Language Projects New Projects
1 Java 17111 205
2 C++ 17038 178
4 PHP 12501 172
3 C 16167 137
7 C# 3021 77
8 JavaScript 2889 62
6 Python 4631 56
5 Perl 6280 39
11 Unix Shell 1883 22
19 Visual Basic .NET 331 20
9 Visual Basic 2219 18
23 JSP 224 18
10 Delphi/Kylix 1958 15
15 Objective C 765 13
[b]13 PL/SQL 1165 11
17 Ruby 417 11
26 ASP.NET 158 11[/b]
22 XSL (XSLT/XPath/XSL-FO) 241 9
30 Lua 110 8
12 Assembly 1627 7
33 ActionScript 94 7
21 Object Pascal 284 4
34 BASIC 75 4
16 ASP 565 3
42 MATLAB 35 3
14 Tcl 922 2
24 Scheme 210 2
27 Cold Fusion 141 2
28 Zope 138 2
31 Ada 106 2
32 Prolog 105 2
36 Forth 62 2
39 OCaml (Objective Caml) 56 2
44 XBasic 33 2
20 Lisp 324 1
37 Smalltalk 60 1
38 VBScript 58 1
40 Haskell 46 1
43 AppleScript 33 1
18 Pascal 362 0
25 Fortran 166 0
29 Standard ML 134 0
35 Eiffel 70 0
41 Rexx 43 0
45 Erlang 31 0

And with respect to Ruby, we can see that it is still in 17th place for overall number of projects, and tied at 15th equal (with ASP.Net and PL/SQL) for the number of new projects: 11.

Hence, not only is Ruby practically irrelevant in terms of total projects, the number of Java projects on Sourceforge is growing almost 20 times the rate of Ruby projects.

rickcarson
Offline
Joined: 2004-03-04
Points: 0

Here are the projects from sourceforge sorted by language:

Rank Language Projects
[b]1 Java 16906[/b]
2 C++ 16860
3 C 16030
4 PHP 12329
5 Perl 6241
[b]6 Python 4575[/b]
7 C# 2944
8 JavaScript 2827
9 Visual Basic 2201
10 Delphi/Kylix 1943
11 Unix Shell 1861
12 Assembly 1620
13 PL/SQL 1154
14 Tcl 920
15 Objective C 752
16 ASP 562
[b]17 Ruby 406[/b]
18 Pascal 362
19 Lisp 323
20 Visual Basic .NET 311
21 Object Pascal 280
22 XSL (XSLT/XPath/XSL-FO) 232
[b]23 Scheme 208[/b]
24 JSP 206
25 Fortran 166
26 ASP.NET 147
27 Cold Fusion 139
28 Zope 136
29 Standard ML 134
30 Ada 104
31 Prolog 103
32 Lua 102
33 ActionScript 87
34 BASIC 71
35 Eiffel 70
36 Forth 60
[b]37 Smalltalk 59[/b]
38 VBScript 57
[b]39 OCaml (Objective Caml) 54[/b]
[b]40 Haskell 45[/b]
41 Rexx 43
42 AppleScript 32
43 MATLAB 32
44 Erlang 31
45 XBasic 31
46 Yacc 30
47 D 28
48 PROGRESS 26
49 REALbasic 21
50 Euphoria 19
51 AspectJ 18
52 Pike 18
[b]53 Common Lisp 17[/b]
54 APL 16
55 Logo 16
56 AWK 15
57 REBOL 15
58 IDL 14
59 S/R 13
60 Emacs-Lisp 12
61 VHDL/Verilog 12
62 Groovy 10
63 LabVIEW 10
64 LPC 9
65 Modula 8
66 MUMPS 8
67 COBOL 5
68 Visual FoxPro 5
69 Dylan 4
70 Simulink 2
71 Euler 1
72 Oberon 1
73 Simula 1

murphee
Offline
Joined: 2003-06-10
Points: 0

> 4 PHP 12329
> 5 Perl 6241
> [b]6 Python 4575[/b]
> 8 JavaScript 2827
> 9 Visual Basic 2201
> 10 Delphi/Kylix 1943
> 13 PL/SQL 1154
> 14 Tcl 920
> 15 Objective C 752

Your point is?
The fact that PHP, a language without any major company backing and a very specialized domain is so close to Java (12000 vs 16000) is interesting.

> [b]17 Ruby 406[/b]

The numbers can be a bit off, as there is
http://rubyforge.org/ for Ruby-only projects.

Message was edited by: murphee

chrisadamson
Offline
Joined: 2003-08-27
Points: 0

> The numbers can be a bit off, as there is
> http://rubyforge.org/ for Ruby-only projects.

That said, there's also java.net and JavaForge for Java-only projects. Also, number of projects doesn't take level of activity into account - Ruby's new, so there's probably little abandonware, whereas dormant projects might account for many more projects in legacy languages like C.

So, lots of grains of salt for this particular metric...

invalidname
Offline
Joined: 2003-06-09
Points: 0

Chapter 6 ends with a section wondering whether Java is "collapsing under the weight of abstraction", particularly when compared with Ruby: "My playtime in Ruby makes another, more powerful idea, clearer. As we stretch Java in increasingly unnatural directions, there's a cost. AOP and dependency injection are near-trivial exercises in Ruby, but they force Java developers to learn new programming models, deal with XML, and introduce increasingly complex syntax. With each new metaprogramming concept that we bake into Java, it's looking more and more like all of that complexity is trying to drive us somewhere. The net effect is to push Java further and further into the enterprise niche, and make it less and less accessible to the average Joe. Contrast that situation with Ruby, where dependency injection and AOP don't consume your focus; you're free to apply those ideas in spots right where you need them."

rickcarson
Offline
Joined: 2004-03-04
Points: 0

> Chapter 6 ends with a section wondering whether Java is "collapsing under the weight of abstraction",

What a load of twaddle.

I can just see it now - Scotty in the engine room screaming into the intercom "och Jimmy, I cannae give her anymore, if they add another method to Jakarta commons the JVM's gonna blow!"