DEV Community

Discussion on: The assembly line, code, and Big O.

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

I think you may be confusing the issues of global state and efficiency. Whether something is "global" rarely impacts its algorithmic complexity. The structure of the data, not where it's located, is what impacts the complexity.

The comparison and use of O(n) also feels incorrect. Though efficiency and modularity may be related, I think you may be confusing the topics. You may also be using Big-O in a few places where Big-Theta, or just the time complexity function itself is desired.

Am I being picky? Yes, I am. But if you're looking "for anything to be highly formalized" (your words), this is an area that is. O(n) has a specific meaning and it should be used correctly if formalization is the goal.