• Johanno@feddit.org
    link
    fedilink
    arrow-up
    47
    arrow-down
    1
    ·
    4 months ago

    I write such comments because I have to.

    Company policy.

    Also we have to specify every line of code and what it should do…

        • jaybone@lemmy.world
          link
          fedilink
          arrow-up
          5
          ·
          4 months ago

          Sometimes I think after i retire, I should teach. In the hopes that i could inspire people to write good code, instead of a lot of the garbage i see in the industry. This comment makes me sad.

          • MystikIncarnate@lemmy.ca
            link
            fedilink
            English
            arrow-up
            2
            ·
            4 months ago

            I just want to be clear, this was like highschool cs classes. I took things a bit more seriously in college.

            I never wrote messy code or illogical code, or any code that didn’t work. We were learning C++ in those days and if you know anything about C++, you can basically cram an entire program into a single line. You can also do some shorthand stuff for calculations and updates to variables… So while the class was instructed to use whitespace and comments and update variables like “var = var + #” I would do var += #… I wouldn’t comment it, mainly out of hubris.

            I was pretty good at it but I was lazy as all hell with it.

    • ulterno@lemmy.kde.social
      link
      fedilink
      English
      arrow-up
      8
      arrow-down
      4
      ·
      4 months ago

      I feel like I am going to have to do the same thing in the end, to get my hand-over accepted.
      Should I just copy the line of code and make a comment next to it with:

      // It does <paste line of code>
      

      CC BY-NC-SA 4.0

        • ulterno@lemmy.kde.social
          link
          fedilink
          English
          arrow-up
          12
          arrow-down
          5
          ·
          4 months ago

          Not every. The quick, very-low effort ones, I just leave.

          Why:
          I saw another post with “Anti Commercial AI License”, then wen on to read the license and went, “Neat!”.

          • It makes it easier for anyone to decide what to do if they want to use my comment/post (in cases where it actually has something useful)
          • It makes life just a bit harder for people data-mining for AI
            • That way, some data entry worker will probably ask for a raise and probably even get it and maybe some entrepreneur going “AI everywhere!” will think twice.
            • Or there will be a chatbot spouting “Anti Commercial AI License” or “CC By-NC-SA” in their answer text, which would be hilarious.

          CC BY-NC-SA 4.0