Re: Large Ruby Apps ?
- From: "Ara.T.Howard" <Ara.T.Howard@xxxxxxxx>
- Date: Thu, 22 Sep 2005 09:52:30 -0600
On Thu, 22 Sep 2005, klancaster1957@xxxxxxxxx wrote:
I don't know why anyone would consider having tools (like compilers) help catch errors as "old school".
because they don't catch that many serious errors
harp:~ > cat a.c
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
int
main ()
{
fprintf (stdout, "%lu : %lu\n", ULONG_MAX,
ULONG_MAX + (random () > 42 ? 1 : 0));
(void) fgets (NULL, (signed long) ULONG_MAX, NULL);
while (1)
malloc (42);
}
harp:~ > gcc -Wall a.c
harp:~ > echo $? 0
line one is an error. line two core dumps. line three will hang your machine.
all compile perfectly with all warnings on. we all know runtime errors are, by far, the most difficult and time consuming to detect anyhow - and the compiler doesn't save you from any of those other than the most trivial. also, it's a known fact that bugs are linearly proportional to tloc - and compiled languages tend to be more verbose to a degree of 10 times or more so letting even 1 in 10 errors through puts you right back at square one.
Personally, I want every tool I use to help me catch my goofs.
me too. in particular
- garbage collection
- powerful object introspection
- compile time as runtime
- no pointers
- powerful and easy to use exception handling
- ability to express code in fewest lines possible : abstraction
- strong typing and dynamic typing. ruby is both
http://en.wikipedia.org/wiki/Dynamic_typing
http://en.wikipedia.org/wiki/Weak_typing
http://en.wikipedia.org/wiki/Strong_typing
http://www.mindview.net/WebLog/log-0066
- uniform object model
- easy and quick testing framework
- easy to use loggingI've just started using Ruby, and while I am jazzed with the language and really excited about Rails in particular, the relative lack of support for static code checking and runtime debugging as compared to C#/Java/etc. is a little disconcerting. In those languages, I rely on unit testing, static checkers, AND runtime checking to insure that I get it right.
a valid concern, but i'd urge you to write some large ruby programs before weighing it too heavily. i've been writing pretty much nothing but ruby for 5 years now and have never, like never, required a debugger or spent more that an hour debugging my code. i have many, many systems running 24x7 that are more than 5000 lines of code (that's probably around 25,000 lines of java) and none, like none, of them have ever crashed. i'm the kind of guy that doesn't even run c or c-- code out of the debugger and who always fully qualifies and c functions with as many consts as i can and i will say this to you - i can produce large bodies of useful robust code in ruby at a minimum of 10 times faster than i can in c, c--, or java and i've written large near-realtime systems in all of them. it boils down to this: everything in the world is a tradeoff and, though you do give some things up in ruby, you gain many more. my experience, and the experience of every single programmer i know that has made the leap is that your productivity of __robust__ code will increase dramatically using a strong and dynamically typed real object oriented language.
2 cts.
-a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | Your life dwells amoung the causes of death | Like a lamp standing in a strong breeze. --Nagarjuna ===============================================================================
.
- Follow-Ups:
- Re: Large Ruby Apps ?
- From: Isaac Gouy
- Re: Large Ruby Apps ?
- References:
- Re: Large Ruby Apps ?
- From: klancaster1957@xxxxxxxxx
- Re: Large Ruby Apps ?
- Prev by Date: Re: Instantiating a subclass of NilClass.
- Next by Date: Net::Netrc request for comments
- Previous by thread: Re: Large Ruby Apps ?
- Next by thread: Re: Large Ruby Apps ?
- Index(es):
Relevant Pages
|