• @[email protected]
      link
      fedilink
      English
      114 days ago

      There is no guarantee that the comment is kept up to date with the code. “Self documenting code” is a meme, but clearly written code is pretty much always preferable to unclear code with a comment, largely because you can actually be sure that the code does what it says it does.

      Note: You still need to comment your code kids.

    • @[email protected]
      link
      fedilink
      English
      014 days ago

      If there is an alternative through which I can achieve the same intended effect and is a bit more safer (because it will verify that it has len implemented) I would prefer that to commenting. Also if I have to comment every len use of not that sounds quite redundant as len checks are very common