Angular with Style

[Update March 24, 2016 - I've gone through and updated my opinions based on what I see on this day.]

When it comes to starting a new application, there is always a need to go looking for some sanity. I like to install a system that balances out several key components. Here's my general thought process.

  1. Why write code if you have to? Use a generator to generate snippets of code and a consistent structure. Here are my first choices:
    • generator-ng-poly - This yeoman generator uses a good mixture of opinionated styles and also helps developers maintain their sanity. It is the most complete generator I've found.
    • generator-cg-angular - This generator is great for quick and dirty prototyping. I've become less familiar with this one, but it seems to maintain pretty well.
  2. In the earlier days of development, I was often scratching my head on the best way to do things; then I found Todd Motto's Style Guide and fell in love. John Papa's Style Guide seems to have adopted most of Todd Motto's guide in what may have been a merge. On the naming convention in John Papa, I remove the type from the name and use the module-type structure
  3. Pick Bootstrap or Angular Material very early in the project. Bootstrap has been around for a long time, so it's easier to deal with. Material by Google looks Android and will be familiar to most Google users. Both are very competent. There are others, but I won't touch those here.
    • Angular Bootstrap (ui-bootstrap) is helpful. I tried Angular Strap, but was put off by an early bug using Angular 1.4; I left it alone
    • Angular Material is growing and has tons of features and driven by the core angular project, it usually loses to Bootstrap; though it is a very close 2nd right now. I would suggest taking a serious look at using Material in your next application. Their components and UX practices are clearly a notch above the competition (they give us a good wheel)
  4. Get comfortable extracting the things you do often into dependencies that you can inject with package managers. We (as developers) often write the same code 300 times in our career so try to write components/modular styles and import across projects if possible

Once you've picked a direction for your project, even if you're uncomfortable, try to stick to your guns and realize why these styles, generators and frameworks are done the way they are. As your project grows, you will realize that someone's been there and done that... If they've put it out there, then learn from their mistakes. If you run into some serious issues, check out how I feel about solving problems.

  1. Become an expert at google. Often searching for the proper tool is more an art of how to phrase your query
  2. If you have an issue or error, post a well formed and specific question to Stack Overflow; user proper tags and remember to be more descriptive
  3. For general questions, try IIRC or mailing groups. These are great to get insight from people that are well versed in their subject matter; An emergent alternative to IIRC is gitter, where developers go to talk
  4. Finally, if there are no other outlets or you find a bug, post to their issue tracking system (usually on Github). Follow their guidelines so they can help you appropriately. Don't be vague, reproduce the issue on a clean copy of the latest source and remember you can't give them too much detail

That's all folks. This is a good start. Go build amazing things!