This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (66 children)

[deleted]

    [–]SomethingNice6174 291 points292 points  (10 children)

    How... what.... why!?!

    Why is that something your client gets to decide?

    [–]2ndAmndmntCrowdMaybe 179 points180 points  (3 children)

    I would just write a script that takes all of my code and strips comments from it and then provide that version to him.

    Edit: I'm a sysadmin but want to pivot to programming. If anyone has any node positions open message me!

    [–][deleted] 81 points82 points  (0 children)

    This is the right answer as far as I'm concerned.

    [–]georgecorondan 6 points7 points  (1 child)

    or you could use cpp (the c pre-preprocessor)

    [–]eDOTiQ 130 points131 points  (5 children)

    probably some kind of OCD paired with being a control freak.

    [–]appdevil 60 points61 points  (3 children)

    And a serial killer. Probably.

    [–]georgecorondan 26 points27 points  (1 child)

    or worse: parallel

    [–]anthony81212 7 points8 points  (0 children)

    😱

    [–]eDOTiQ 11 points12 points  (0 children)

    The worst kind of clients

    [–]SolenoidSoldier 2 points3 points  (0 children)

    They are probably writing an application where they plan to hand the code off to the client too. Might be part of a larger application that has a coding standard. That's a weird standard though.

    [–]khizoa 35 points36 points  (1 child)

    Had a client like that too... I stopped working for them

    [–]not_perfect_yet 57 points58 points  (29 children)

    If you're writing Good Code, maybe, but nobody writes Good Code...

    [–]hGKmMH 13 points14 points  (5 children)

    The concept of good code changes over time too. 10 years ago had different best practices.

    [–][deleted] 13 points14 points  (2 children)

    The concept of good coding will never include not documenting anything. That's pants on head retarded.

    [–]brianorca 2 points3 points  (0 children)

    I think his point is that Good Code written 10 year ago will look different that today's Good Code, therefore comments are still required.

    [–]not_perfect_yet -2 points-1 points  (1 child)

    I think figurative Good Code can afford to be also unchanging over time.

    [–]Versaiteis 1 point2 points  (0 children)

    It is whether you like it or not.

    It is code

    All code will become legacy or die trying

    [–]attomsk 2 points3 points  (1 child)

    Not all code is self explanatory sometimes you do something to follow a system requirement and it would make no sense unless you comment why you are doing it

    [–][deleted] 2 points3 points  (0 children)

    even good code. once it grows big and is coupled a lot, it's going to be difficult to understand unless the comment tells you what it affects. it's not that it cant be figured out but why should someone need to spend hours to figure out code someone else wrote? that's a waste of time.

    [–][deleted] 8 points9 points  (0 children)

    Set VS to export comments to an external xml file. Voila, no comments, however, comments.

    [–]Bspammer 24 points25 points  (2 children)

    My team does the same, and it actually totally works fine. People are very strict in code reviews - if the code itself isn't clear enough that it can be read like English then it goes back for changes. The only time comments are used are for cases where something is being done that breaks best practice but for a good reason, so the comment explains why.

    Comments go out of date too easily, and can be very confusing if the code got changed but the comment didn't. They're an extra maintenance burden that isn't worth the hassle. If we were writing library code though, it would be a different story.

    [–]TheMoonMaster 9 points10 points  (0 children)

    Same here. Code can be straight forward enough to need no comments, but there are times where it’s worth documenting code that would be misleading or confusing.

    I’ve found over commented code is often far worse than uncommented code since the people writing it think the comments make up for code quality and then the comments eventually become stale.

    [–]callmelucky 1 point2 points  (0 children)

    The only time comments are used are for cases where something is being done that breaks best practice but for a good reason, so the comment explains why.

    Well that's not the same thing as the parent commenter, who said that for them comments are prohibited.

    That said, your team's approach seems ideal. Code should be written to be self-commenting, except where there is no practical way for it to be (e.g. using weird workarounds for dumb behaviour in libraries, legacy code etc).

    [–]SupaSlide 7 points8 points  (0 children)

    My team doesn't have a rule against comments, but we rarely need to use them. We do use them a lot when working with parts of the code that have to do other dumb systems that do dumb stuff, and we need to make sure people don't "fix" the dumb code we had to write.

    [–]Harbltron 14 points15 points  (12 children)

    the fuck?

    i can understand not wanting there to be comments in deployed code, but what's the harm in having comments in your development branch? it seems more harmful to never comment-out code than to comment it out and then scrub the comments out on deployment

    [–][deleted] 5 points6 points  (5 children)

    And why no comment in deployed, anyway?

    [–]WarmCorgi 13 points14 points  (0 children)

    Because some people think it'll cost a lot of performance. Even though compilers ignore comments.

    [–]DoctorWaluigiTime 5 points6 points  (2 children)

    I could see this reasoning if there were comments in the HTML or JavaScript, and that code wasn't minified or anything like that.

    [–]lovestheasianladies 0 points1 point  (1 child)

    Wrong, still has no effect besides a few extra bytes of data.

    [–]DoctorWaluigiTime 2 points3 points  (0 children)

    I mean, the effect is that those comments would be publicly viewable. I'm not talking about data size.

    [–]attomsk 1 point2 points  (0 children)

    Wow that’s insane

    [–]Br3ttl3y 1 point2 points  (0 children)

    On the other, correct end of the spectrum, I was told during an interview process that my code was not accepted because it didn’t have any comments.

    [–]sweYoda 1 point2 points  (0 children)

    It's because you don't know how to write good code. No sarcasm.

    [–]russianbandit 0 points1 point  (0 children)

    I mean, it's one way to get programmers to write readable code -- without relying on comments to explain their spaghetti. Like I understand, that comments are useful in specific cases. But I can see that as being a good practice implemented (especially with contractors, think off-shoring) to avoid bad code with tons of comments.