From: "trans. (T. Onoma)" Date: 2004-10-22T02:27:47+09:00 Subject: Re: CamelCase issues On Thursday 21 October 2004 05:12 am, Michael Neumann wrote: | Hi, | | For method names that contain up to two words, I really prefer the | underscore-case (e.g., has_key?, method_missing). But if the method name | contains more than two words that starts to look ugly IMO. It even looks | strange (IMO) if you use underscore-case very often in your program | (everything is small, no contrast for your eyes): | | c.form.url("foo").with { | c.table { | c.table_row.id("myrow").with { | c.table_data.align_top.col_span(3).with("Hello world") | } | c.table_row_with_data { | c << "Foo:" | c.text_input.value(myobject.foo).callback(myobject, :foo=) | } | } | } | | Versus: | | c.form.url("foo").with { | c.table { | c.tableRow.id("myrow").with { | c.tableData.alignTop.colSpan(3).with("Hello world") | } | c.tableRowWithData { | c << "Foo:" | c.textInput.value(myobject.foo).callback(myobject, :foo=) | } | } | } Not every single word need to be divided. There is a balance I think: c.form.url("foo").with { c.table { c.tablerow.id("myrow").with { c.tabledata.aligntop.colspan(3).with("Hello world") } c.tablerow_with_data { c << "Foo:" c.textinput.value(myobject.foo).callback(myobject, :foo=) } } } | (and if you know that there's a class TableData, shouldn't the method be | named tableData instead of table_data ?) | | I know that underscore-case is the perfered way in Ruby. Actually I would like to see Ruby move away from the significance of capitalization if possible. T.