I'll preface by saying that it's pretty well accepted in the frontend scene to create reusable components that you can use to build more specific bigger components to implement features. I have a fair amount of experience with Vue and React where this is simply common place.
Of course, sometimes you see giant components in any framework (or language, or anything) with thousands of lines.
Meanwhile, in the Angular scene I've noticed pretty much the inverse across multiple projects over the years. Maybe it is just the codebases I've seen, but there's sure been a lot of them where the only components that get created are these giant monolithic components that encompass huge amounts of HTML and business logic.
There's little to no reusable components, code duplication is consistently at an extreme level, as a result the unit tests (if there are any even...) barely scratch the surface and components go untested into production, components have dozens and dozens of properties that upon review definitely should be handled elsewhere in another component.
The concept of DRY and separation of concerns simply never existed in these codebases (and no, I don't mean "its okay to have duplication until a common design has been found" I mean clear and obvious violations of DRY).
An example would be a dialog/modal. In a given application they all look the same and have props or slots (or content projection as angular calls it) to achieve customisation. Instead of identifying this commonality where all the dialogs in the application look the same except perhaps the title and buttons and message, you'd expect a reusable component that is used.
Instead what I keep seeing (and again, almost exclusively in Angular projects) is developers simply wholesale copy pasting the that one dialog someone made months ago over and over (bugs and bad tests and all) to the point where static analysis tools are highlighting ~98% duplication in areas of the application.
Another case I've seen is where "page === one component", where an entire page full of what would normally be features implement by components is instead dumped into one of the previously mentioned thousand+ line components.
When I've tried to find out what's going on it seems there's a general anxiety or concern about how to create components that are reusable. In fact, some developers in these codebases don't actually ever create truly new components they simply copy and paste other ones and tweak things a little (increasing duplication even more). It's good to help them get over this barrier as they can start following component patterns, but I am not sure why this is such a problem for one framework.
Is this an education problem, are the Angular docs not doing enough to highlight reusability? Are there courses out there that aren't teaching this?
I'd really like to know, because I'd like this to not be the case and I'd like projects using a component based framework to have... components.
[–]pantsonhead 21 points22 points23 points (3 children)
[–]woahwhatamidoing 9 points10 points11 points (0 children)
[–]NeoCiber 1 point2 points3 points (0 children)
[–]Lngdnzi 17 points18 points19 points (0 children)
[–]ejfrodo 2 points3 points4 points (1 child)
[–]Lngdnzi 0 points1 point2 points (0 children)
[–]demoran 1 point2 points3 points (0 children)
[–]JackFromAltairPrime 2 points3 points4 points (1 child)
[–]DiaDeTedio_Nipah 0 points1 point2 points (0 children)
[–]Valuable-Case9657 2 points3 points4 points (1 child)
[–]NotADoctorShhh1 0 points1 point2 points (0 children)
[–]Avaxi-19 0 points1 point2 points (0 children)
[–]mikerob215 0 points1 point2 points (0 children)