prog: (Default)
prog ([personal profile] prog) wrote2006-11-25 11:58 am
Entry tags:

Hey you coders

These questions aren't language-specific; consider the questions as pseudocode. Pretend that the underscores are actually studlyCaps if you'd like.

Also, don't worry about return values of the mutators, which is a separate question.



[Poll #875101]
wrog: (dew)

[personal profile] wrog 2006-11-26 11:45 am (UTC)(link)
method names that look like variable names.
while this sort of thing does bother me, I'm not sure it's the right argument. get_foo() could be doing all sorts of random things behind the scenes and you'll never know.

I think the real argument against having the same method used as accessor and mutator is the same argument against having the same-named method doing entirely semantically different things depending on the type of an argument or the presence/absence of an optional argument. If munge(x) does something different from munge(), really have no business giving it the same name.

I also hate studly caps. If you're going to have multiple words in your variable names, then, dammit, have actual multiple words complete with spaces to make them legible -- that is what you need the underscores for. As for them being ugly, ugliness is in the eye of the beholder.

[identity profile] dougo.livejournal.com 2006-11-26 05:01 pm (UTC)(link)
If you're going to have multiple words in your variable names, then, dammit, have actual multiple words complete with spaces to make them legible -- that is what you need the underscores for.

Real programmers use hyphens. :)