Live data from Hacker News

How to build a large Angular.js application

gocardless.com

11–20 of 53 posts

Re: How to build a large Angular.js application

#11
post #8

Earlier quoted context omitted.

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.

I am the sole maintainer of a framework free PHP codebase with ~100K lines. Who's jealous?

It could probably be rewritten down to about 10-20K lines (maybe less) if I had a spare month or two.

Re: How to build a large Angular.js application

#12
post #8

Earlier quoted context omitted.

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.

It would be 2-10 times less lines of code on Django (and also on Rails). Lines of code comparisons do not scale between programming languages.

Re: How to build a large Angular.js application

#13

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)?

Angular enables testability by design. This is one of the better written tutorials on how to approach it:

http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-...

Re: How to build a large Angular.js application

#14
post #2

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

The small team I am on just re-wrote a number of different apps written by 3rd parties that were 20/30k and got them down to ~3k -- mainly by throwing out all their library junk and just doing things right in AngularJS.

Re: How to build a large Angular.js application

#15
post #2

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

Our largest Angular app currently has a 2500 line controllers.js file. There are about 20 controllers in this file. I've thought about splitting it up into multiple files, and I think I'm going to do that.

However, right now it works quite well since I'm using "editor folds" to separate each controller.

Re: How to build a large Angular.js application

#17
Would be interesting to hear if you discovered any downsides to Angular. I've been working with it a lot lately, but it seems to be a really good solution and the only issues with it is it can be hard to set up to be compatible with googlebot and the slightly tough learning curve

Re: How to build a large Angular.js application

#18

What are some large AngularJS projects that have been launched? I could only find Google DoubleClick and YouTube's PS3 interface. http://builtwith.angularjs.org/ Not to downplay the Ermahgerd Translator! http://ermahgerd.jmillerdesign.com/#!/translate

http://www.ribbon.co uses Angular both for checkouts and creating/editing products.

Disclaimer: I worked with them implementing that.

Re: How to build a large Angular.js application

#19

What are some large AngularJS projects that have been launched? I could only find Google DoubleClick and YouTube's PS3 interface. http://builtwith.angularjs.org/ Not to downplay the Ermahgerd Translator! http://ermahgerd.jmillerdesign.com/#!/translate

We launched https://starthq.com, not sure if it qualifies as large though as its currently at 2KLOC of JS for the front end code.

Re: How to build a large Angular.js application

#20
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…

Much of Angular's power comes from its declarative syntax. Much of the time, you set down what you want to happen, and not how.

The problem is, it's not always obvious what "the Angular way" is, but on the plus side, I've just thought of a title for a series of blog posts...

Post reply on HN