|
|
|
|
|
by CGamesPlay
3647 days ago
|
|
For whatever reason, I'd prefer comments to this version. Note: I actually agree with the OP about pulling the logic into named conditionals whenever possible, but in the case you do want the short-circuiting behavior I would not bother with the variables at that point. if (loggedIn() && hasRole(ROLE_ADMIN)) {
// User has permission to do this
if (data != null && validate(data)) {
// Submitted data is valid
...
}
}
|
|
I see such comments as symptoms of time pressure or a somewhat sloppy, but caring, programmer.