• You are here:
  • Home »
  • Archive: February, 2017

Archive Monthly Archives: February 2017

Debugging Angular Apps with Augury

I recently went on a hunt for Angular (formerly known as Angular 2)  profiling tools.  Angular is a fantastic framework, but the component hierarchies can get a little crazy. Fortunately, there’s a way to tame the complexity. After some Google searching, I came across Augury. Augury is a debugging and profiling tool created by Google and Rangle.io.

Augury is simple to install. First, install the Augury Chrome Extension (Sorry Firefox lovers, no soup for you.) There is no step 2.

Once installed, Augury shows up as a new tab in your Chrome Developer Tools. If you have an Angular app running in debug mode (it doesn’t work on prod mode), the tab will show several visualizations of your application. The first one is the component tree, which lays out the components for whatever page you are on. Click a component to see the properties and events for it. You can also manipulate the underlying models and trigger events. Additionally, each component is has a link to its source code. If you want to set a breakpoint, just click and you’ll be right there.

 

You can also get a visualization of injected services by clicking on the Injector Graph. It’ll help you figure out where your dependencies come from.

 

If your application is using routing, click on the routing tree tab to get a visualization of the routing structure.You can click into the routes to see what url triggers them, along with other route information. If you happen to use lazy loading, those routes are marked as “lazy loaded” until you access them.

If you want to see a breakdown of your application’s module structure, click the NgModules tab. This is a good way to get a high level overview of your application.

 

Overall, Augury makes it easier to reason about your Angular applications. By visualizing the component trees, routing, and module structures, you get a high level overview of your application’s structure. Additionally, the extra debugging features add a layer of easy to the already fantastic Chrome Developer tools. I’ve added this to my day-to-day Angular tool belt and urge you to do the same.

More Information

Augury Home

Augury Guide

To Win At Work: Be A Jack of All Trades, Master of One

Want to double your chances for success? Learn something new. Diversify yourself.
 
The idea of diversifying yourself by learning new skills is a common idea with many names. Scott Adams calls your mix of skills a “talent stack“. Each skill you add to your talent stack roughly doubles your chance of success. He claims that you’re better off becoming proficient (top 75%) at a variety of skills than trying to become world-class (top 99%) at one. Here’s an example of a talent stack in action.
 
Brett McKay at the Art of Manliness describes the T-shaped person. A t-shaped person who has both broad and deep knowledge. A jack of all trades, but master of one. You specialize in a few skills and support them with a broad base of general knowledge. For software developers, this means supplementing your developer skills with skills from other fields
 
I like to think about a portfolio of skills. Like a portfolio of stocks, some skills are rising in value, some skills are dropping in value, and some are steady. Like portfolio of stocks, diversification of skills makes you more valuable.
 
Regardless of what you call it, diversifying your skills is important.

Why?

There are several reasons to diversify yourself.
 
Usefulness
Each skill you learn means you can do more. Each new skills adds to your usefulness as a person.
 
Creativity
The basic process of innovation involves the recombining and transformation of ideas. Each new skill you learn gives you a pile of new ideas you can use to fuel your creativity. Many innovations come from taking skills from one field and applying them to another one. The lean movement in software development borrowed from the lean manufacturing method. Thomas Edison was famous for taking ideas from one field and applying them to another.
 
Empathy
The more skills you learn, the more people you can communicate with. Teddy Roosevelt was famous for this. He read several books a day. His broad knowledge allowed him to communicate with people from many different backgrounds. In software development, learning the terminology of business makes it easier to write requirements. Continuous communication with the business is one of the key tenets of agile software development. Learning about business makes that continuous communication much more productive.
 
Obsolescence
Technology moves at a fast pace. Skills that were valuable a few years ago are worthless today. In some ways, technologists are perpetual beginners. Learning a variety of skills, especially non-technical skills, gives you insurance against obsolescence. Non-technical skills are what separate a senior developer from a junior one.
 

What?

Now that I’ve convinced you to learn something new, where do you begin? I’ll give you the classic consultant answer… it depends. You need to make up your own criteria. Look for a combination of what interests you and what’s useful to others.
 
Here’s a few of my criteria:
Does this help me create common ground with other people? Examples: common hobbies, sports
 
Does this give me a new viewpoint or a new way of looking at problems? Examples: statistics, psychology, economics, design, art
 
Is this applicable to my career? Examples: design patterns, business skills, copy writing, communication skills
 
Is this something fun that I can use to make people laugh? Examples: history, weird trivia, humor
 
Does this increase my objectivity? Examples: argumentation, Stoicism
 

My Own Talent Stack

I cultivate a variety of skills. My primary career goal is to use software to solve difficult problems. I tend to focus on skills that help me do more.
 
Software Development – Primary skill set
Business – I read a lot of business books and study various aspects of marketing and finance. I’m also into small businesses. Most of us are working for businesses. Knowledge of how businesses work and how the business you’re in works is vital to being a good software developer.
Psychology – I love psychology. It gives me a whole new lens when dealing with people. I’m into cognitive and organizational psychology. I look for anything that helps me learn faster or understand human behavior.
Writing – Being able to write clearly is essential for all professionals. Writing clearly is thinking clearly.
Public Speaking – Public speaking is challenging and useful.
History – Those who don’t know history are doomed to repeat it. History also gives me interesting anecdotes to tell at dinner parties.
Philosophy – I’m a big fan of stoic philosophy. It’s a great philosophy for dealing with the chaos of modern life. Finding a practical philosophy of life gives your life structure. Religion works here too.
Design – A little design knowledge goes a long way. I’m no artist, but I can make a decent looking app without a designer. 

