Why are global variables bad, in a single threaded, non-os, embedded application

后端 未结 13 1659
既然无缘
既然无缘 2020-12-01 05:20

Most of the objections I see to using global variables make sense since they refer to issues of multiple threads, thread safety, etc.

But in a small, single threaded

13条回答
  •  孤街浪徒
    2020-12-01 06:05

    Because it minimizes coupling. Your system may be small now but if you keep on working, it may turn out not to be.

提交回复
热议问题