| ▲ | hyfgfh 2 days ago | |||||||||||||||||||||||||
Agreed! The problem is that some 'seniors' never cared to learn patterns in the first place. That’s a huge problem for frontend, where we have increasingly complex architectures and people with very little experience with design. Even some principles aren't known. I always recommend the book Head First: Design Patterns. It's in Java, but the lessons can be applied in every language. Unfortunately, we are in a 'post-knowledge' era... I don't know how we can keep things up at this pace. | ||||||||||||||||||||||||||
| ▲ | davidkunz 2 days ago | parent | next [-] | |||||||||||||||||||||||||
> It's in Java, but the lessons can be applied in every language. I can only discourage anyone from applying Java patterns all over the place. One example in JavaScript: There was a functionality that required some parameters with default values. The plain solution would have been:
Instead, they created a class with private properties and used the builder pattern to set them. Totally unnecessary. | ||||||||||||||||||||||||||
| ▲ | Kwpolska 2 days ago | parent | prev | next [-] | |||||||||||||||||||||||||
I've read that book, and it felt very childish and condescending. Design patterns cannot be applied in every language. While some patterns are applicable everywhere, many of them provide replacements for missing language features. For example, the Builder pattern is not very useful in languages with default parameters and named arguments. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ▲ | prodigycorp 2 days ago | parent | prev | next [-] | |||||||||||||||||||||||||
What's interesting about frontend is that there are two ways to evaluate it: by how it looks and how it's written. It definitely biases how people evaluate llms. Many cite Claude as their favorite llm for generating frontend code, but I suspect that many people prefer it because the output is prettier, rather than better composed. | ||||||||||||||||||||||||||
| ▲ | signal11 2 days ago | parent | prev [-] | |||||||||||||||||||||||||
Design patterns are language independent, but a lot of the ones many Java devs focus on are a bit meh. In a world with only assembly language, for instance, it’s a bit like making a big deal about a “guarded repetition” pattern (aka a while loop). Eg in Lisps, a lot of patterns become one-liners. At that point these patterns become a “can you write decent Lisp” question[1]. | ||||||||||||||||||||||||||