patterns

A 12-post collection

Step Back and Ask Why

Solving deep technical problems is fun. But by taking a step back and examining how we got here can be just as fun and useful. We pride ourselves on our technical abilities. But an even more important skill we can have is not technical, it is a pragmatic skill: we can ask "why?". Why is such a simple word but it helps us evaluate how we got this our current point. What decisions did we make? What influenced us? Has any of the information changed since then? Did we miss a perspective or an option? I find that this skill, when used with empathy, respect, and patience, proves its value repeatedly. The value is in uncovering new options or in...


Angular Function Declarations, Function Expressions, and Readable Code

We spend more time reading our code than writing it. That's why it makes sense to write code that is easier to read. The good news is that there are a lot of really simple things that can make your code much more readable. This post describes simple techniques to make AngularJS controllers and services/factories more readable. For more details on these and other Angular coding styles, please see my Angular Style Guide and my upcoming Pluralsight course "AngularJS Patterns: Clean Code" (Sep 2014). Quiz OK, first let's take a step back and start with a quiz. See if you can get the answers to these correctly. Indulge me, there is a point...


Angular Style Guide

I just published the first draft of my opinionated style guide for syntax, conventions, and structuring AngularJS applications. You'll find many of these and more explained in deeper detail in my Pluralsight course AngularJS: Clean Code (coming in August 2014). The styles contained here are based on on my experience with AngularJS, presentations, Pluralsight training courses and working in teams. I will keep this guide updated on github. Usage and Purpose I get asked a lot for style guides, how to get started once you learn the AngularJS basics, and what I recommend. This guide helps point in that direction using my guidelines. The purpose of this style guide is to provide guidance on building AngularJS applications by...


Building Large Scale Apps with Angular and Breeze

Angular. Breeze. JavaScript and HTML5. These buzzwords have been getting a lot of air play over the past year. There are plenty of examples to introduce you to these technologies but how do you apply these to larger apps at your workplace? This is where I find an end to end tutorial and demonstration can really help. One place you can look for a practical implementation is Pluralsight, where they recently published both Part 1 an Part 2 of my Building Apps with Angular and Breeze courses. These courses intend to serve as a guide to take you from zero to hero to build an app from a blank canvas. Along the way I share my thought process on what...


Do You Like Your Angular Controllers with or without Sugar?

Even if you've only read about Angular, the odds are you've seen the rampant use of $scope in the C of MVC (controllers). $scope is the glue between the Controller and the View that helps with all of our data binding needs. Recently the Angular team opened up a new way to use $scope with Controllers. So now you can use $scope (what I'll refer to as Classic Controllers) and you can use this (what the Angular team and I refer to as Controller As). I hear a lot of questions about these 2 techniques. Everyone loves choice, but at the same time, most folks like to know clearly what they are getting or...