👉 Go to Summary
There is no wrong or right way, there is our way.
-- Someone
.
.
.
Naming is hard #1
WTF!?
$value = $this->getLoggedUser();
// ... after 50 lines of code you forget what `$value` is.
Nice!
$user = $this->getLoggedUser();
// Ok, got it. It is `$user`
.
.
.
Naming is hard #2
WTF!?
$user1 = User::where('name', 'Mary')->first();
$user2 = User::where('name', 'Joe')->first();
// 50 lines of code here ...
if ($user1->age > $user2->age) {
// WTF are $user1 and $user2 ?
}
Nice!
$mary = User::where('name', 'Mary')->first();
$joe = User::where('name', 'Joe')->first();
... // 50 lines of code here
if ($mary->age > $joe->age) {
// Ok, Mary is older than Joe
}
Top comments (0)