• @sweeny@sh.itjust.works
    link
    fedilink
    21 year ago

    I just get AI to write my comments lol. I’ll paste the function or component and tell it to write comments in tsdocs format and it works great every time (I will also add to it sometimes of course).

    Don’t get me wrong, I also write clean code with good function and variable naming, but I find comments are also useful for a few reasons; they make the code even more quickly readable, they can explain why the code is the way that it is, and my favorite reason, they make it so when you hover over a reference to the commented item in an ide you get an explanation of exactly what the code does and what it expects without having to find and read the code itself