topic-comment naming of functions/methods
- by Daniel
I was looking at American Sign Language the other day... and I noticed that the construction of the language was topic-comment. As in "Weather is good". That got me to thinking about why we name methods/functions in the manner of:
function getName() { ... }
function setName(v) { ... }
If we think about naming in a topic-comment function, the function names would be
function nameGet() { ... }
function nameSet() { ... }
This might be better for a class had multiple purposes. IE:
class events {
function ListAdd();
function ListDelete();
function ListGet();
function EventAdd();
function EventDelete();
function EventGet();
}
This way the functions are grouped by "topic". Where as the former naming, functions are grouped Action-Noun, but are sorted by Noun.
I thought this was an interesting POV, what do other people think about naming functions/methods Topic-Comment?
Obviously, mixing naming conventions up in the same project would be weird, but overall?
-daniel