Hacker News new | ask | show | jobs
by Asooka 2963 days ago
Where/how does one learn to structure programs like this? Obviously I won't write fizzbuzz like this, but the point is it won't occur to me to structure a fizzbuzz solution like this. And if I can't produce such a structure for the dead simple case, then I can't trust myself to be able to architect an actual complex system where one does need to apply all these abstractions.

Are these skills only attainable from years of real-world experience?

4 comments

people loves enterprise architecture jokes but all starts with some questions: what if I need to use the client datasource for the input numbers? what if a client ask to send the output to a network endpoint? to a printer?

so you start decoupling things. this here is played for fun, but if you need to build something that lasts 10 years across a multitude of clients instead of just as an one off project those question starts to be legitimate.

You should first learn about design patterns and then read Patterns of Enterprise Architecture by Martin Fowler. The book basically outlines how to think like this.
Just research SOLID and IOC and practice these in combination with a Java or C# or other OOP-inspired language. That will get you pretty close.
Effective Java is the best book I've read on the subject.