Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This quote from John Carmack speaks very succinctly to the problems that many abstractions in a code base can cause, and it's a constant reminder for me when building out business logic.

> "A large fraction of the flaws in software development are due to programmers not fully understanding all the possible states their code may execute in."

https://www.gamasutra.com/view/news/169296/Indepth_Functiona...



This is one reason I love working in the Unity ECS framework. Your data is public and state can’t hide. Your systems are still free to contain a plethora of bugs, but they are easier to track down due to the functional nature of a system.

In the regular Unity OOP land, developers inevitably sprinkle state everywhere. Coroutines are by far one of the worst offenders. Good luck seeing the current executing state of your game when it’s hidden in local variables inside a persistent function body...


But abstractions reduce possible state and allows you to specify that state in obvious ways, e.g. on function parameters. Do not underestimate the power of functional boundaries.


They also tend to impose a degree of discipline. I've often found myself wanting to shove a parameter in somewhere and realized I didn't need the damned thing.


Reading that article and the context of the quote, it appears that Carmack is using that statement to extol the benefits of functional programming styles, not commenting on abstraction.


To me the quote speaks to the general problem of juggling state in your head when writing code. If an abstraction is an attempt to funnel a bunch of code through common logic, it can be hard to understand know what the state of your app will look like when someone else modifies that common logic.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: