

Why Do Rubyists Test So Completely? - csbartus
http://robots.thoughtbot.com/post/162764036/why-do-rubyists-test-so-completely

======
stcredzero
Why? It's a very runtime-oriented environment. In fact, the syntactic meaning
of fairly common examples of Ruby code can't be determined until runtime.

This is one thing that the Rubyists get right that the Smalltalk community as
a whole never manged to get around to. (Though, to be fair, the Smalltalk
community is largely responsible for the origin of the XUnit suites and the
idea of fanatic unit testing.)

If there was a Ruby-like language that ran an order of magnitude faster, and
had optional type annotations, would it become popular?

I wish someone would make optional typing for Lua and write something like
Rails for it.

~~~
silentbicycle
> I wish someone would make optional typing for Lua...

I've wondered about this, as well. Adding it would probably greatly increase
the size of the language/compiler, though (which goes against its major
strength of being easily embeddable), and its not clear to me how it would fit
with the underlying VM's design[1]. Just having a runtime-checked type system
is quite a bit simpler, until programs get to a certain size.

I like inferred statically typed languages, but I think it may work better to
leave Lua as-is, and instead focus on making an equally clean-but-pragmatic
ML-styled language. H-M type inference, Haskell-style typeclasses, and pattern
matching in the core language, but with the same tastefully minimalistic
design that Lua has. Lua is (IMHO) an _excellent_ scripting language, but it's
still stateful/imperative by default. While OCaml and SML aren't purely
functional, their design encourages going that way more than Lua's does, and
it changes the semantics of the language considerably. (FWIW, I'm studying
Prolog, unification, type systems, etc., and would love to work on such after
I get a few more immediate projects finished...)

[1]:
[http://luaforge.net/docman/view.php/83/98/ANoFrillsIntroToLu...](http://luaforge.net/docman/view.php/83/98/ANoFrillsIntroToLua51VMInstructions.pdf)

~~~
stcredzero
I'm thinking of doing something with adding optional typing to Smalltalk by
just adding it to the compiler. Maybe add H-M type inference as well.

One could do the same for Lua.

Actually, I'm thinking of implementing a Smalltalk VM on top of LuaJIT and
Javascript by JIT to the host language's source code.

------
swombat
The discussion in the comments is extremely interesting, with a few
ruby/rails/merb heavyweights pitching in and having a very insightful debate
into the topic.

Be sure to read the comments on the post.

------
draegtun
Have there been any kind of survey carried on testing "habits" in the Ruby or
any other language communities in recent times?

I'm only aware of this small survey carried out by Perl community last year:
<http://perlmonks.org/?node_id=701817>

~~~
csbartus
This is a Ruby development survey, you can find in test related charts too.

[http://devver.net/blog/2008/06/the-results-of-our-ruby-
devel...](http://devver.net/blog/2008/06/the-results-of-our-ruby-development-
survey/)

------
z8000
I cannot imagine that the average perl module on CPAN is less tested than that
of ruby.

