11

UNLEARN commenting your code, and write code that is easy to understand instead.

Comments
  • 3
    Unlearn to comment what your code is doing. Comment why it's doing it (in this way)
  • 0
    "instead of getting appendicitis, just learn to have a better appendix"

    I feel like you just started coding lol
  • 0
    @spoiledgoods
    I program microcotrollers. There is a lot of controller- and architecture-specific behaviour that is not intuitive. There are errata sheets that tell you weired workarounds for hardware bugs. The same for peripheral devices, e.g. sensors. Some of your control-code needs exact behaviour which needs special configuration of the controller. You want to document there things and especially want to link to the programmer's manual, the data sheet (these things are hunderts of pages for every controller) or the errata sheet, so that you (and everyone else who works with the code) can understand the implementation. If you do not do that, you forget about a special case or a hardeware-specific behaviour later and screw up your day.
    If you have a good argument, I'm happy to hear it, but please do not insult me again.
  • 0
    @zlice
    1 - Mh, I read the comment again and maybe I misunderstood it. If so, please excuse me @spoiledgoods
    2 - I'm implementing the drivers/interfaces to the sensors and the application running on the MCU after the specifications given in the datasheet.
  • 0
    @Scade didnt insult you at all, but if the shoe fits...

    nice victim complex
  • 0
    @zlice sounds like exactly what I do. I have a shit ton of comments in my code, because I know no matter how well it's written, it's still much easier for me to understand than literally everybody else. why make someone else's life harder? so I can stroke my own ego regarding my programming skill?
  • 0
    @spoiledgoods I misunderstood your comment. Editing was not possible anymore an I didn't just want to delete my comment. Again, I'm sorry. I don't feel victimized at all.
Add Comment