news.volyx.in

Small programming tricks (will-keleher.com)

677 points by signa11 · 25 days ago · 293 comments on HN

Article summary

The article discusses the importance of small programming tricks and nuggets of knowledge in increasing engineering productivity. It shares several examples of such tricks, including using specific terminal commands, SQL queries, and regular expressions. The article also mentions the value of sharing these tricks with others, particularly in a company setting. This can help others learn and improve their productivity, and can also spark useful discussions.

Main themes

  • programming productivity
  • coding tricks
  • branchless code
  • LLMs and coding
  • compiler optimizations
  • code readability
  • performance considerations
  • industry variations in coding practices

What commenters say

  • Some people still code by hand, while others use LLMs for coding, and opinions vary on the productivity gains of each approach.
  • Branchless code can be beneficial in certain situations, but it is not always easier to understand or more efficient.
  • Modern compilers can often optimize code to remove unnecessary branches, making manual branchless coding less necessary.
  • Avoiding branches can sometimes make code simpler and more efficient, but it is not a universal solution and can also make code harder to read.
  • The use of LLMs for coding is not yet widespread in all industries, such as academia, where coding is not always a primary task.
  • There are various ways to avoid branches, including using lookup tables, early returns, and specialized instructions.
  • The decision to use branchless code should be based on profiling and performance considerations, rather than as a general rule.
  • Some commenters disagree on the value of sharing well-known programming tricks, with some seeing it as arrogant or unnecessary, while others find it helpful and informative.