Software LEGO® Blocks
(Slight Return)
Q1: Why can't we plug software modules together like LEGO® blocks?
A: Because software is too complicated.
Q2: Why is software too complicated?
A: Because we can't plug software modules together like LEGO® blocks.
Q3: Why can't we plug software modules together?
A: Because the interfaces are way too complicated.
Q4: Why are interfaces too complicated?
A: Because libraries and APIs have hidden dependencies.
Q5: Why do libraries and APIs have hidden dependencies.
A: Because we use languages that hide dependencies.
Q6: What kind of dependencies are hidden by languages?
A: For one example, function calling is often implemented by using subroutines. The subroutine CALL and RETURN instructions leave breadcrumbs on stacks, forming dynamic dependency chains.
Q7: Why does CALL/RETURN leave breadcrumbs on the stack?
A: RETURN needs to follow the breadcrumbs back to the caller.
Q8: What happens when a CALLed subroutine calls another subroutine?
A: The callee becomes a caller and pushes another breadcrumb onto the call-stack.
Q9: Why is a stack used? Why not just use a "register"?
A: Stacks are used so that previously laid breadcrumbs are not over-written. If we didn't have an automatic stack mechanism to save our breadcrumbs, we'd have to save them manually in some sort of list.
Q10: Is the stack of breadcrumbs a dynamic data structure?
A: Yes.
Q11: Is the stack of breadcrumbs a dependency chain?
A: Yes:
Q12: Is the stack not just a list?
A: Yes, but it is an optimized list.
Q13: Why is it necessary to optimize lists to make stacks?
A: Because we need to optimize memory usage.
Q14: Why do we need to optimize memory usage?
A: Because memory is expensive
Q15: Why is memory expensive?
A: Memory used to be expensive in the 1950's.
Q16: Is memory still expensive in 2025?
A: No.
Q17: Why do we use techniques to optimize memory usage, when memory is no longer expensive?
A: Uh, because we've always done it that way.
Q18: Did we notice that the ground truth has shifted? Memory used to be expensive, but is no longer expensive?
A: Uh, no, we didn't notice.
Q19: Why didn't we notice?
A: Uh, because we believe in building on the shoulders of others.
Q20: Are we in the weeds?
A: Yes.
Acknowledgement
5 Whys approach suggested by Daniel Pink in Masterclass.
[This article was previously published on my old blog].
See Also
Email: ptcomputingsimplicity@gmail.com
References: https://guitarvydas.github.io/2024/01/06/References.html
Blog: guitarvydas.github.io
Videos: https://www.youtube.com/@programmingsimplicity2980
Discord: https://discord.gg/65YZUh6Jpq
Leanpub: [WIP] https://leanpub.com/u/paul-tarvydas
Gumroad: tarvydas.gumroad.com
Twitter: @paul_tarvydas
Substack: paultarvydas.substack.com

