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

> What does too much global state mean? Is having singletons in your application inherently wrong, because they introduce global state? I don't think so.

I do. If you have an hour, the following talk by Rich Hickey (clojure) covers philosophy behind global state being the problem. This is not a code talk and he takes his time getting into it so it's not the easiest talk to get into but it does explain the mindset.

http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hic...

To answer your question more directly:

I believe Java's lack of functions/closures lead to excessive factory use, which tend to be singletonish and so you get the set of dependency injection/IoC frameworks that simply don't exist in other languages but exist in Java due to too much global state. There are other symptoms, but this is the first one that came to mind.



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: