12

While evaluating AngularJS for a project, I noticed the following paragraph in its documentation:

Games, and GUI editors are examples of very intensive and tricky DOM manipulation. These kinds of apps are different from CRUD apps, and as a result are not a good fit for Angular. In these cases using something closer to bare metal such as jQuery may be a better fit.

But the docs continue without really explaining why this is so. In order to make an informed decision about what technology we use for our project, I'd like to better understand where this statement comes from and what facts are behind it.

What specific problems would hamper someone trying to build eg an illustration tool, or a video editing suite, in AngularJS?

Crashworks
  • 40,496
  • 12
  • 101
  • 170
  • There is more overhead in a higher-level framework, and in a game or other performance-intensive application you want very low overhead. Pretty simple. You could substitute any two high/low level technologies: "... not a good fit for Java. In these cases using something closer to bare metal such as C may be a better fit". – user229044 Jul 24 '13 at 19:06
  • I think means that AngularJS is a framework that does not fit well into non-CRUD stuff like GUI editors -- you get all the crap, but none (or only some) of the benefits. – jsalonen Jul 24 '13 at 19:06
  • @jsalonen Yes, but specifically why? What crap in particular gets in the way? – Crashworks Jul 24 '13 at 19:17
  • Framework conventions and rules. Also: can you spot any feetures in AngularJS that would be particularly useful for games or GUI editors? – jsalonen Jul 24 '13 at 19:19
  • I think this is already said in the paragraph, angular performance is very poor even [admitted by its creator](http://stackoverflow.com/questions/9682092/databinding-in-angularjs) and can only get away with that in crud applications because they are very interaction limited. – Esailija Jul 24 '13 at 19:32
  • I'm looking into Angular right now for possible use in a couple projects. It appears to me that it is geared towards business applications which want to streamline the movement of data to UI and back again through databinding and templates. That isn't normally something you do within games, but something you do within forms. I don't know if angular has anything re dealing with canvases, which I would assume is something that is in the realm of html5 game designers. But then, again, I'm only just looking into it recently. –  Jul 24 '13 at 19:34
  • This question is perfect for Programmers.SE. – Jim G. Jul 25 '13 at 13:47
  • 1
    @JimG. I was going to post there, but found that the quality of Angular questions and answers was better on SO. Also, Programmers would be good for reasoned opinions about the design of UI frameworks generally, but I'm really more concerned with specific use cases and code examples of one particular application. – Crashworks Jul 26 '13 at 02:29

2 Answers2

6

This is a good question. Angular provides great declarative facilities for your run-of-the-mill web page work. To do this it relies on a watchers and constantly checks for changes on watched properties, then updates the UI with changes. The FAQ claims this process is "snappy" with hundreds or thousands of bindings which is good enough for most uses. Games and GUI editors can have complex interfaces with frequent or constant user interaction, so constantly re-evaluating a huge collection of watchers may not be the most performance-conscious way of doing things. Contrast this to a site like Stack Overflow where a user only clicks/presses something every few seconds and cause a re-eval of the watch list. Using a more imperative approach and library(jQuery et al) would cause less overhead.

Hippocrates
  • 2,510
  • 1
  • 19
  • 35
4

Angular has a few limits that come into play here.

First, ng-view doesn't support nested views. So that limits more complex UI design.

Next a "GUI Editor" is usually built around the concept of widgets and dialogs. Angular is built around very different concepts. You can simulate widgets with directives somewhat. But it will feel like you're fighting Angular the whole time.

Basically nested scopes, isolate scopes, and declarative data binding aren't common paradigms for complex GUI work.

wmil
  • 3,179
  • 2
  • 21
  • 24