Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

I personally find it extremely telling that there isn't a single line of code in the buzzword filled page.

The entire tree concept he is talking about seems like a misplaced faith that you can achieve that kind of separation.

My gut says that in moderate to large sized programs so much state would end up under the root, just out of laziness, time constraints, over-complexity or lack of programmer skill, that you'd have the worst of all worlds.

I just caught the end of the global variables era and have worked on a few programs where the state of things can get modified anywhere.

It is not pretty.



While David Barbour does tend towards thinking about loud a great deal before coding (which is certainly sensible), he has also previously implemented these ideas in Sirea (https://github.com/dmbarbour/Sirea) and has just released a spec and interpreter for his Awelon language - http://awelonblue.wordpress.com/2013/12/25/awelon-project-pr...


I've worked on similar code. Global state which is sometimes twiddled directly in the main loop, other times functions are called that take no arguments and return nothing, but they compute something and set global variables.

Not pretty is an understatement. It's ugly at best, and rage inducing most the time.


It helps when you can use the type system to restrain what can touch what. I've been doing this in some of my high performance C, where some global mutable state is unavoidable - passing around empty structs to indicate context. It doesn't guarantee I don't violate my rules, but it more likely I notice when I do.


It's almost never as bad when you design it yourself. Then the logic and reasons are apparent. Coming into such a system from the outside can be tough though. An explanation of the rationale and pre and post conditions is very helpful, even if all it does is keep a future programmer from trying to circumvent the system and causing the problems it was implemented to avoid.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: