Two Plus Two Publishing LLC Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > Other Topics > Programming

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old 03-15-2012, 04:10 PM   #31
grinder
 
Join Date: Aug 2011
Posts: 527
Re: Coursera SaaS class (Ruby+Rails) discussion

HW1 Prob3 can be done slightly simpler relying on more built-in functionality:

Code:
def combine_anagrams(words)
  result_hash = Hash.new { |hash, key| hash[key] = [] }
  words.each do |word|
    hashkey = word.downcase.split(//).sort.join
    result_hash[hashkey] = result_hash[hashkey].push(word)
  end
  result_hash.values
end
candybar is offline   Reply With Quote
Old 03-19-2012, 02:16 AM   #32
grinder
 
Join Date: Aug 2011
Posts: 527
Re: Coursera SaaS class (Ruby+Rails) discussion

Cucumber was kind of fun to learn and somewhat cute but is this really useful? Why use a language whose best feature is resemblance to English to write tests, if you have to use regex to extend/parse the language anyhow?
candybar is offline   Reply With Quote
Old 03-19-2012, 11:30 AM   #33
Carpal \'Tunnel
 
clowntable's Avatar
 
Join Date: Jun 2006
Location: 39, 46, 56, 59, 191
Posts: 43,064
Re: Coursera SaaS class (Ruby+Rails) discussion

The entire reason is to tap into more domain expert knowledge/work with customers (imo). If you just work on your own projects I'm pretty sure you could simply stick to rspec.

But if you think about a typical project, Cucumber starts to make way more sense. Just imagine sitting at a table with a customer and collectiong feature, feature, feature, feature then scenarios for the features, then estimate work/feature. You can collect this stuff in Cucumber already and have a decent outline of what you need to do with acceptance criteria etc.
All the customer is ever going to see is the feature files

It probably also helps to clear up stuff etc (and you have some sort of minimalistic documentation of what the system is supposed to do, there's some neat output to pdf and whatnot stuff)
clowntable is offline   Reply With Quote
Old 03-20-2012, 02:23 AM   #34
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 12,803
Re: Coursera SaaS class (Ruby+Rails) discussion

Quote:
Originally Posted by candybar View Post
Cucumber was kind of fun to learn and somewhat cute but is this really useful? Why use a language whose best feature is resemblance to English to write tests, if you have to use regex to extend/parse the language anyhow?
apparently this is a real debate, with DHH taking your side:
http://www.rubyinside.com/dhh-offend...bate-4610.html

i enjoyed this exchange quoted in the article:



gaming_mouse is offline   Reply With Quote
Old 03-20-2012, 01:39 PM   #35
Carpal \'Tunnel
 
clowntable's Avatar
 
Join Date: Jun 2006
Location: 39, 46, 56, 59, 191
Posts: 43,064
Re: Coursera SaaS class (Ruby+Rails) discussion

"Why would you build a test-specific parser for English" is such a silly question.
Spoiler:
clowntable is offline   Reply With Quote
Old 03-20-2012, 03:13 PM   #36
grinder
 
Join Date: Aug 2011
Posts: 527
Re: Coursera SaaS class (Ruby+Rails) discussion

Quote:
Originally Posted by gaming_mouse View Post
apparently this is a real debate, with DHH taking your side:
http://www.rubyinside.com/dhh-offend...bate-4610.html

i enjoyed this exchange quoted in the article:



LOL. I sort of get it now - feature files can be read and/or written by business folks, whether clients or product managers. And having to parse the feature files to test forces feature documentation to be maintained because tests will fail otherwise. An interesting, fun way to force people who speak different languages to work together. I can see where it may be worth the overhead.
candybar is offline   Reply With Quote
Old 03-21-2012, 01:01 AM   #37
adept
 
jfresh's Avatar
 
Join Date: Sep 2003
Location: San Francisco
Posts: 1,113
Re: Coursera SaaS class (Ruby+Rails) discussion

Anyone have some ideas on how to write the rspec tests for this week's homework? Particularly:
-a RESTful route for Find Similar Movies
-handling the sad path of "no director"
I'm still having a hard time wrapping my head around stubbing/isolating functionalities in rspec in general, I think.

Also, it sounds like the hw is saying you should re-use the show.html.haml page for when the user clicks 'Find similar movies'- how are people adding functionality to that page for multiple movies? I implemented it one way but seems kind of clunky.
jfresh is offline   Reply With Quote
Old 03-30-2012, 04:26 PM   #38
adept
 
Join Date: Jun 2005
Posts: 1,068
Re: Coursera SaaS class (Ruby+Rails) discussion

Quick question on getting setup with Ruby: I downloaded/installed but am a little confused. I can open "Interactive Ruby" and it looks similar to command prompt but think I'm doing something wrong. I'm trying to follow along here:

http://pine.fm/LearnToProgram/?Chapter=00

Not clear how to save the program you write if I'm doing it right. Having said that, I can't write multiple lines of code and then run the program...so I feel like I'm not looking in the right place.

Thanks for the help guys,
Mariogs
Mariogs379 is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 04:13 AM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.
Copyright 2008-2010, Two Plus Two Interactive