How?

There are lots of different ways to learn new things. Many of these methods are easy to integrate into your life. We all have a limited amount of time, so I like to use learning methods that capitalize on otherwise wasted time. My primary target is the time I spend in the car. Additionally, there’s so many inexpensive ways to learn new skills. Here’s a few of the ways you can learn some new skills.

Books
The easiest one is to read books. Books are cheap and accessible. If you don’t have a lot of time to read, get yourself an Audible subscription. Most books are also available in audio form.

Courses
College courses are nice, but there are better options. The Great Courses publishes classes taught by leading professors. I like to listen to them on my way to work. You can also access college level courses through moocs like EdX, Coursera, and iTunes U. Additionally, Udemy has a wide variety of inexpensive courses (wait for their $10 sales).

Commonplace
In order for your hard-won knowledge to be useful, you need to remember it. One method I use to learn better is to keep a commonplace book. A commonplace book is a collection of notes and quotations from the things you’ve read. This used be a common practice, but it’s coming back as people discover how useful it is. I record notes on anything interesting that I read. I also collect scraps of articles and interesting quotations. I keep these in a OneNote notebook that I can refer to. I also review things I’ve read before and add to my commonplace file. This cycle of note taking and review helps me get more out of what I read.

Organizations / Clubs
There’s a meetup for everything. Go find a group of people you can learn from. It’s often easier to talk to someone than to scour the Internet for resources. I’m looking into more agile groups to expand my business skills.

Make Stuff
This is one of the best ways to pick up new skills. If it’s a “maker” skill, like design or programming, build something. Side projects are a great way to learn something new. If it’s not a “maker” skill, like psychology, make something with the knowledge. Write a blog post or a talk. I never feel like I’m proficient until I use my knowledge to make something.

Conclusion

If you want to be more successful, learn a new skill. Each new skill makes you a more useful person. If you want to be more creative, diversify yourself. Diverse knowledge gives you more resources to draw from. If you want to win at work, be a jack of all trades, master of one. There are lots of learning resources at your disposal. Put them to work for you.

The State of Local Profiling on ASP.NET Core

If you want to improve it, you need to measure it. We use profiling tools to get the insight required to find and destroy application bottlenecks. I’m a big fan of local profiling tools that you can install and run from within your application. My favorites are Miniprofiler and Glimpse. Unfortunately, many of the tools that are available on regular ASP.NET are not available for ASP.NET Core. In this post, we’re going to explore our options for local profiling in ASP.NET Core. Currently, it’s slim pickings, but there are a few tools available.

Combing the Desert

The state of .NET Core Local Profiling Tools

For standard ASP.NET (non-core) Applications, there are a variety of profiling tools available. Some of those tools cost money and others are free. Unfortunately, most of them lack ASP.NET Core support. This is, in part, because ASP.NET Core is new. Additionally, our good friends at Microsoft have thrown the community a few curve-balls with the last few versions of the .NET Core. Most companies don’t want to waste their time building tools if the framework is going to have a ton of breaking changes. This is especially true for free tools.

Here’s the status of a few popular tools (as of January 2017):

MiniProfiler
The folks at Stack Overflow are waiting for a more stable version .NET Core to build their .NET core version of Miniprofiler. They said they will build a new version, but they only want to do it once.

dotTrace
JetBrains has not released a .NET Core version of dotTrace, though they claim some functionality with the current version. I’ve never tried this one, so I have no idea if it’s worth waiting for.

Glimpse
I love Glimpse. It’s one of my favorite profiling tools. The folks behind Glimpse put out a Beta version of Glimpse about a year ago. It lacked full functionality and no longer works. They appear to be working on the new version now. Their GitHub repo has recent check ins, so I’m hoping a new version appears soon.

Application Insights
This is Microsoft’s default solution for application performance monitoring. It’s meant to be used in conjunction with Azure, but you can run it locally and use Visual Studio to look at the results. Once hooked up to Azure, you can use this as a general application performance monitoring (APM) tool. It’s installed by default in new ASP.NET Core Projects (look at the startup.cs), so Microsoft really wants you to use it. I kicked the tires a bit. Prefix is a competent option for ASP.NET Core.

Application Insights in action:

Stackify Prefix
Stackify prefix is a free tool you can install on your PC that monitors your ASP.NET applications. You’ll need to also install it in your project, but once you do so, you get access to detailed information about your application’s requests. They have a paid version of the Prefix and a related APM product, so there’s some commercial backing here. I’ve tried out Prefix a few times and the tool is adequate for local profiling. It gives you the data you need, but I’m not a huge fan of the development experience. That being said, the tool gives you access to lots of data and works on .NET Core.

Stackify Prefix in action:

Conclusion

I’m still waiting for a new version of Glimpse (or Miniprofiler), but Stackify Prefix and Application Insights are good tools. I miss the easy to use inline monitoring of Glimpse, but Prefix and Application Insights have their advantages. Not only are they supported on .NET core, they also hook into more robust monitoring systems. You will be well served by either option. Go forth and monitor your apps, it’ll save you a lot of pain down the road.