3 ms·
> [...] but at one point in time people might have said the same about functions, [...] I really like your example, because it nicely highlights how much of a
by btschaegg 8y ago
> [...] but at one point in time people might have said the same about functions, [...]
I really like your example, because it nicely highlights how much of a tooling problem this really is.
To call a subroutine, you'll have to arrange your argument values on the stack, then do the call instruction, after which your target procedure pushes the return address to the stack...
Except that almost no one does it this way anymore. I usually never think about all this stuff when I call `foo()`.
Writing a macro in C/C++ is the equivalent of doing the whole legwork to call functions yourself.
What I find really surprising, though, is that we haven't ever arrived at the point where we think that "most programmers can't be trusted with arbitrary mutability". It's everywhere, and since the C/C++ days, it got worse with many languages. I absolutely hate the house-of-cards code I regularly deal with in C# because people would have to write a couple of additional lines to encapsulate the internal state of their types properly. So instead, you get mutable public members or properties everywhere... * sigh *.