-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bad Example] Function names should say what they do #23
Comments
perhaps something more like class Email
{
//...
public function handle() {
mail($this->to, $this->subject, $this->body);
}
}
$message = new Email(...);
// What is this? A handle for the message? Are we writing to a file now?
$message->handle(); compared to class Email
{
//...
public function send() {
mail($this->to, $this->subject, $this->body);
}
}
$message = new Email(...);
// Clear and obvious
$message->send(); |
@hailwood your example i like more |
@hailwood Could you create PR for that? |
Closed by #44 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Function names should say what they do
Bad:
Good:
What is the purpose of
addToDate()
/addMonthToDate()
functions?What are they needed for?
These functions are meaningless.
The text was updated successfully, but these errors were encountered: