Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

31
  • 123
    It's nice to see veteran members challenge the dogmas a little ... Commented May 24, 2016 at 19:58
  • 11
    In an application, you usually provide a mean to access the database, this mean is passed to functions which want to access the database. You don't do that with global variables, you simply know they're at hand. That's a key difference right there. Commented May 24, 2016 at 20:55
  • 47
    Global state is like having a single database with a single table with a single row with infinitely many columns accessed concurrently by an arbitrary number of applications. Commented May 24, 2016 at 23:35
  • 43
    Databases are also evil. Commented May 25, 2016 at 9:21
  • 28
    It's entertaining to "invert" the argument you make here and go in the other direction. A struct that has a pointer to another struct is logically just a foreign key in one row of one table that keys to another row of another table. How is working with any code, including walking linked lists any different from manipulating data in a database? Answer: it isn't. Question: why then do we manipulate in-memory data structures and in-database data structures using such different tools? Answer: I really don't know! Seems like an accident of history rather than good design. Commented May 25, 2016 at 22:18