|
|
|
|
|
by lostcolony
1963 days ago
|
|
How do you manage to not have global objects? FP and imperative handle data without huge amounts of global state the same way. By structuring your code properly. Per your example, your Client instance still has to be passed around everywhere it's needed, and you call client.push_data() on it; in FP or imperative approaches, you would pass around a Client struct or tuple or similar, and call push_data(client). OO just bundles state and functions together, as fields and methods on an object. Which has its pros, and its cons. |
|
Yes, because our program probably needs more than one Client.