Hacker News new | ask | show | jobs
by ratww 1790 days ago
Software Engineering more of a craft. The only way to learn is by continuously practicing, collaborating with others and studying other people's code deeply.

Design Patterns are not a catalog of recipes that you can use to put together a functioning system. They are instead an attempt at creating a "common language" of sorts for some common concepts. They don't really teach you anything about good software: they only allow experienced people to communicate well. The authors themselves have stated: "design patterns are descriptive, not prescriptive".

What one has to learn, instead, is the foundational knowledge that was used for building those "patterns and guidelines", and even for other things like SOLID. And dare I say and even functional programming, OOP and procedural programming itself. For example:

    • Why you don't want tight coupling (foundation of lots of patterns and architectures)
    • How to make program state predictable and why it's important (foundation of both OOP and FP, including encapsulation and immutability. And also of some patterns like CQRS)
    • How to design good interfaces/APIs on all levels (functions, classes, modules, libraries, services, programs, companies)
    • How to understand the cost of hidden dependencies (not talking about libraries, more like "functions that call other functions" or "classes that depend on other classes". This is Joe Armstrong's banana-gorilla-jungle problem)
    • How to make functions/classes/modules that you can change without requiring cascading code changes in the rest of the program (again this has to do with coupling)
    • How to make programs predictable in general (the most important business wise)
1 comments

So you’re saying because software is a „craft” you can’t write down ideas how to do it better? Your bullet points are exactly this. The only thing that makes them different from „patterns” is you didn’t give them a name.
I never said anything of the sort. You asked how one learns and I answered: not with patterns or recipes, but rather with practice and observation. Even if you memorise dozens of recipes you still ain't a chef. To be a chef you need to know how to prepare, combine, modify and even come up with those recipes. My bullet points are not patterns or guidelines you should follow. They are examples of the foundational knowledge you need to "come up with the recipes".
Parent describes the experience and understanding of why certain methods of building software work better than others. A pattern, on the other hand, is more like a recipe that can be followed without knowing whether it is actually appropriate for solving a particular problem.
Not the OP, but no. Those are concepts that are important that need to be understood through experience and applied judiciously wherever they help (which is lots of places) but never by rote and not where an alternate approach is better.

That's quite distinct from design patterns, which are usually taken as gospel that needs to be followed for its own sake.

My karate sensei used to say that while all kyu ranks must follow the katas with extreme precision, the higher dan blackbelts have absorbed the knowledge and can ignore and innovate.

In that sense design patterns are like katas. Training wheels, but not an end-goal.

They are guidelines, not prescriptions. Guidelines can be violated when the need calls for it. Almost no rule is universal.