473,902 Members | 4,620 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ruby on Rails?


Dr. Dobbs has a /glowing/ article on Ruby on Rails this month.

What do you guys think?

Can it replace .net, php and java?

And be the Open Source OOP web solution that is not bound to Sun or MS?

http://media.rubyonrails.org/present...itofbeauty.pdf

May 15 '06
44 2878
Andrew McDonagh wrote:
Most ruby developers are also TDDers or
at least unittesters.


Is that actually true ? I know that TDD/Uniters make a lot of noise, but is
that indicative of the actual numbers ?

-- chris
May 21 '06 #31
Chris Smith wrote:
It would, of
course, be remiss not to point out the one advantage to maintaining Ruby
code, which is that there would be less of it to maintain.


I think the impression conveyed by "the one advantage" is false.
Non-declarative type systems, in particular dynamic type systems, have more
benefits than just reducing the amount of code. Rubyers (and Pythonists, etc)
know this very well.

-- chris

May 21 '06 #32
Chris Uppal wrote:
Andrew McDonagh wrote:
Most ruby developers are also TDDers or
at least unittesters.


Is that actually true ? I know that TDD/Uniters make a lot of noise, but is
that indicative of the actual numbers ?

-- chris


I have no actual numbers, just the impression given the various
discussion boards, conferences and teams I know who use Ruby.

Obviously in the early days of Ruby (its around 15 years old) not many
people would have done) but its had testing built into the distro for
long time now.
May 21 '06 #33


WARNING _ I dont want to start a pissing compo of dynamic vs static
languages - I'm a Java dev first after all.


Chris Smith wrote:
Roedy Green wrote:
Ruby is clearly a lot faster to knock out code than Java, but I
suspect it may be harder to maintain without all the static type
information you get with Java.

Andrew McDonagh <ne**@andmc.com > wrote:
Actually this is not a problem. Most ruby developers are also TDDers or
at least unittesters. In fact, Ruby has Unit & Acceptance testing
framework built in. We trade the compile time type check for runtime
checks via the tests we write, which means we still have the benefits of
static languages like Java, but can also have the benefits of the
dynamic typed language.


These are not the same thing. The problem areas solved by static
verification tools (and, in particular, type systems) overlap slightly
with those solved by testing tools. The area of overlap is that type
systems can detect some of the same problems as testing can.

I wasn't saying they are they same thing. I was saying that the type
checking a compiler does can be done via unit tests - nothing more.

Its a runtime check versus a compile time check.

With Java's reflection capabilities, Java _almost_ has the same ability.

The areas where the two techniques do not overlap include the following additional
uses of types:

Type systems:
- Provide reliable documentation of code
Depends upon the type of documentation you want. Ruby can have JavaDoc
style docs too. Other than that, for most people, its the design
methodology you use which is the documentation, not the language you use.

RUP users would rely upon UML diagrams. TDDers would rely upon
Acceptance & Unit Tests (we consider them to be executable design docs).

YMMV

- Enable more powerful development tools As in IDEs?

No really.

The original refactoring IDE was developed for the Smalltalk language
and at that time it supported the following...

Instance/Class Variable Refactorings
add variable
rename variable
remove variable
push down variable
pull up variable
create accessors
abstract variable

Method Refactorings
add method
rename method
remove method
push down method
pull up method
add parameter to method
extract code as method
move method across object boundary

Class Refactorings
create new class
rename class
remove class

See http://st-www.cs.uiuc.edu/~droberts/tapos/TAPOS.htm
The Parc small talk IDE was so influential that most IDEs (eclipse,
intelliJ, etc) today allow themselves to be easily configured to
replicate it. IBMs VisualAge for Java is actually setup like it out of
the box.
- Support program analysis tools
Like what?

SmallTalk for instance has had SmallLint for ages - (the following page
was last update in 97)

http://st-www.cs.uiuc.edu/users/bran...intChecks.html
- Enforce simple invariants, rather than single test cases
True, but then by not enforcing them, we get other benefits - its a
trade off
- Allow more aggressive optimizations
Like what?

Of these, the first four definitely fit under reasons that Ruby code may
be harder to maintain because of the lack of types. It would, of
course, be remiss not to point out the one advantage to maintaining Ruby
code, which is that there would be less of it to maintain.


