Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. CodeProject newsletter suggested article

CodeProject newsletter suggested article

Scheduled Pinned Locked Moved The Lounge
csharpcomhelpquestionlearning
15 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ _Damian S_

    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!!

    K Offline
    K Offline
    KP Lee
    wrote on last edited by
    #6

    I know that. He was tweaking my post, so I was tweaking back. My whole reply wasn't serious.

    1 Reply Last reply
    0
    • P Peter_in_2780

      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.

      K Offline
      K Offline
      KP Lee
      wrote on last edited by
      #7

      Thank you, you are so right. (Smacking my head over not seeing that to begin with.)

      1 Reply Last reply
      0
      • A AspDotNetDev

        Why are you so whitespace sensitive?

        Thou mewling ill-breeding pignut!

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #8

        Whitespace is like cleavage... :cool:

        K V 2 Replies Last reply
        0
        • P PIEBALDconsult

          Whitespace is like cleavage... :cool:

          K Offline
          K Offline
          KP Lee
          wrote on last edited by
          #9

          I like cleavage too!

          1 Reply Last reply
          0
          • K KP Lee

            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?

            R Offline
            R Offline
            RCoate
            wrote on last edited by
            #10

            Cagdas Basaraner wrote:

            Don't write uncorrect comments. Uncorrect explanations are worse than no-comment.

            Is this irony? Surely you should explain your course corrections. Uncorrect[^]

            K 1 Reply Last reply
            0
            • P PIEBALDconsult

              Whitespace is like cleavage... :cool:

              V Offline
              V Offline
              Vivi Chellappa
              wrote on last edited by
              #11

              Preferences vary. Some men may like flat chests! Not if silicone gel implant statistics or padded bra sales are to be believed.

              1 Reply Last reply
              0
              • R RCoate

                Cagdas Basaraner wrote:

                Don't write uncorrect comments. Uncorrect explanations are worse than no-comment.

                Is this irony? Surely you should explain your course corrections. Uncorrect[^]

                K Offline
                K Offline
                KP Lee
                wrote on last edited by
                #12

                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.)

                R 1 Reply Last reply
                0
                • K KP Lee

                  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.)

                  R Offline
                  R Offline
                  RCoate
                  wrote on last edited by
                  #13

                  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.

                  1 Reply Last reply
                  0
                  • K KP Lee

                    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?

                    B Offline
                    B Offline
                    BobJanova
                    wrote on last edited by
                    #14

                    Blackspace is much easier on the eyes than white. I code with black backgrounds as a matter of course.

                    1 Reply Last reply
                    0
                    • K KP Lee

                      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?

                      B Offline
                      B Offline
                      BobJanova
                      wrote on last edited by
                      #15

                      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.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups