CodeProject newsletter suggested article
-
KP Lee wrote:
Since I am a pignut, what the heck am I? And how did you know what my breeding status was?
Ummm... that was in the OP's signature block, not to be taken as their response to your post...
Silence is golden... but duct tape is silver!! Booger Mobile - My bright green 1964 Ford Falcon - check out the blog here!! | If you feel generous - make a donation to Camp Quality!!
-
KP Lee, quoting article, wrote:
if (value) {, public class A {
As I read the article, the comma is a metacomma, separating the examples
if (value) {
and
public class A {
Not very well done I agree, but not the pig's breakfast some might imagine. Cheers, Peter
Software rusts. Simon Stephenson, ca 1994.
-
Why are you so whitespace sensitive?
Whitespace is like cleavage... :cool:
-
Whitespace is like cleavage... :cool:
-
http://dotnet.dzone.com/articles/10-best-practices-code-0[^] CodeProject asked if you agreed with the comments about comments. I actually agree with a lot of what was written, then about fell out of my chair with one of their "good" examples of using spacing: "if (value) {, public class A { " 1. I don't know what ", " does in the above context. That may be my personal lack in coding skills. 2. If I have multiple commands, I like to see them separated by lines, not spaces. That is just a personal preference. 3. Though legal, declaring a class in an IF statement seems so wrong on so many levels. 4. This is an article on good practices. Do YOU think it is a good practice to declare this class public? 5. One of the suggestions as a good practice is to using meaningful variable names. I totally agree with that one. 5a. I saw a perfectly valid statement, that, without looking anywhere else in the code, I knew the code had a bug. They had documented they were not doing what they intended to do with the variable names. How they were used in the if statement contradicted their intent. 5b. So, you, of course know what they intend to do with "A", don't you? :laugh: 6. Should I have posted this in the hall of shame?
-
Whitespace is like cleavage... :cool:
Preferences vary. Some men may like flat chests! Not if silicone gel implant statistics or padded bra sales are to be believed.
-
Cagdas Basaraner isn't even on this thread. Why quote him when replying to me? (Lose your compass bearings?) I didn't even think uncorrect was a word. Interesting that there are two definitions for it. This definition: "2. to convert (a magnetic course) into a compass course." is interesting. I thought a compass course was a magnetic course. Wrong:true-course-magnetic-course-magnetic-heading-compass-headinghelp[^] (Assuming course and heading are equivalent terms.)
-
Cagdas Basaraner isn't even on this thread. Why quote him when replying to me? (Lose your compass bearings?) I didn't even think uncorrect was a word. Interesting that there are two definitions for it. This definition: "2. to convert (a magnetic course) into a compass course." is interesting. I thought a compass course was a magnetic course. Wrong:true-course-magnetic-course-magnetic-heading-compass-headinghelp[^] (Assuming course and heading are equivalent terms.)
KP Lee wrote:
Cagdas Basaraner isn't even on this thread. Why quote him when replying to me? (Lose your compass bearings?)
He was the original author of the article. I was quoting that. I just thought it a bit ironic that he used the wrong word when asserting that comments must be correct.
-
I am not a racist, if you can show a good case for using blackspace, I'll listen. :) Assuming you are talking about "2", I did say it was a preference, I won't "fix" your code if you use the "wrong" way of coding. Since I am a pignut, what the heck am I? And how did you know what my breeding status was?
-
http://dotnet.dzone.com/articles/10-best-practices-code-0[^] CodeProject asked if you agreed with the comments about comments. I actually agree with a lot of what was written, then about fell out of my chair with one of their "good" examples of using spacing: "if (value) {, public class A { " 1. I don't know what ", " does in the above context. That may be my personal lack in coding skills. 2. If I have multiple commands, I like to see them separated by lines, not spaces. That is just a personal preference. 3. Though legal, declaring a class in an IF statement seems so wrong on so many levels. 4. This is an article on good practices. Do YOU think it is a good practice to declare this class public? 5. One of the suggestions as a good practice is to using meaningful variable names. I totally agree with that one. 5a. I saw a perfectly valid statement, that, without looking anywhere else in the code, I knew the code had a bug. They had documented they were not doing what they intended to do with the variable names. How they were used in the if statement contradicted their intent. 5b. So, you, of course know what they intend to do with "A", don't you? :laugh: 6. Should I have posted this in the hall of shame?
It's a bit of a nothing article, short on concrete examples and basically boiling down to 'be consistent, use sensible names and don't comment when you don't need to'. Which I agree with, but it's so high level as to be meaningless. I don't agree that you should always Jdoc/Ndoc public methods; these go out of date as often as other comments and out of date comments are worse than none. They also take up space in the source file and make it harder to see the bits that actually do stuff. If the method has a meaningful name and so do its parameters then the documentation is superfluous. The exception to this is a library, where (i) the signature and therefore comment won't need to change, and (ii) it may be referenced from a release mode binary where parameter names are lost. I wouldn't put a space between a cast expression and the thing it's casting, either. The tight binding between those two things should be shown in layout, imo.