M
Michael Neumann
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=)
}
}
}
(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.
Some more examples:
render_content_on <-> renderContentOn
render_table_header_on <-> renderTableHeaderOn
Which one would you prefer? Thanks.
Regards,
Michael
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=)
}
}
}
(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.
Some more examples:
render_content_on <-> renderContentOn
render_table_header_on <-> renderTableHeaderOn
Which one would you prefer? Thanks.
Regards,
Michael