Comment by simonask

Comment by simonask a day ago

5 replies

I tend to actually disagree with this attitude, because I see writing documentation as really effective "rubber-ducking". If it's hard and time-consuming to properly document, it's probably hard to use, so extra effort should be spent to actually justify the design, not least to yourself in 6 months. If you can't justify it, it's probably wrong.

kelnos a day ago

This really struck a chord with me. Writing documentation is an act of explaining something to others. Explaining something to others is a great way to test your own understanding. If it's hard to explain to someone else, then maybe it's the wrong design.

If you don't through that exercise, you're much more likely to build confusing, difficult-to-use APIs.

  • throwawaymaths a day ago

    > you're much more likely to build confusing, difficult-to-use APIs.

    have not found this to be the case with zig in general. you could easily make the opposite argument, that documenting things (especially quirks) can give you license to build confusing APIs.

    • ioasuncvinvaer a day ago

      I think some documentation and a handful of examples would have helped the author of the article. How is the experience when porting to the new standard library improved by not including documentation?

    • CRConrad 2 hours ago

      > > you're much more likely to build confusing, difficult-to-use APIs.

      > have not found this to be the case with zig in general.

      Dunno how general it is, but TFA we're discussing here contains an example, so AFAICS it seems at least a little too common.

pmarreck a day ago

100%.

Similar to how TDD forces you to first figure out the API of your code due to the test code being its first client.