lunes, 9 de mayo de 2016

Metodos y Nombres nombres nombres....

He encontrado esto:

- methods that do something should be verbs:
  obj.calculate
  obj.set_name
  obj.get_date

- methods that are accessors (or behave like them) should be nouns:
  foo = obj.name
  puts obj.date
  obj.calculation

- Interrogative methods get phrased as questions:
  obj.date_today?
  obj.name?
  obj.calculation_done?

- methods that modify the object (or caller) itself, should be
exclamations:
  obj.truncate!
  obj.remove_name!
  obj.date! "Julian" # I wish I could do obj.date "Julian"!, instead.

Ah, well.
Fuente: https://www.ruby-forum.com/topic/898325

No hay mucha información acerca de esto, pero esimportantisimo... Hay solo que ver este artículo:
http://www.itworld.com/article/2833265/cloud-computing/don-t-go-into-programming-if-you-don-t-have-a-good-thesaurus.html