LESSWRONG
LW

chmod
0010
Message
Dialogue
Subscribe

Posts

Sorted by New

Wikitag Contributions

Comments

Sorted by
Newest
No wikitag contributions to display.
Debugging for Mid Coders
chmod18d10

I consider myself really good at debugging, but How does one "read the docs?" is something I never got good at? Notable devs like mitchellh skim the entire docs to get a vague idea of where stuff might be. This was never helpful for me. Docs seem to try to explain things in general whereas I think humans learn much faster from examples? We learn speech before grammar, we learn addition before number theory.

Searching for examples also biases your results to more commonly used functions. Function use is very Pareto distributed (small core of common functions and long tail of almost never used functions), docs hide this. Consider the libcurl function listing https://curl.se/libcurl/c/allfuncs.html. It hides the fact that  curl_easy_{init,setopt,perform,cleanup} is more important than everything else.

Finding good reference code is a skill in itself though. https://sourcegraph.com/search indexes ~all public code, and has great tools like lang:Go and -file:^vendor.  Keeping all relevant repos checked out in one folder you can ripgrep over also helps. tree-sitter and semgrep are well regarded, but I found them too distracting to be useful.

Reply
No posts to display.