I simply disagree - but YMMV
May 21 '06 #34
Chris Uppal wrote:
Chris Smith wrote:
It would, of
course, be remiss not to point out the one advantage to maintaining Ruby
code, which is that there would be less of it to maintain.


I think the impression conveyed by "the one advantage" is false.
Non-declarative type systems, in particular dynamic type systems, have more
benefits than just reducing the amount of code. Rubyers (and Pythonists, etc)
know this very well.


One of the things that annoys me with some of the most vocal dynamic
type advocates is that they only highlight reduced code through not
declaring variable types and defining interfaces. Dynamic typed
languages require shorted code that appears superficially easier to
understand. If you want to understand the code sufficiently to be able
to maintain it, or just write it in the first place, static typing wins
hands down (IMO). As an argument it's as bad as SpringLayout and Swixml
advocates showing how easy it is to make a layout with wonky labels[1][2].

It appears that the real big advantage of dynamic typing is that
infrastructure programmers can programmaticall y add boilerplate to
classes (or objects for prototype-based systems), in much the same way
as you can use APT (only very much easier). (And Rails is good for
sensible defaults and not being daft.)

Tom Hawtin

[1]http://java.sun.com/docs/books/tutorial/figures/uiswing/layout/SpringDemo3.gif
[2]http://today.java.net/images/2006/02/EmailTest.png
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
May 21 '06 #35
Thomas Hawtin wrote:
One of the things that annoys me with some of the most vocal dynamic
type advocates is that they only highlight reduced code through not
declaring variable types and defining interfaces.
It's as though they miss the point of their own pet languages ;-)

(BTW, I found Xah Lee's recent x-post on the subject of pet languages and the
high priest thereof -- the philosopher one -- interesting, well argued, and
relevant. Things are looking up.)

The other thing that irritates me, from the same pople, is the standard line
"declarativ e typing is unnecessary because we have unit tests which catch type
errors (as well as lots of other errors)". I have nothing against testing (of
any variety), and (as readers in c.l.j.p may remember) I'm no great fan of
static declarative typing either. It's the "because" that gets up my nose.

In my experience (and I was very surprised to find this when I switched from
Java to Smalltalk), unit tests don't /find/ type errors because people don't
/make/ type errors (or only very rarely). So, once again, the high priests
seem not to understand the virtues of their own languages. I can understand
them missing the weaknesses, but they should be able to articulate the positive
points...

Dynamic typed
languages require shorted code that appears superficially easier to
understand. If you want to understand the code sufficiently to be able
to maintain it, or just write it in the first place, static typing wins
hands down (IMO).
This has not been my experience. It requires a different mind-set (and a new
set of learned skills), but I find it no harder to pick apart well-written
Smalltalk code than I do well-written Java code -- it's basically a matter of
switching from a focus on /type/ to a focus on /behaviour/. (Working with
badly-written code in either language is like being staked out on an ants nest,
of course.) Once you have made that switch (which took me quite a while, I
admit), it is just as easy to "penetrate" existing Smalltalk code as Java
(actually, it's quite a bit easier, but mostly as a side-effect of the reduced
verbosity -- which is a trivial issue -- and for other reasons which have
nothing to do with the dynamic/static debate).

Mind you, I don't know how well my experience would carry over to other
dynamically typed languages. I suspect that the Smalltalk programming
environment (which is no mere "IDE") has a lot to do with this, so -- for all I
know -- doing real programming in Ruby (which only has IDEs -- if that) might
be as frustrating for me as you suggest it would be for you.

It appears that the real big advantage of dynamic typing is that
infrastructure programmers can programmaticall y add boilerplate to
classes (or objects for prototype-based systems), in much the same way
as you can use APT (only very much easier).


It's certainly true that the further away one gets from the boring, vanilla,
crank-out-another-application, style of coding, the more the tradeoff between
the respective benefits of static and dynamic approaches swings in favour the
latter.

-- chris
May 21 '06 #36
Chris Uppal <ch*********@me tagnostic.REMOV E-THIS.org> wrote:

I think the impression conveyed by "the one advantage" is false.
Non-declarative type systems, in particular dynamic type systems, have more
benefits than just reducing the amount of code. Rubyers (and Pythonists, etc)
know this very well.


