news.volyx.in

Think in Math, Write in Code (justinmeiners.github.io)

478 points by selff · 2651 days ago · 244 comments on HN

Article summary

The article discusses the importance of thinking in mathematical terms when approaching programming problems, rather than relying solely on programming languages. It argues that programming languages are implementation tools, not thinking tools, and that mathematics provides a more flexible and free medium for expressing ideas. The author suggests that thinking in math and writing in code can lead to better problem-solving and more efficient implementation. This approach can help programmers create more effective and elegant solutions to complex problems.

Main themes

  • Mathematics in programming
  • Programming language limitations
  • Problem-solving strategies
  • Code readability
  • Mathematical notation

What commenters say

  • Using single-letter variable names can be acceptable in certain contexts, such as within a single function or for mathematical variables, but may not be suitable for all situations. Some argue that programming languages should be optimized for readability, while others believe that concise variable names can be more effective in certain cases. There is a desire for a programming language that makes mathematicians feel at home, with some suggesting that languages like Haskell or APL may fit this bill. Others argue that no programming language can fully capture the flexibility and expressiveness of mathematical notation. The use of mathematical concepts, such as monads, can help deal with imperfect input and side effects in programming. Some commentators believe that thinking in a mathematical style can be beneficial for programming, but others argue that this approach may not be suitable for all types of problems, particularly those involving messy real-world data. Certain programming languages, such as Lisp, are seen as more powerful and flexible than others, but may not be the best choice for every situation.