top | item 43158335

(no title)

doall | 1 year ago

Reducing cognitive load is the key. Several approaches I usually take are: 1. Make strict rules for code convention, especially naming things, and stick to that. 2. Use intermediate variables (let binding) often 3. Turn meaningful code block to a function often 4. Write Clojure specs and turn them to docstrings

In addition to that, a real REPL programming really helps to do small tests and understand the code quickly, immutable data structures with data-oriented approach and locally scoped code blocks combined with structural editor are godsend as well.

discuss

order

owkman|1 year ago

Do you have any resources showing what this type of coding works in the real world? I keep running into this same types issue when I use languages without types specified everywhere, where the cognitive load gets too much for non-trivial projects. I would be pretty unhappy writing python without type hints and tools that check these for correctness built into my workflow for example.

doall|1 year ago

This was from my experience that I thought may work for others too. Types may help in some sense, but is not enough and sometimes even add extra load especially on heterogenous data structures. Before using any tools beside basic IDE features, I think there are fundamental things you can do to reduce cognitive load, such as focusing more on code design, convention, structures, naming, testing, documentation, which can be applied whatever language you use.