Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 A Startling Admission
Index -> Programming, Ruby -> Ruby Tutorials
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Cervantes




PostPosted: Thu Jun 01, 2006 7:04 pm   Post subject: (No subject)

Today is June the first. The following is not an April Fool's joke.

I'm getting rather annoyed with Ruby. It's often classified as a scripting language, and now I am starting to see why. It's terrific for making small programs. When I say small, I mean less than one or two hundred lines.

However, Rubidium has become quite a large project. It's currently sitting around nine hundred lines, all told. I imagine it would be way more in a less dynamic language like Java. Ruby's dynamic nature has allowed me to take many shortcuts and do many things that would otherwise require a lot more work.

But that's just the problem. If C, from time to time, blows your whole leg off, Ruby, from time to time, surgically amputates your leg and then hides it somewhere you'll never find it. Ruby's dynamic nature makes it very difficult to trace the state of your program, thereby making it difficult to debug.

Here's an example. I added a method called "join" to my class, but because that class is rather large, I forgot that I already had a method called "join" defined. Thus, this redefined the "join" method with the new definition. This caused my program to fail a particular case, and it took me quite a while to figure out why. In less dynamic languages, this would have produced an error right off the bat.

Another problem comes with the error messages. For the most part, they're pretty great. However, when an error occurs in my program (I think it's because I'm using threads), the only error message I ever get is "in `gets': no implicit conversion from nil to integer (TypeError)". This tells me absolutely nothing, aside from the line number. Often times even the line number isn't so useful because the state of the program got unexpectantly changed at some previous point (a variable that was supposed to hold an Array now holds a String, for example).

Finally, the debugging tools I've got are... well, they just don't exist. I've looked at Test::Unit, but it seems like too much trouble to set up. I've been working for a long time on this project in gEdit. I really want a full blown, free Ruby IDE, but such doesn't exist to the best of my knowledge.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Jun 01, 2006 7:13 pm   Post subject: (No subject)

Cervantes wrote:
Finally, the debugging tools I've got are... well, they just don't exist. I've looked at Test::Unit, but it seems like too much trouble to set up.

I would think that Test::Unit and Test::Functional come from Rake's unit and regression testing. More QA than debugging.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
rizzix




PostPosted: Thu Jun 01, 2006 9:20 pm   Post subject: (No subject)

Seriously guys you have to learn to love statically typed languages. Take Haskell for example. Learn it and love it. It's structural type system is hard to beat.

As for Java, it is popular for a some good reasons:
#1] It works.
#2] It's a simple language. (this is very very important)
#3] It avoids TIMTOWTDI. (also important)
#4] Has some fantastic IDEs, editors and other tools. (the best out there)
#5] It has some good backing by some major firms.
#6] Large community.

Being statically typed is also an advantage, since quite a few troublesome errors are caught at compile time. Yet it has it's drawbacks: fixing an error, changing the results or changing the logic, even just a little bit, requires recompiling the entire class or program (this also means that one has to restart the web-application server at times, just to see the updated results). For this reason the J2EE world makes good use of XML/annotations with resource bundles and "scripting" frontends. That's one way to resovle the issue, but dynamic languages like Ruby do not require this.
Andy




PostPosted: Mon Jun 05, 2006 4:25 pm   Post subject: (No subject)

oh and you forgot about
#7] It teaches you to be lazy Laughing
wtd




PostPosted: Mon Jun 05, 2006 4:47 pm   Post subject: (No subject)

Oh no. A functional language really teaches you to be lazy. Java is pretty far removed from functional programming.
[Gandalf]




PostPosted: Mon Jun 05, 2006 5:11 pm   Post subject: (No subject)

What I think you're not taking into consideration, wtd, is that lazy can also mean: "Please, I don't want my brain to explode!" Wink

TIMTOWTDI? Sigh... how are you supposed to keep track of all these acronyms? Had to go to wikipedia for that one.
wtd




PostPosted: Mon Jun 05, 2006 5:21 pm   Post subject: (No subject)

That particular acronym is quite famous.

And lazy has only one true meaning to a programmer. Laziness is something which reduces overall expenditure of effort. Like properly factoring out basic functionality to avoid duplication of effort.

Programming features that aid laziness are things like anonymous functions. Anonymous inner classes may have their use, but anonymous function represent significantly less syntactic and semantic overhead, and can serve much the same purpose in most cases.

The Java language lacks this ability, and thus is not aiding laziness as much as it could be. The Java library is not written in such a way as to easily adapt to such language features in other languages which target the JVM, and thus does not aid laziness.
Display posts from previous:   
   Index -> Programming, Ruby -> Ruby Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 22 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: