What's so great about narf?

web rubyists-

o.k., call me an idiot (it won’t be the first time) but i’ve read the narf
docs and can’t see what it really buys me? considering these facts :

  • the cgi, and cgi/session modules are well doccumented and easy enough to
    use ( p, = cgi[‘param’] isn’t that hard IMHO )

  • webunit can be used to unit test these cgis if desired. see next point.

  • amirta makes it trivial to test cgi’s since all they do is manipulate data
    anyhow (many cgi’s i’ve converted to amrita end up going from hundreds of
    lines to tens so testing is often overkill - just tidy/validate the html
    and your off)

now. when i look and other web packages like CGIKit or IOWA is see
significant gains in the areas of simplicity and funcionality, but narf just
seems like another API? please note that i asked to be called an idiot so can
somebody please set me straight because i’m obvioulsy missing something? also
note that i’m not really after academic differences, but real-world functional
differences that i seem to be missing…

thanks in advance for any insights.

-ara

···

====================================

Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ahoward@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
====================================

Hi Ara,

As one of the authors I am biased, and I probably wouldn’t say Narf is
great - but I think it might sometimes be better.

web rubyists-

o.k., call me an idiot (it won’t be the first time) but i’ve read the narf
docs and can’t see what it really buys me? considering these facts :

  • the cgi, and cgi/session modules are well doccumented and easy enough to
    use ( p, = cgi[‘param’] isn’t that hard IMHO )

The relevant parts of Narf are derivatives of the CGI, and could just
be considered refactorings. We wanted something better, so we wrote it

  • and that’s all.

As an aside, it is completely covered with Unit tests, which makes
integration of new features somewhat easier.

  • webunit can be used to unit test these cgis if desired. see next point.

Narf testing differs from Web testing in a few ways:
a) It’s all in process - you don’t need to fire up a web server
(this seems suprisingly helpful)
b) It’s integrated with the templates which provides some useful
testing enchancments and make it much easier to find out what your app
is doing
c) We’ve worked hard to make the API really simple, so it doesn’t
get in the way, and tests are short and to the point

  • amirta makes it trivial to test cgi’s since all they do is manipulate data
    anyhow (many cgi’s i’ve converted to amrita end up going from hundreds of
    lines to tens so testing is often overkill - just tidy/validate the html
    and your off)

I’m not going to profess to solve the problems of someone who has none
:slight_smile:

significant gains in the areas of simplicity and funcionality, but narf just
seems like another API? please note that i asked to be called an idiot so can

I think we’ve pushed the boundaries of making Web applications more
easily testable - at least that’s the idea. I doubt we have a miracle
cure though.

-Tom

···

On Sat, Jan 25, 2003 at 02:09:08AM +0900, ahoward wrote:

As an aside, it is completely covered with Unit tests, which makes
integration of new features somewhat easier.

this is really good - of course.

Narf testing differs from Web testing in a few ways:
a) It’s all in process - you don’t need to fire up a web server
(this seems suprisingly helpful)

i can appreciate that - but being somewhat old fashions don’t know if i’d
trust it…

 b) It's integrated with the templates which provides some useful

testing enchancments and make it much easier to find out what your app
is doing

is it true work is being done to integrate with Amrita tempaltes?

I’m not going to profess to solve the problems of someone who has none :slight_smile:

touche. i meant they were greatly reduced by eliminating all the string
manip from my old cgi’s and offloading it onto Amrita.

-a

···

On Sat, 25 Jan 2003, Tom Clarke wrote:

====================================

Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ahoward@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
====================================

As an aside, it is completely covered with Unit tests, which makes
integration of new features somewhat easier.

this is really good - of course.

Narf testing differs from Web testing in a few ways:
a) It’s all in process - you don’t need to fire up a web server
(this seems suprisingly helpful)

i can appreciate that - but being somewhat old fashions don’t know if i’d
trust it…

My experience so far seems to be that what works in the tests, works
for real. Obviously those with complex server setups may find things
different.

 b) It's integrated with the templates which provides some useful

testing enchancments and make it much easier to find out what your app
is doing

is it true work is being done to integrate with Amrita tempaltes?

It seems likely. I would be happy to see Narflates disappear should
Amrita gain all of the Narflate features.

I’m not going to profess to solve the problems of someone who has none :slight_smile:

touche. i meant they were greatly reduced by eliminating all the string
manip from my old cgi’s and offloading it onto Amrita.

Basically the Narf testing-with-templates approach came about as
follows:
1) Tom uses Smarty with PHP
2) Tom fills up hashes and arrays with the data that should be displayed
3) Tom notices that this corresponds roughly to the things he
wants to test when he displays html pages
4) Tom wonders what would happen if he developed a Webunit/http
like api, where instead of looking at html he looked at those values
that were put in the template
5) Tom likes ruby and decides to implement in that

This coincided with mine and Patrick May’s desired to improve ruby’s
CGI api and narf was the result.

My dream for Narf is that loads of people either steal the ideas, or
are inspired to come up with even better ones. And then implement them
in all the platforms I have to build Web apps for so that I can easily
test my applications.

-Tom

···

On Sat, Jan 25, 2003 at 06:49:53AM +0900, ahoward wrote:

On Sat, 25 Jan 2003, Tom Clarke wrote: