News for hackers. Stuff that matters.
Re:A DSL in 5 Languages: Ruby, Python, PHP, C#, Java by psadauskas on Tuesday August 03, 2010 @03:34PM (#1572423)
Let's clean up the Ruby example a bit, shall we?

  collection = Braintree::Transaction.search do
    order_id.begins_with?       "a2d"
    customer_website.ends_with? ".com"
    billing_first_name ==       "John"
    status.in?                  Status::Authorized, Status::Settled
    amount.between?             "10.00", "20.00"
  end

  collection.each do |transaction|
    puts transaction.id
  end
Re:A DSL in 5 Languages: Ruby, Python, PHP, C#, Java by cschep on Tuesday August 03, 2010 @05:42PM (#1572855)
are the tabs breaking it into two "columns" idiomatic ruby? I prefer them all flowing "naturally" together.
Re:A DSL in 5 Languages: Ruby, Python, PHP, C#, Java by dan_manges on Tuesday August 03, 2010 @07:19PM (#1573100)
I used to vertically align things into columns in Ruby. It's easy to maintain when you're editing individual lines, but it can easily be messed up with a find-and-replace in file. At that point, it becomes harder to read with some lines off, and a pain to maintain the alignment.
Re:A DSL in 5 Languages: Ruby, Python, PHP, C#, Java by Calamitous on Wednesday August 04, 2010 @12:35AM (#1573660)
If you use Vim, the Align plugin handles this quite well: http://vim.wikia.com/wiki/Align_text_plugin
Re:A DSL in 5 Languages: Ruby, Python, PHP, C#, Java by scott_s on Tuesday August 03, 2010 @11:17PM (#1573544)
I've grown to dislike that habit in all languages. It's too cute and it doesn't scale with code changes. It's easier for me to read code that's formatted in a standard way, even if that means conceptual columns don't line up.
Re:A DSL in 5 Languages: Ruby, Python, PHP, C#, Java by rue on Wednesday August 04, 2010 @09:37AM (#1574443)

    amount.within?             "10.00".."20.00"
Or somesuch. Ranges are always overlooked.