Clean code principles: everything's relative
-
When you start to break down clean code principles, what counts as clean code to one person may not to another.
"All will come out in the washing."
-
When you start to break down clean code principles, what counts as clean code to one person may not to another.
"All will come out in the washing."
From the article:
_For example, most programmers know what “i++” means, and prefer to use it to increment integers instead of writing out a more tedious phrase like “i=i+1.” But i++ is a shorthand, and shorthands breed ambiguity and uncertainty._
If "most programmers" know what it means, is it really an ambiguity? Follow-up question - at what point does an "ambiguity" fall into the realm of "common practice", and when you're classing code as ambiguous, what is the target audience for the classification? Lastly, reasonably enforced coding standards go a long way towards developing clean code, especially in a team environment, because as a member of a team with said standards, at least you can expect the code to look a certain way.".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013 -
When you start to break down clean code principles, what counts as clean code to one person may not to another.
"All will come out in the washing."
Quote:
Christopher Tozzi, who does not write code, but just looks at it, said:
Here are some guidelines that are almost universally accepted
... And then demanded that everyone follow guidelines that he prefers, and not follow "almost universally accepted" guidelines that are not to his preference. As John said, his declaring the almost universally accepted
i++
as being "ambiguous" is ridiculous -- it has one and only one meaning, and everyone knows that meaning. Perhaps this non-coding "writer" should learn how to use a dictionary, before opening his mouth, and focus on doing his own job properly, before bitching at the way professional coders do theirs.I wanna be a eunuchs developer! Pass me a bread knife!
-
From the article:
_For example, most programmers know what “i++” means, and prefer to use it to increment integers instead of writing out a more tedious phrase like “i=i+1.” But i++ is a shorthand, and shorthands breed ambiguity and uncertainty._
If "most programmers" know what it means, is it really an ambiguity? Follow-up question - at what point does an "ambiguity" fall into the realm of "common practice", and when you're classing code as ambiguous, what is the target audience for the classification? Lastly, reasonably enforced coding standards go a long way towards developing clean code, especially in a team environment, because as a member of a team with said standards, at least you can expect the code to look a certain way.".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013The author briefly touched a large topic: Excessive shorthand. Excessive shorthand is: - Well-known in one subculture (such as C-style language devs) - Initially confusing to outsiders - Problematic for far-off future devs who don't know past languages and frameworks A better example: Lots of C# shorthand in one statement:
public long MyDistance { get; set; } = 0L;
Long-time C# devs know instantly what it means. It looks like garbage to outsiders.
-
The author briefly touched a large topic: Excessive shorthand. Excessive shorthand is: - Well-known in one subculture (such as C-style language devs) - Initially confusing to outsiders - Problematic for far-off future devs who don't know past languages and frameworks A better example: Lots of C# shorthand in one statement:
public long MyDistance { get; set; } = 0L;
Long-time C# devs know instantly what it means. It looks like garbage to outsiders.
to be fair, most of the stuff they've added with C# 8 looks like garbage to me.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
-
Quote:
Christopher Tozzi, who does not write code, but just looks at it, said:
Here are some guidelines that are almost universally accepted
... And then demanded that everyone follow guidelines that he prefers, and not follow "almost universally accepted" guidelines that are not to his preference. As John said, his declaring the almost universally accepted
i++
as being "ambiguous" is ridiculous -- it has one and only one meaning, and everyone knows that meaning. Perhaps this non-coding "writer" should learn how to use a dictionary, before opening his mouth, and focus on doing his own job properly, before bitching at the way professional coders do theirs.I wanna be a eunuchs developer! Pass me a bread knife!
++i must send him into fits. I just want to code for loops at him to see how long it takes him to have an aneurysm.
for(int ic=list.Count,i=0;i
TAKE THAT MISTER NAGGY MAN!
or one of my favorite C# iteration constructs
string line;
while(null!=(line=reader.ReadLine());i'm sure everyone hates me for that.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
-
++i must send him into fits. I just want to code for loops at him to see how long it takes him to have an aneurysm.
for(int ic=list.Count,i=0;i
TAKE THAT MISTER NAGGY MAN!
or one of my favorite C# iteration constructs
string line;
while(null!=(line=reader.ReadLine());i'm sure everyone hates me for that.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
-
Well, seeing how it violates at least two typical coding standard tenets I can see why. :cool:
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
only two? rules were made to be broken.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
-
only two? rules were made to be broken.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
-
When you start to break down clean code principles, what counts as clean code to one person may not to another.
"All will come out in the washing."
In other words it comes down to community standards, just like pornography. One person's art is another person's smut.
Software Zen:
delete this;
-
In other words it comes down to community standards, just like pornography. One person's art is another person's smut.
Software Zen:
delete this;
Except for Perl. That's always smut :)
TTFN - Kent