5 ms·
This isn't so much praise for angular as it is for establishing app structure conventions, something that has been around for a long time before angular and has
by jenius 13y ago
This isn't so much praise for angular as it is for establishing app structure conventions, something that has been around for a long time before angular and has nothing to do with angular itself. Rails is another example of a framework that imposes a specific file/folder structure on all developers which increases consistency across apps (and also coincidentally is quite popular and remained "the hotness" for quite a while in the startup world).
That being said, as I've spent more time programming, I've shifted my preference towards frameworks that don't impose specific structures on you. This is mostly because forcing one structure gives you little flexibility or wiggle room if that structure doesn't fit great with your app, which you can already see other comments here pointing out. If you are working on a project with a team, all you need to do is meet before the project starts and decide on an organizational structure that you are going to use to gain the same results with any framework (and as another comment mentioned, also being able to avoid the fact that angular shoves way way too much logic into the html where it absolutely does not belong, and will quickly get out of hand in larger and/or more complex apps).
- al2o3cr 13y ago"If you are working on a project with a team, all you need to do is meet before the project starts and decide on an organizational structure that you are going to use to gain the same results with any framework" If the next step after "decide on a structure" isn't "WRITE IT DOWN", the maintenance devs who follow after you are going to curse your name.
- marknutter 13y agoAngular most certainly does not establish any app structure conventions. You're thinking of Ember. Angular does, however, enforce other conventions such as modularity and separation of concerns with its dependency injection and directive-based approach to DOM manipulation. That's a very important distinction to make. It strikes the right balance between convention and configuration, IMO.
- GeneralMayhem 13y ago>modularity You've got to be joking. An Angular "module" is a chunk of code that happens to be given a collective name. There's no namespacing, no encapsulation, and no build/file management.
- lowboy 13y agoI'd say the Angular approach is definitely modular in the context of current javascript. Perhaps you're thinking of another language's definition of modular?
- gedrap 13y agoI agree with you. The first thing that comes to my mind when thinking of modularity and ng, is directives.
- GeneralMayhem 13y agoYou cannot use two modules that have directives with the same name. Even if you never use them directly, they're only ever dropped in by controller templates as part of what that module does. When "modules" can break each other because of purely internal implementation details, there is something very wrong.
- lowboy 13y agoHuh, I've never come across that before. Yeah, that is a problem, and one that I hope they address soon. Fortunately a workaround exists in the form of naming conventions, tedious as that may be. So the Angular approach is modular, but slightly broken.
- GeneralMayhem 13y agoNaming conventions are a workaround in the same way that "remember to free your pointers" is a workaround for the lack of memory management in C, except that managing your own names has no performance benefit. I really think the whole idea of a global name-based registry is flawed. Again, look at more traditional library/class-based language like Java, C#, and C++ - they have to go to absurd levels of verbosity, and don't even get absolutely guaranteed uniqueness out of it, but the power of dynamic linking makes it worthwhile.