|
Thanks
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
|
|
|
|
|
if I am checking for null like,
if (myObject == null)
return;
|
|
|
|
|
But in that case I prefer(in single line with braces)
if (myObject == null) { return; }
|
|
|
|
|
Also wrapping increases no of lines...
A drop of water breaks a rock not by brute force but by patience.
|
|
|
|
|
Wrapping increases readability of code.
JKOZA
|
|
|
|
|
Readability in this case is just about what you're used to. It's more a matter of being consistent in your coding style.
|
|
|
|
|
Readability matters when the code size increase and it is in maitainance stage or it moves from one developer to another developer.
JKOZA
|
|
|
|
|
No-one said readability doesn't matter.
|
|
|
|
|
Consistency in coding style comes automatically for a regular developer, but readability is equally important for a project.
JKOZA
|
|
|
|
|
You are talking about readability in general, which is not what the poll is about. It compares two styles. Some say the one is more readable, some say the other. If you for a second forget your own preferences, it's not hard to see that readability here is just a matter of what style one's used to. So, I'm saying readability is not the issue here. The two styles can however have other benefits over the other.
Only because you say apples taste better than pears, doesn't mean you're right. It doesn't mean you're wrong either, if you see what I mean.
|
|
|
|
|
I agree that two styles can have other benefits over the other. And I am also not saying that I am right. And I am talking about readability in terms of these two styles only. I am just telling my point of view. And I am comparing two styles by readability which can be one of the points to compare two styles. And if there is no points common between two styles then how can you compare two styles?
JKOZA
|
|
|
|
|
I agree otherwise. Wrapping increases indentation and readability.
// ♫ 99 little bugs in the code,
// 99 bugs in the code
// We fix a bug, compile it again
// 101 little bugs in the code ♫
|
|
|
|
|
|
I worked in team where sometimes other developers just insert a line below/above it and expect everything to work just fine.
|
|
|
|
|
Amar Chaudhary wrote: just insert a line below/above it and expect everything to work just fine
That's some failure to grasp the most basic part of a language!
Seriously, people who can't cope with single line if statements probably should consider another career.
|
|
|
|
|
I m with you.
// ♫ 99 little bugs in the code,
// 99 bugs in the code
// We fix a bug, compile it again
// 101 little bugs in the code ♫
|
|
|
|
|