That was my mistake. I meant to say "the one obvious advantage", but I
forgot to type that word. I certainly don't mean to say that there is
no other advantage to maintaining code in Ruby.

Incidentally, let's be clear: although it's a common colloquiallism to
talk about "dynamicall y typed" languages, such languages do not have a
type system. The standard text is Pierce, who says a type system is: "a
tractable syntactic method for proving the absence of certain program
behaviors". Dynamically "typed" languages do not have this; they
guarantee the absence of certain behaviors, but they do not do it with a
tractable syntactic method. Pierce suggests it would be more correct to
call them "dynamicall y checked", but "dynamicall y typed" is widely used
as a figure of speech.

I'd draw the line, though, at talking about "non-declarative type
systems" or "dynamic type systems". These phrases are oxymorons.
There's no reason to actively seek to make the use of words in software
development different from their uses in formal logic and the like.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
May 21 '06 #37
Andrew McDonagh <ne**@andmc.com > wrote:
Type systems:
- Provide reliable documentation of code
Depends upon the type of documentation you want. Ruby can have JavaDoc
style docs too. Other than that, for most people, its the design
methodology you use which is the documentation, not the language you use.

RUP users would rely upon UML diagrams. TDDers would rely upon
Acceptance & Unit Tests (we consider them to be executable design docs).


Hopefully, no one uses UML to document all the kinds of things that are
documented automatically by type systems. That would be a pain. Even
if they did, UML diagrams can generally get out of date, especially if
the code doesn't contain enough information to keep them up to date with
tools that do that sort of thing. JavaDoc (or any equivalent, as you
say Ruby has) can definitely get out of date. Documentation expressed
by the type system within the syntax of the language doesn't get out of
date.

Unit tests as documentation is another thing. They are kept up to date
with code. The weakness, of course, lies in being so separated from
code; often residing in a different directory from the code that is
being documented by that test. The other weakness is that the tests are
in a language that as fundamentally just as opaque to reasoning about
behavior as the original programming language (in fact, it generally is
the same language). While one might hope that the code would be kept at
least a little simpler -- or perhaps that you'd write unit tests or
acceptance tests for the unit tests or acceptance tests -- the result
will still not match a form of expression designed for describing facts
about code that are the basis for simple reasoning about behavior.

Interestingly, if I start to imagine languages in which simple unit
tests can be written inline to put the documentation closer to the code,
and possibly in a simpler language that is more prone to reasoning about
behavior, then I end up thinking about a proper design-by-contract
language. Hmm...
- Enable more powerful development tools

As in IDEs?


Sure, or other tools. Doesn't really matter if they are integrated or
not.
No really.

The original refactoring IDE was developed for the Smalltalk language
and at that time it supported the following...


Yes. However, a good portion of the refactorings you list are
computationally intractable in Smalltalk in the general case. I am not
a Smalltalk programmer, and I don't know how the refactoring tools
handled that... perhaps they would give up, or perhaps they would guess
according to some heuristic to guess at the meaning of the code, and
rely on your unit tests to catch any errors that are introduced. Either
could be reasonable, depending on how good the heuristic can be made,
but either one is also a significant barrier to having usable tools.

So clearly, tools can be written for dynamic languages. The question is
whether they can be as good as tools for typed languages can be. (I'm
arguing the less popular side here; I would, however, probably agree if
you point out that an interactive tool that works 99.99% of the time is
just as good as one that works 100% of the time. I don't know if
Smalltalk's refactorings really do work 99.99% of the time or not.)
- Allow more aggressive optimizations


Like what?


Like, for example, implementation of polymorphic method dispatch in
practically the same time cost as a standard procedure call by using
vtables. Also, as an example, some of the work being done toward
optimizing away heap allocations by moving data onto the stack in Java
depends on static type analysis.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
May 21 '06 #38
Chris Smith wrote:

[me:]
I think the impression conveyed by "the one advantage" is false.
Non-declarative type systems, in particular dynamic type systems, have
more benefits than just reducing the amount of code. Rubyers (and
Pythonists, etc) know this very well.
That was my mistake. I meant to say "the one obvious advantage", but I
forgot to type that word.


I suspected as much ;-)

