Small programming tricks
Trending on Hacker News: Small programming tricks (310 points / 157 comments, via will-keleher.com)
In one line
A lot of effective engineering comes from the accumulation of small nuggets of knowledge.
Opening excerpt
Day to day, I think a surprising amount of engineering productivity comes from small nuggets of knowledge: being aware that a language feature exists; knowing that an unexplained tcp delay is probably related to the TCP_NO_DELAY setting and Nagle’s algorithm; knowing the right git incantation to get out of a pickle; or knowing a trick with sed to rewrite a file.
In one sense, this is self-evident: anything you know is going to be made up of smaller pieces of knowledge. Of course those smaller pieces of knowledge matter.
But I think there are some nuggets of knowledge that are particularly valuable and don’t require a lot of supporting mental infrastructure. You don’t need to know any python to use python3 -m http.server to start a simple server in a directory, but it might still make your work marginally easier. Let me share a few examples:
const bucket = Math. floor (Math. log10 ( userInGroupCount )) metrics . increment ( “my_metric” , { bucket }); Modern JS now supports Array.flatMap , Object.entries , and Promise.withResolvers .
(Excerpted from the original; full article via the source link below.)
This story hit the Hacker News front page today (310 points / 157 comments, via will-keleher.com). Our Tech Radar aggregates daily signals on AI engineering, backend architecture and DevOps — browse the related services and further reading below, or get in touch with our team.
Source: Hacker News