3

What frustrates me 'most' in coding is, putting comments...🙄🙄🙄

The frustration seems to go more than the 'most', when I don't find them and wonder, what the heck! 😠😠😠

Comments
  • 1
    Commenting code is a bad thing. Code should be readable without explanation, like as if you were reading a story.
    If you write code that is not easily readable because of performance/whatever then you should comment it for others or yourself reading that code the next week
  • 2
    @b3b3 You'll have to decide, which one is it?
  • 4
  • 1
    @b3b3 oh yeah, waiting for that day to come!!!!😊😊😊
  • 4
    @b3b3 I disagree that comments are bad as a generality.

    I wholeheartedly agree that you should not need to explain what your code is doing, as your structure and naming should do that, but instead why. It's not always necessary, but if you had to do some research and/or experimentation, putting a comment in to explain why you chose your solution will prevent anyone else coming along and either getting confused or wanting to change it to something that you've already ruled out.

    Docblocks can also be really useful for people unfamiliar with a function which calls a few other functions. Yes you can figure it out by following the code, but it's usually much easier and quicker to read a summary at the top level function.
  • 0
  • 1
    Consider perhaps, particularly if writting "advanced" or "complex" code or algorithms, that the skill level of those who will read your code is not the same as yours.
  • 0
    I try to comment in such a fashion that my code acts as an example and tutorial to someone totally new to it, new to the principles involved, and new to the libraries and frameworks involved.

    That way if I want to go on a vacation

    1. I don't have to worry about relaxing so much my brain falls out and I forget things when I get back.

    2. Someone can fill in for me and requires less time to train up if they are new because the source itself is designed as example and tutorial to new people.

    Granted I've only ever worked with one other programmer. Still worth learning to comment well, comment often, and comment clearly. It is a skill all it's own.
Add Comment