[Haskell-cafe] Proposal: New syntax for Haskell

Michael Xavier michael at michaelxavier.net
Sat Sep 14 21:34:59 CEST 2013


I just want to chime in to defend Cucumber, which I use in Ruby at my day
job. I see a lot of people put up the strawman that it can only be used as
a way for business people to write acceptance tests. That idea is
questionable and I've never worked at a company big enough to require that,
or with business people who have ever wanted to write my tests for me.

In Ruby, I use Cucumber purely for myself to drive high level acceptance
tests for products. I think the sweet spot for it is when you're starting
work on a high level feature and you have NO idea how it will be
implemented or even how it will work in detail. I find that writing in the
limited language that Gherkin provides keeps my brain from going right to
implementation details. I write out tests that explore how the system
should work. I write them in the perspective of the user (which you should
be doing in your head regardless because the user is the one who will
actually interact with your program). I then read them back and make sure
they make logical sense. Only then do I start hooking up the steps I wrote
to code that drives integration/acceptance tests, via a browser for
instance. At the end I have a failing cucumber test that describes the
system in an intuitive manner with zero line noise (programming language
syntax). I am now free to think about implementation details, write lower
level unit tests and implement things that can be described in much less
verbose fashion. I really like that process and if I ever had a job to
develop products in Haskell, I'd probably take a similar approach.

Do note that I advocate using Cucumber to create/drive user stories, not to
unit test low level functions like folds. If you don't have a customer of a
particular function who could describe how they interact with it in
layman's term, then Cucumber is the wrong tool. Use quickcheck/hunit/hspec
for that.


On Thu, Sep 12, 2013 at 3:42 PM, Bob Ippolito <bob at redivi.com> wrote:

> Have you tried AppleScript? I wouldn't say it's pleasant to use, but it's
> easy to read.
>
>
> On Thursday, September 12, 2013, David Thomas wrote:
>
>> I've long been interested in a scripting language designed to be spoken.
>> Not interested enough to go about making it happen... but the idea is
>> fascinating and possibly useful.
>>
>>
>> On Thu, Sep 12, 2013 at 2:57 PM, Andreas Abel <andreas.abel at ifi.lmu.de>wrote:
>>
>>> **
>>>
>>> +1
>>>
>>> Cucumber seems to be great if you mainly want to read your code over the
>>> telephone, distribute it via national radio broadcast, or dictate it to
>>> your secretary or your voice recognition software.  You can program thus
>>> without having to use you fingers.  You can lie on your back on your sofa,
>>> close your eyes, and utter your programs...
>>>
>>> We could have blind Haskell/Cucumber programming contests...
>>>
>>> Tons of new possiblilities...
>>>
>>> Strongly support this proposal. ;-)
>>>
>>> Andreas
>>>
>>> On 2013-09-10 22:57, Artyom Kazak wrote:
>>>
>>> On Wed, 11 Sep 2013 00:20:26 +0400, Thiago Negri <evohunz at gmail.com> wrote:
>>>
>>> I hope these jokes do not cause people to be afraid to post new ideas.
>>>
>>> Agreed. I would also like to clarify that my message was much more a joke
>>> on
>>> the incomprehensibility of legal acts than on the original proposal.
>>>
>>> By the way, I am pretty impressed with this piece of Cucumber
>>> description/code:
>>>
>>>    Scenario: Mislav creates a valid task with an upload
>>>      When I go to the "Awesome Ruby Yahh" task list page of the "Ruby
>>> Rockstars" project
>>>      When I follow "+ Add Task"
>>>      And I fill in "Task title" with "Ohhh upload"
>>>      And I follow "Attachment"
>>>      When I attach the file "features/support/sample_files/dragon.jpg" to
>>> "upload_file"
>>>      And I press "Add Task"
>>>      And I wait for 1 second
>>>      And I should see "Ohhh upload" as a task name
>>>
>>> I was much more sceptical when I had only seen the example in Niklas’s
>>> message.
>>> _______________________________________________
>>> Haskell-Cafe mailing listHaskell-Cafe at haskell.orghttp://www.haskell.org/mailman/listinfo/haskell-cafe
>>>
>>>
>>>
>>> --
>>> Andreas Abel  <><     Du bist der geliebte Mensch.
>>>
>>> Theoretical Computer Science, University of Munich http://www.tcs.informatik.uni-muenchen.de/~abel/
>>>
>>>
>>> _______________________________________________
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe at haskell.org
>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>>
>>>
>>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>


-- 
Michael Xavier
http://www.michaelxavier.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130914/6053da73/attachment.htm>


More information about the Haskell-Cafe mailing list