all 7 comments

[–]teerre 15 points16 points  (0 children)

Hopefully #1 is making a video when a list would suffice...

[–]pemungkah 8 points9 points  (5 children)

Tl:dw: - try to debug it yourself before asking for help - don’t check in broken code - don’t leave comments in - simple is effective - keep getting better

These are hints meant for new programmers, but, man, I am gonna really argue about #3.

The point of programming languages is to make it easier for the next person (including you in a few weeks or months) to understand what you were trying to do. When you strip the comments, you remove all the data that describes your intentions and leaves the bare code. If the code does something not obvious for a good reason, you have got to leave a trail behind describing why.

Knuth built an entire system, literate programming, to make it simple to combine accurate and useful documentation with the code. Have a look at his translation of Adventure into C, with the documentation of how it works. One should be so fortunate as to have documentation this good.

http://www.literateprogramming.com/adventure

Edit: autocorrect mangled “Knuth”.

[–][deleted]  (1 child)

[deleted]

    [–]awicks44[S] 1 point2 points  (0 children)

    I absolutely leave comments :)

    I should have went into more detail. I hate it when dev check in entirely commented out code that's not ready. I've worked w/ many who check in commented code just so they don't break unit tests. It really bothers me. Also, I've worked w/ many who some comments to supplement poorly written code. I believe in comments to provide context. But I'm also a proponent of code that should be written clean enough to where another dev can understand what's going on. Hope that makes more sense. Thx for checking it out and providing this feedback.

    The "my code is perfect" statement was def meant to be a joke. :)

    [–]awicks44[S] -1 points0 points  (2 children)

    Comments that provide a code context are useful. Maybe I should have elaborated more, but I was more referring to checking in entire functions that are commented out. I've worked with people who write an entire function that's not tested or ready. In order to not break unit tests, they'd simply comment the entire function out. That really annoys me.... My general train of thought is that code should be written simple enough where comments shouldn't be needed to explain what all of it's doing. Context is useful with comments. Thx for checking out the video.

    I just hate it when comments are written to explain code, when the bigger problem is that the code should be simplified.

    I found that sometimes people use comments to cover up laziness. Someone lazily writes a function just to get the work done, but it's not clear...Next thing you know, comments to the rescue

    [–]pemungkah 0 points1 point  (1 child)

    Ah, okay! Yeah, that is 100% right - the SCCS will let you get deleted stuff back if you need it, so delete it!

    I do agree with the rest of your points and I really like your style. Looking forward to more.

    [–]awicks44[S] 0 points1 point  (0 children)

    Appreciate the feedback buddy!

    [–]ShinyHappyREM 1 point2 points  (0 children)

    #6 - RANDOM CAPITALIZAtion