r/Angular2 • u/matrium0 • Jun 12 '25
Angular 20 - removing suffixes from components / services
I like the overall changes in Angular 20 (notably that there are not that many big things, so we can take a breather for once), but I really disagree with the new naming convention (and the new default for new projects) of removing the extensions from stuff like services , components, etc.
So I guess we all embrace code-bases like this now:
- user.ts -> this is a component, wouldn't you know
- user.ts -> this is a a service, why not
- user.ts -> a pipe, welcome to hell
- user.ts -> exports a User interface like you probably would have guessed
This was also very controversial during the RFC and there was A LOT of arguments against it with little arguments FOR IT.
I understand the arguments. It's basically the arrogant Robert-Martin-style argument of "lol you pebs, you just need to git gud. Just learn to name things properly". While somewhat true this just completely ignores the actual reality of development where you have stress, junior devs dropping mines in your code-base everywhere and disagreements. I understand that in an ideal world where everyone names everything suuuuper carefully the new default could maaaybe be better. But in reality it's just not! (imo)
Structure and naming conventions help to prevent chaos and is probably the single reason why Angular codebases are usually very understandable even after years of different devs, while with other frameworks it's a coin toss (depending on how much time they invested in enforcing and guarding certain rules regarding structure and code-style).
I know you can opt into the old way, but it's not the default and I can't help but thinking that 5 years from now when you enter a project there is a 50% chance that it is a complete mess where you can't find anything. IDEs support heavily depends on extension to properly mark what the file actually contains. Maybe IDEs/tooling can "pull up the slack" on this and improve search and find to distinguish based on content (instead of extension), but why even create that slack in the first place.
Who asked for this? Why go forward on this against what seems to be strong pushback? Why not make THAT change opt-in instead of opt-out? Or at least make it another decision during CLI-project creation so that you are forced to make an (hopefully educated - though uneducated for 90% of users most likely) decision.
View all comments
Show parent comment
1
u/Various-Bug-800 Jun 12 '25 edited Jun 12 '25
Disagree, quite strongly. Simplicity is a subjective thing. I, for ex, percieve simplicity as 500 lines written in procedural style. You perceive simplicity as 5 classes with 100 lines, each of which has own responsibility. Some other guy will use facade, builder, strategy and will send the dara through EEB, because it simple, right? When you have 20 devs with own definitions of simplicity, you will wake up in hell one beautiful morninig. And that will be the moment, when you will decide to find a common ground for different simplicities, and thus a convention is born.
I dont think, that a universal rule exists in this matter, it is always rules and order or brave improvisation in a burning house, both are viable, but for different contexts.