Cognitive Dissonance: A Unit Testing Introspective

Cognitive dissonance is a funny thing. Just to make sure we’re on the same page, here’s a definition.

cog·ni·tive dis·so·nance
noun: cognitive dissonance
The state of having inconsistent thoughts, beliefs, or attitudes, especially as relating to behavioral decisions and attitude change.

I have had a love/hate relationship with unit testing for over a decade now. I have gone back and forth with periods of being really good at doing it and times where I haven’t.

I KNOW the benefits of testing, but I don’t always test.

So there are 4 phases of learning things in our life.

The first unconscious incompetence. We just don’t know about something. We’ve possibly not been exposed or just haven’t thought about the problem enough.

The second is conscious incompetence. We are aware of those thoughts and ideas, and can no longer be blissfully ignorant of them.

The third is conscious competence. We learned enough about the topic that we may practice it, but need more time perfecting our understanding and skill.

The fourth is unconscious competence. This is where you have a deeper understanding of the topic, and it’s just who you are.

I like to relate this to being Vegan. As kids, we start out in phase one. We hear the terms thrown around the dinner table (pork, chicken, beef, eggs) but we don’t know any more than that.

I was around 8 when I really understood that an animal was dying for this to be on my plate. I wanted to be vegetarian, but my mom would hear nothing of it. Not being old enough to make up my own mind and being controlled by impulses (like taste) I just put it out of my mind. At this point I was in stage 2, conscious competence.

As I continued getting older, I knew that killing animals was wrong, but didn’t have the will power to change my self. I was experiencing cognitive dissonance. My wife and I had talked at length about changing our life style and becoming at least vegetarian.

Finally, I made that decision (thanks to a life changing event) and moved into phase 3. I knew it was wrong, but I also set out to learn more about why it was wrong. This is the hardest part for people to do. Admitting there is an issue or believing one of the many lies they tell themselves to allow them to stay in cognitive dissonance. I make a point of watching footage of what really happens so that I don’t believe the marketing like “Happy cows make happy cheese”. It’s marketing bullshit 101 to make you buy product.

