This One Tweak Improved my Angular Code

I made a tweak to my Angular code process over the last month or so that has resulted in greater productivity in my development environment and fewer bugs.

Now, I didn’t make this change because I thought it would improve my productivity.  At least that wasn’t the primary reason.  I made the change because I thought it would reduce the chance of introducing bugs into my code.  And while it does reduce the number of bugs in my code, the result has been generally improved productivity.

What is this great secret?

This One Tweak Improved my Angular Code
Photo credit: docoverachiever via Visual Hunt / CC BY

Continue reading “This One Tweak Improved my Angular Code”

Thinking in JavaScript

Over the last week I’ve gradually come to the realization that the fundamental reason why most people have trouble with JavaScript is because it doesn’t fit their mental model of how programming should be done.  This isn’t to say that most programmers don’t manage to achieve their end goal.  But if you sit back and take an objective look at the code we end up writing, you have to admit, the code ends up being quite ugly.

Now, this isn’t a dig at the way we’ve been doing things.  We’ve all been doing the best we can with what we have.  But, the JavaScript world has progressed and there is a better mental model that has developed and should even be expanded which will allow us to develop more complex and feature rich applications now and well into the future.

Thinking in JavaScript
Photo credit: freddie boy via Visual Hunt / CC BY-SA

Continue reading “Thinking in JavaScript”

Model View Presenter, Angular, and Testing

While testing Components is possible, it is not easy and is often pointless.  Using the Model View Presenter pattern, or a variation of it, solves the problem.

Here’s the deal. Long time readers of my blog know I’ve been a proponent of Unit Testing for a very long time. While I was learning React, I went through the exercise of trying to write test as I was learning.  Now, the great thing about Angular and React is that it is possible to test your components.  The problem with testing components is that you are either testing that your HTML ended up in the right spot, that Angular directives did what they should, or you are evaluating the DOM to verify that component logic worked.  In most cases, putting tests that do any of these at the component level is the wrong way to test.

Model View Presenter, Angular, and Testing
Photo credit: Tamworth Borough Council via Visualhunt.com / CC BY

Continue reading “Model View Presenter, Angular, and Testing”

The Tyranny of Emotions

Emotions are a weird element of being human.  They can propel us forward or hold us back.  Sometimes they are violent.  Most of the time they whisper.

Several events have occurred recently that have me thinking about this more.

To start with, I’ve started paying more attention to my health.  There were a lot of things holding me back from this in the past.  But it turns out, most of what was holding me back was just a lie.

I’ve started interviewing again.  The nature of what I do means I get to do this a lot.  You’d think I’d get used to it.  But, I don’t like the interview process.  I don’t like changing jobs.  I really don’t like code interviews.  But, I do them because I like having money.

Some of the interviews I’ve been on have revealed that managers think in similar short-term ways that I have.  Short-term thinking is so easy to see when it is someone else.

The Tyranny of Emotions
Photo credit: whinmobzappmedia via VisualHunt / CC BY

Continue reading “The Tyranny of Emotions”