‹ BackHN Continuity

Thread

Markdown in /src

154 points · 99 comments · perrygeo

  1. fifferfaffer · · focus · HN ↗
    My favourite projects typically have documentation in comments.

    One example is SpiderMonkey, which uses these beautiful, long expository comments explaining not only what, but why design choices have been made. <a href="https:&#x2F;&#x2F;searchfox.org&#x2F;firefox-main&#x2F;source&#x2F;js&#x2F;public&#x2F;RootingAPI.h#33" rel="nofollow">https:&#x2F;&#x2F;searchfox.org&#x2F;firefox-main&#x2F;source&#x2F;js&#x2F;public&#x2F;RootingA...

    If the goal is &quot;locality&quot;, you can&#x27;t get much closer than as a comment.

    As far as markdown becoming &quot;source code for agents&quot; under the agentic paradigm, per-directory `AGENTS.md` seems more consistent, at least visually. If agent managed markdown is going to be high-churn, I&#x27;d rather it be confined to a single file. Constraints, especially for agents, are good.

    1. lucicditee · · focus · HN ↗
      In my adjunct teaching I tell all my students to focus on &quot;why&quot; comments. Everyone parrots that code should be self-commenting, and for the most part they are correct (conceding that, for long cryptic lines of regex, or trendy Python one-liners, the &quot;what&quot; comments can still be useful) -- but they miss the core idea of why comments are useful. I can&#x27;t see into your brain as the other programmer. To me, your design choice might appear stupid, brainless, or completely baffling; but if you put a comment telling me why you did it that way, I&#x27;m a lot less likely to get fixated on the shenanigans when I&#x27;m the guy picking up your code 5 years later.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.