Incidentally, let's be clear: although it's a common colloquiallism to
talk about "dynamicall y typed" languages, such languages do not have a
type system.
Well, I disagree. (Ignoring the trivial, Crowlean, "Do as thou wilt shall be
the whole of the law", type system.) I think that the term can be and is
properly applied. A generalisation of the classical notion, I agree, but not
an awkward or misleading one.

The standard text is Pierce, who says a type system is: "a
tractable syntactic method for proving the absence of certain program
behaviors".


Hmm. I would be reluctant -- /extremely/ reluctant -- to talk of a "standard
text" on this subject. (And, as it happens, wouldn't be keen to accept Pierce
as the standard anyway since I've never heard of it ;-) Classical type
systems in logic and mathematics have little (IMO) to do with programming
languages -- for instance it would be as wrong to speak of a "static" (locution
for "compile-time") type system in a mathematical context as it would to talk
of a "dynamic" (locution for "runtime") one.

It would certainly be completely wrong to speak of dynamically-typed languages
having dynamic type /analysis/ -- analysis is a static concept[*]. But talking
about type /systems/ is not the same as talking about type /analysis/. In an
extreme case it might be that the system existed, and was well-defined, but
wasn't subject to analysis. Such a system might not be much use (who knows ?),
but the idea is not /incoherent/. Dynamic languages certainly have type
systems -- there is an abstract logic of what [sequences of] operations have
meaning. Depending on the structure of the language that might or might not
resemble a classical type system. But it certainly exists -- how else could
anyone understand even one line of code in a dynamically typed language,
there'd be nothing to have a mental model /of/ ?

([*] Except that some implementations /do/ in fact do dynamic type analysis --
the Self implementation which fed into HotSpot for instance ;-)

The other use of the phrase "type system" is to mean "that part of the language
system which does type checking". In C++ that part is in the compiler. In
Java it is split between the compiler and runtime. In Smalltalk it's all in
the runtime. You may not like that particular use of the phrase, but it seems
to have become established. To me it seems perfectly reasonable -- so I use
it ;-) But feel free to translate my uses of the term (in that sense) into
"type checker" if you wish.

Consider the following assertion. The price that statically analysed languages
pay is that they must accept an impoverished type system (logic of allowable
operations) in order to have a practically implementable ("tractable" ;-) type
checker. Dynamic languages, on the other hand, have a type system (logic)
which is /exactly/ as wide as is possible, but at the cost of a type checker
working at runtime. You may or may not agree with the assertion; but my point
is that the assertion is meaningful. We can coherently /compare/ the type
systems of C++, Java, and Smalltalk, which would not be possible if I were
abusing language by attaching the same phrase to incomparable concepts, or if
Smalltalk could not be said to have a type system at all.

-- chris
May 22 '06 #39
Chris Smith wrote:
Yes. However, a good portion of the refactorings you list are
computationally intractable in Smalltalk in the general case. I am not
a Smalltalk programmer, and I don't know how the refactoring tools
handled that... perhaps they would give up, or perhaps they would guess
according to some heuristic to guess at the meaning of the code, and
rely on your unit tests to catch any errors that are introduced. Either
could be reasonable, depending on how good the heuristic can be made,
but either one is also a significant barrier to having usable tools.

