Live data from Hacker News

AngularJS Style Guide

gocardless.com

21–30 of 41 posts

Re: AngularJS Style Guide

#21
Anyone have experience one way or the other with the pattern of including test files with the features as opposed to under an alternate directory structure? I usually put tests and application code in parallel directories so that the tests are all in one place, but curious if anyone has seen big advantages one way or the other

Re: AngularJS Style Guide

#23
post #21

Anyone have experience one way or the other with the pattern of including test files with the features as opposed to under an alternate directory structure? I usually put tests and application code in parallel directories so that the tests are all in one place, but curious if anyone has seen big advantages one way or the other

I organise things the way you mentioned and was thinking this too. My app's starting to grow now and I think bundling tests, templates and the implementation in a single folder makes sense.

Normally if I'm working on eg a directive I jump across all of it's files, so having them in a single folder makes it much easier.

From a grunt/karma POV, it should be easy to flag specs as: \*.spec.js

Re: AngularJS Style Guide

#24
A minor nit, the TL;DR is just an outline. I was hoping for a simple statement of the problem with a conclusion and the rest of the article would present the details, more of a real overview or synopsis.

Re: AngularJS Style Guide

#25

A minor nit, the TL;DR is just an outline. I was hoping for a simple statement of the problem with a conclusion and the rest of the article would present the details, more of a real overview or synopsis.

> We would, for example, pick verbose over DRY if that results in code that’s easier to read and change. We have found that inheritance and mixins make change especially hard.

I disagree. We have a mixin heavy product (about 100k LOC) and the mixins, if designed judiciously, help ensure that we have good reuse of code. So I'd like to see some examples to support the case of "verbose over DRY", I haven't yet found that to be a "good thing(tm)", but some concrete examples could help.

Re: AngularJS Style Guide

#26
I'm coming back to JS development after several years away and my first impressions of Angular are that it seems very complicated and over-engineered, with a lot of fairly abstract concepts to digest to get even simple things working. React.js seems so much simpler but there does seem to be a lot of community support for Angular.

Should I invest the time and learn Angular or go with React instead? Web components seem likely to change the whole web development landscape but my impression is that they're not quite ready for prime time yet.

Re: AngularJS Style Guide

#27

I'm coming back to JS development after several years away and my first impressions of Angular are that it seems very complicated and over-engineered, with a lot of fairly abstract concepts to digest to get even simple things working. React.js seems so much simpler but there does seem to be a lot of community support for Angular. Should I invest the time and learn Angular or go with React instead? Web components seem…

I had the pleasure of using Knockout.js on a recent project. It's so much simpler than Angular and a real pleasure to use.

It doesn't provide a complete opinionated framework like Angular. You have to pair it with the right 3rd party components to get a full SPA kit, but I like that better. I don't always need a full SPA either.

Re: AngularJS Style Guide

#28

I'm coming back to JS development after several years away and my first impressions of Angular are that it seems very complicated and over-engineered, with a lot of fairly abstract concepts to digest to get even simple things working. React.js seems so much simpler but there does seem to be a lot of community support for Angular. Should I invest the time and learn Angular or go with React instead? Web components seem…

| Angular ... seems very complicated

Having recently picked up Angular, I can perhaps comment on this. Once you're past a few questions of where to put what, development with Angular is fairly straightforward. If you've dealt with two-way data binding before, it's even simpler.

I suspect you should be able to pick it up to a reasonable degree (one where you can decide if you'd like to stick with it) within a week or two at most, even in your spare time. In retrospect, I'm not sure I'd call it complicated any more.

Re: AngularJS Style Guide

#29

I'm coming back to JS development after several years away and my first impressions of Angular are that it seems very complicated and over-engineered, with a lot of fairly abstract concepts to digest to get even simple things working. React.js seems so much simpler but there does seem to be a lot of community support for Angular. Should I invest the time and learn Angular or go with React instead? Web components seem…

| Angular ... seems very complicated Having recently picked up Angular, I can perhaps comment on this. Once you're past a few questions of where to put what, development with Angular is fairly straightforward. If you've dealt with two-way data binding before, it's even simpler. I suspect you should be able to pick it up to a reasonable degree (one where you can decide if you'd like to stick with it) within a week or…

That's reassuring. I look at some of the code examples and all the $vars and it looks very obscure. I guess the forthcoming 2.0 version is supposed to simplify things a lot and make it play nicely with web components though so maybe it's worth getting on board now.

Re: AngularJS Style Guide

#30

Earlier quoted context omitted.

| Angular ... seems very complicated Having recently picked up Angular, I can perhaps comment on this. Once you're past a few questions of where to put what, development with Angular is fairly straightforward. If you've dealt with two-way data binding before, it's even simpler. I suspect you should be able to pick it up to a reasonable degree (one where you can decide if you'd like to stick with it) within a week or…

That's reassuring. I look at some of the code examples and all the $vars and it looks very obscure. I guess the forthcoming 2.0 version is supposed to simplify things a lot and make it play nicely with web components though so maybe it's worth getting on board now.

To contrast with what the OP said, I found Angular pretty cool at the beginning but got more and more annoyed as I progressed. If you're okay with interacting with a black box, go for it otherwise choose react.
Post reply on HN