Live data from Hacker News

How to build a large Angular.js application

gocardless.com

1–10 of 53 posts

Re: How to build a large Angular.js application

#6

Can anyone comment from experience on the testability of Angular.js, that is mentioned in the article? Was it a reason to chose Angular.js over some other framework (if so, which framework)?

We specifically looked at CanJS, Backbone and EmberJS. None of which have testability as a core feature. CanJS and Backbone barely mention how to do it, EmberJS has one tiny page on integration testing. Which practically means there isn't a established right way to do testing. And you as a developer need to figure it all out.

Ember are improving this however, with the ember-testing package: https://github.com/emberjs/ember.js/tree/master/packages/emb... Backbone has countless tutorials on how to test, but it's not built into the framework.

Re: How to build a large Angular.js application

#7
post #2

> The core app is 9K lines of code. I don't think 9K is "large" for an application. At all.

I'm not sure what you're comparing this to but 9,000 lines of well-written code in a powerful MVC framework is a very significant size.

Because there is so little boiler-plate code that is being written, the utility-density of such a codebase can be extraordinarily high. 9,000 lines of PHP could amount to very little utility but when well-architected, there is a crazy amount that can be done with even 2,000 lines of a framework such as Angular or Rails.

[EDIT]

The point I'm making is that a good developer working in harmony with a framework can do in 4 very readable lines what a less experienced developer might easily expand to 60 lines. As such dismissing a 15k codebase as "small" is somewhat naive. A 15k Angular app can do a vast amount.

My experience with Rails (and my limited experience with Angular suggests it's similar) is that working harmoniously with the framework gives you massive amounts of utility with very, very few lines of code. I've personally refactored 100 line controllers from junior developers down to 12 lines. It might feel macho to compare codebase sizes but there's no strong coupling to utility (arguably perhaps the reverse).

You can certainly write 60k apps in Rails, Angular or Django but dismissing a 15k app as "small" doesn't do justice to the utility that even such a "small" codebase can deliver.

...sorry this comment was so long I didn't have time to write a short one ;)

Re: How to build a large Angular.js application

#8
post #2

> The core app is 9K lines of code. I don't think 9K is "large" for an application. At all.

I'm not sure what you're comparing this to but 9,000 lines of well-written code in a powerful MVC framework is a very significant size. Because there is so little boiler-plate code that is being written, the utility-density of such a codebase can be extraordinarily high. 9,000 lines of PHP could amount to very little utility but when well-architected, there is a crazy amount that can be done with even 2,000 lines of…

Example: I'm working on a "large" CakePHP application (similar to Rails) with 24,000 lines of our own code, 57,000 lines of code from community plugins, and 240,000 lines of core framework code.

Re: How to build a large Angular.js application

#9

Can anyone comment from experience on the testability of Angular.js, that is mentioned in the article? Was it a reason to chose Angular.js over some other framework (if so, which framework)?

We specifically looked at CanJS, Backbone and EmberJS. None of which have testability as a core feature. CanJS and Backbone barely mention how to do it, EmberJS has one tiny page on integration testing. Which practically means there isn't a established right way to do testing. And you as a developer need to figure it all out. Ember are improving this however, with the ember-testing package: https://github.com/emberjs…

I personally think ember has the best testability story for both unit and integration testing. The screencast below shows how to get started with ember / QUnit and karma

http://toranbillups.com/blog/archive/2013/07/21/Integration-...

Post reply on HN