Yes this whole article was a ploy for me to ask people to think about their choices. Watch documentaries like Dominion ( to learn more. Understand that marketing has driven our society further and further into the hands of animal agriculture and it is horrifying.


A Life Changing Event

I wanted to share a recent event, without worrying anyone at the same time. It will be talked about at length on the PHPUgly Podcast, Episode #123, recorded 10/4/18. If you are reading this after about 10/9/18, go look for that episode.

TL;DR; I had a mild heart attack on Saturday 9/29/2018, but I am fine.

On Saturday evening, around 9:00pm, after the kids were in bed and my wife was out at book club with her friends, I noticed a weird discomfort in the middle of my chest, straight through my back. I thought it was odd, but I didn’t have any other symptoms like pain shooting down my left side, etc… The stuff we always hear about.

Earlier that day, we ran a 5K with the kids, pushing both of them in a stroller for a good portion of it. Then we went to a beach town, had lunch, and I ended up carrying both boys at the same time about 1/4 mile back to the car. So when this all happened Saturday night, I assumed that I had strained something. I really felt like I just needed to pop my back.

I had trouble falling asleep that night. My mind racing, feeling my heart beat… I was scared. I got up, did some reading and of course read everything from OMG Get To The Hospital NOW, to it could be inflammation. So I took some Advil, and finally got some sleep.

I woke up Sunday morning feeling 95% better. I lied to myself and others that I was 100% better. I had plans that day with the kids and nothing was going to stop me from being with them for that day. As I write this I realize the irony and am crying. I chose one day over possibly the rest of their lives. I had plans for the 3 of us to go get our haircuts together and then go to a baseball game. Nolan’s first, and we got to watch from a Suite.

While at the game, I noticed my chest more and more. I made the decision that I’d finish the game, get the kids home, fed, in bed and then I’d go have it checked out. I still really thought it was a strain, that I was just going to have it confirmed real quick that night. I got home, told Jacki my plans and she told me to go right away. She would take care of the kids. I had convinced her as well that it was nothing.

Geeze I’m balling as I write this… pull it together man… (Ok I was distracted by work which helped calm me down… where was I…)

Got to the ER, even the person checking me in asked if I did anything to strain the chest wall. Kind of confirming what I thought the issue was. So I was relieved. I went through the tests, EKG nurse said it looked ok, had blood drawn, etc…

Then the doctor saw me. He told me about an elevated protein in my blood called Troponin. Then he said, “I’m going to just be blunt, you had a mild heart attack, and may still be having it”. He went on to tell me the normal level is 0.2 or lower, and mine was a 6. I needed to be transferred to another hospital that had a cardiology unit. By the time I left the hospital, my Troponin level reached 10.2.

I went in for an Angiogram the next morning. Luckily all they found were 3 very small blockages. Unfortunately, they were in branches of blood vessels that couldn’t be opened up or stented.

So now I’m on a ton of medications, and need to change my lifestyle (luckily only a little).

Conclusion: I’m an idiot for waiting. But I will make a full recovery and will live a long happy life and be here for my kids.


PHP|Architect being acquired by

To me this is HUGE news in the PHP World.

If you are in the PHP community and don’t know PHP|A, then you have been missing out.  I learned about them when I decided I HAD to grow and improve my skillset.  I was a sole developer that was stuck.  I wanted to be better, but to do so, you have to work with better people than you are.  So I set out a goal of learning things, and luckily enough I kind of knew what I was looking to learn.  Part of my whole speech about needing to know what you don’t know.

PHP|A offers a magazine (used to be in print, maybe again soon?), books, trainings, and conferences.  The conferences are what first drew me in.  I attended TEK-X, back in May of 2010 and thus start of the new me.  Within 2 years, I completely transformed myself for the better, and made some huge life changing decisions.

I met all of the members of while on my new quest.  I met @EliW first at Tek-X, and while he won’t remember it, I certainly do.  I got to hang out with a large group of people in his room playing Rock Band until late in the night.  I was very shy that year, and stayed to myself.  I met the rest of the team (@omerida, @SandyS1, and @kevinbruce) this year at Tek12.  I talked with them way more than I thought I would have, and it was a great experience.

The Musketeers were the team behind, until funding ran out and the backers pulled the plug.  At least this is how I interpreted the story.  They decided they liked working together and formed a new company called Musketeers.met.

This is a great story for potential PHP startups.  I am looking forward to what comes of all of the changes at PHP|A.  Will the conferences continue?  If so, will they be as good as they were, or better?  Congratulations GUYS!!!


VimDiff: How Have I Not Used This Before?

Ok, I have been using Vim for about 15 years now, and even did a whole presentation on vim at my SD PHP Meetup, and had a reference to vimdiff in one of my slides. But honestly I have never used it.

WOW, what a great tool. Here are a couple of links that I found useful.

The video shows you how to use vimdiff as your git diffing tool.

One thing to add. If you follow the steps for using vimdiff as your git diff external tool, make sure to add this to your .gitconfig
diff =

Otherwise you will get errors.

Also, when editting more than 2 files at once, those shortcuts won’t work.
Instead of :dp, use :diffput b#
Instead of :do, use :diffget b#

b# is just a number of the window pane starting at 1, counting left to right.
Shorthand :diffpu or :diffg


Do Not Hire Or Be A Sole Developer

I was a sole developer for for eight years. While there, I was very happy to be the only tech person. I was able to do things my way. There was even an employee that encouraged the owner to outsource the programming, and to get rid of me. Needless to say, I was very unhappy when I heard this.

Looking back… being a sole developer is bad for both the company and the developer themself.

    For Developers:

Developers should strive to be part of a team. It is so hard to grow by yourself. If you have to be willing to put yourself out there and work very hard to learn. If you have co-workers, you will learn from each other. Someone will have your back if you make a mistake. Learning best practices is easier with more people.

    For Companies:

If a company can not afford to hire at least 3 people, they are doing themselves a disservice by hiring any. What happens when that person leaves? Who’s double checking that person? Did you really hire the “Best” you could?

Outsourcing to a group of developers is not necessarily as expensive as it sounds. Sure, per hour you may pay more, but you are basically buying the experience of a group of people. If someone leaves that group, there are others that can pick up where they left off easily. You should not be left hanging in a transition. You are not paying an employee when they are not working to 100% productivity or for them to spend time learning.


In the end, a sole developer really isn’t good for either party.


The Pragmatic Programmers: Practical VIM Review

I gave a presentation at SD PHP on Vim, and when I got home from giving the presentation, I had this book sitting on my doorstep. A little late for my presentation, but that’s probably a good thing.

All I have to say is WOW. I am going to have to give another presentation from just the new things I’ve learned. This book is not for beginners by any means. And if you think you know Vim well, I would say pick this up and have your mind blown.

I have been using Vim daily for over 14 years. It’s how I write code, which is how I make a living. The book starts off with the dot (.) command. Which is very useful, but not the first thing you would learn in Vim. I have used that command extensively for years. But nonetheless, with that kind of start, I knew that starting there meant the book would be advanced.

I am currently at page 33, and have said OMG many times with the cool things Vim can do, that I had no clue about. Based on this alone, go get this book. 5 out 5 stars/elephants/candy canes, whatever you want to use.

Practical Vim: Edit Text at the Speed of Thought


Solved: Facebook sharer.php Not Working for Some Reason

So, we have a ton of share links all over our various domains at work. And much of our domain structure is based on users have subdomains (example:

All of a sudden, the sharer.php seemed to stop working. Some browsers stayed white, Chrome showed a grey error message with a 500: internal server error.

It took me a long time to track down the problem. I tried so many different things, but in the end, it was the CASE of the subdomain. 🙁 Changing it to solved the issue. So strange, undocumented, and frustrating.

I hope this helps someone down the road.


Running a PHP User Group (2 Months In)

Running a user group was not in my thoughts prior to 2011. I joined Orlando PHP Dec 2010, but there was an hour commute. Then Daytona PHP started back up, and I was thrilled. Except they had 1 meeting and fell apart. 🙁

I planned on starting Daytona PHP on my own, but due to waiting for the OK from my then employer to use their conference room and then deciding to move to California, I put that idea to rest.

I started looking for a PHP Group in San Diego and was surprised to see that one did not exist. It became my goal to start it up (well start it up again, there used to be one). I had everything in place before I even moved.

Running a user group has to be one of the most satisfying experiences I have had in a long time. The people are great, and I have been very lucky to find members that want to be part of my team and co-organize. I was lucky to find a host that would provide space and pizza for the group.

We have had 3 meetups so far, and there have been a few regulars, which tells me something is going right. 🙂


Bluetooth Headset Purchase

After spending some time doing a lot of research, I settled on ordering the Motorola S10-HD.  I read some great reviews, some not so great as well.  We’ll see and I will post once I have them in hand.



Why You Should Not Style Major Elements

I have done this to myself many times.  Have you ever thought, I want all my tables to look like XYZ.  So you throw table { border-color: blue; … } into CSS.

The problem is now you are stuck with that for all tables.  I think you should have a table style like table.blue_border { border-color: blue; …} that you can now apply to only the tables you want to with <table class=’blue_border’>.

You will inevitably need a standard table somewhere without the same style as the rest, but now you have to do more work to make that happen.  Do yourself a favor, use a reset for all HTML elements, and don’t style them directly.  Style a class that you will put on those elements.