Hacker News new | ask | show | jobs
by papaver 537 days ago
a lot of good points but i feel like one of the biggest i've learned is missing...

leaning toward functional techniques has probably had the biggest impact on my productivity in the last 10 years. some of the highest cognitive load in code comes from storing the current state of objects in ones limited memory. removing state and working with transparent functions completely changes the game. once i write a function that i trust does its job i can replace its implementation with its name in my memory and move on to the next one.

1 comments

Before OOP became popular the usage of global variables was discouraged in procedural languages because it was the cause of many bugs and errors.

In OOP global state variables were renamed to instance variables and are now widely used. The problem why it was discouraged beforehand did not went away by renaming but is now spread all over the place.