So clearly, tools can be written for dynamic languages. The question is
whether they can be as good as tools for typed languages can be. (I'm
arguing the less popular side here; I would, however, probably agree if
you point out that an interactive tool that works 99.99% of the time is
just as good as one that works 100% of the time. I don't know if
Smalltalk's refactorings really do work 99.99% of the time or not.)
Just for background information: the Refactoring Browser is considered to be an
absolutely essential tool by many (most?) Smalltalk programmers. It is used
all the time, which argues that it is at least adequate in practise.

Indeed I'm regarded as something of a weirdo for refusing to use its facilities
(I don't like automated refactoring of any kind -- in any language).
- Allow more aggressive optimizations


Like what?


Like, for example, implementation of polymorphic method dispatch in
practically the same time cost as a standard procedure call by using
vtables.


I don't think vtables are widely regarded as the best implementation technique,
even for languages which can use them. Routinely jumping through an
indirection is a killer. Inline dispatch, with a fallback to vtable lookup,
seems to be the Done Thing These Days. Also see the "polymophic inline caches"
of Self -- a set of techniques which are applicable to static and dynamic
languages. Although apparently PICs are not as valuable for Java, where a
simpler inline cache (plus vtables) does as good, or better, job with less
complication. (Presumably because megamorphic call sites are less common in
Java than in Self or Smalltalk -- although I don't know what part of that is
because the static type system can resolve method calls more precisely, and
what part is just down to differences in the ways that the languages are used.)
Also, as an example, some of the work being done toward
optimizing away heap allocations by moving data onto the stack in Java
depends on static type analysis.


That's escape analysis, and it can be done as easily (albeit more
conservatively) in dynamic languages as static ones. (Always assuming that the
language isn't /so/ dynamic that the concept of "a variable" can't be isolated
from runtime behaviour.)

-- chris
May 22 '06 #40

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3078
by: Useko Netsumi | last post by:
or perhaps Java for developing web application? I've develop a few applications using PHP/MySQL/Apache and its growing in size. After reading the Ruby tutorial, and do a simple script, I kind of like this ease of use and a much cleaner language. But I have reservation about its viability as a dominant web programming language/tools. As with PHP, everywhere you look its PHP, perhaps it has extensive bell and whistles for web programmers...
23
2575
by: flab ba | last post by:
The pragmatic programmers (Dave & Andy) are spreading a good word about RubyOnRails. I was wondering if there are any Python programmers who are /also/ familiar with Rails - and if they could recommend something in the Python world that is comparable. -Flab
12
2635
by: Gary Nutbeam | last post by:
I've noticed that the Perl camp has a very nice web/database environment called Maypole. Ruby has the Rails environment which on the surface seems similar to Maypole. I can't find anything in Python that ties a database to a web interface anywhere near as well as Ruby on Rails or Maypole. I see the behemoth Zope having the best web/database integration, but unfortunately I don't want to spent weeks writing xml for the interface. Does...
65
5523
by: Nikolas Hagelstein | last post by:
Hi, First of all: i spend a lot of time on thinking and researching about how to make developing webapplications with php a more structured/systematic thing. I even fancied to switch over to jsp since i heard all those stiltedness rumors about it's professionalism/stability etc. Anyway my current attitude is that fullfilling the following needs would make application depvelopment via PHP a really
65
5572
by: Amol Vaidya | last post by:
Hi. I am interested in learning a new programming language, and have been debating whether to learn Ruby or Python. How do these compare and contrast with one another, and what advantages does one language provide over the other? I would like to consider as many opinions as I can on this matter before I start studying either language in depth. Any help/comments are greatly appreciated. Thanks in advance for your help.
5
2354
by: Matias | last post by:
I'm not asking if it's better or not than php... I want to know the opinions of web developers about this new toy... Byee..
9
21099
Niheel
by: Niheel | last post by:
I've used the following tutorials to help be get a better understanding of Ruby On Rails or ROR. Installing Ruby on Rails - Fedora / Lighthttpd Tutorial & Setup for Ruby on Rails Rolling with Ruby on Rails Rolling with Ruby on Rails - Part II Learn to Program with Ruby - by Chris Pine Programming Ruby - Pragmatic Programmer's Guide Ruby User's Guide - Mark Slagell
10
3810
by: lawrence k | last post by:
I work mostly in PHP, but at the web design firm where I work we are thinking of switching to Ruby on Rails. Our lead designer recently installed Typo on a client's site and he said to us, with surprise, "All Ruby On Rails software has the same directory layout?" That was a revelation to him. He was used to the PHP scene, where diversity is the rule. I've done some google searches and I see that the subject has seen a fair amount of...
9
2334
by: Erwin Moller | last post by:
Hi Group, This may seem a odd question in a PHP group, but I think this might be a good place to ask since I am mainly a PHP coder these days that maybe starts with Ruby. Situation: A client of a friend of mine asked me to take over a project done in Ruby. (The original programmer appearantly behaved like an @ss and his client wants to get rid of him.)
1
1638
by: LinkExchange.AB | last post by:
iTechArt has specialized in Ruby on Rails (ROR) development and provides a complete software outsourcing services for web development solutions based on Ruby. We suggest use Ruby framework for developing database-backed web applications with Ajax on front-end because it's a great fit for practically any type of web application: collaboration, community, e-commerce, content management and statistics. Ruby development environment and...
0
9845
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11279
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10499
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9675
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7205
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5893
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4725
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.