Photo by Demi DeHerrera on Unsplash

I’ve been working with JavaScript on and off since the late nineties. I didn’t really like it at first, but after the introduction of ES2015 (aka ES6), I began to appreciate JavaScript as an outstanding, dynamic programming language with enormous, expressive power.

Over time, I’ve adopted several coding patterns that have lead to cleaner, more testable, more expressive code. Now, I am sharing these patterns with you.

I wrote about the first pattern — “RORO” — in the article below. Don’t worry if you haven’t read it, you can read these in any order.

Today, I’d like to introduce you…

Photo by wu yi on Unsplash

I wrote my first few lines of JavaScript not long after the language was invented. If you told me at the time that I would one day be writing a series of articles about elegant patterns in JavaScript, I would have laughed you out of the room. I thought of JavaScript as a strange little language that barely even qualified as “real programming.”

Well, a lot has changed in the 20 years since then. I now see in JavaScript what Douglas Crockford saw when he wrote JavaScript: The Good Parts: “An outstanding, dynamic programming language … with enormous, expressive power.”

Photo by Amanda Flavell on Unsplash

Long ago a wise old developer gave me a piece of advice that I didn’t fully appreciate until very recently.

We were in a code review looking at some feature that required the program to output a list of letters from A-Z (think of a list of contacts with a set of buttons that allow you to skip down to names starting with a certain letter — that kind of thing).

So, along came some young hot-shot. (OK — it was me.) I decided that rather than just hard-coding an array of all the letters, it would be easier to…

I do hereby pledge to only produce trustworthy software that respects its users.

Such software will:

  • be transparent, honest, and accountable in all user communication;
  • function exactly as described;
  • seek explicit user consent prior to collecting any user information; including both user-provided information and information collected from a user’s device or through integration with other services;
  • seek explicit user consent prior to sharing any and all user information;
  • use clear and plain language when seeking user consent;
  • describe in clear and plain language what user information is collected and how;
  • describe in clear and plain language where, when, and how…

Clint Eastwood in

Stop me if you’ve heard this one before…

“Good code is self-documenting.”

In 20+ years of writing code for a living, this is the one phrase I’ve heard the most.

It’s cliché.

And like many clichés, it has a kernel of truth to it. But this truth has been so abused that most people who utter the phrase have no idea what it really means.

Is it true? Yes.

Does it mean you should never comment your code? No.

In this article we’ll look at the good, the bad, and the ugly when it comes to commenting your code.

For…

Photo credit

Tabs or spaces? Curly brace on the same line or a new line? 80 character width or 120?

Coders love to argue about this kind of stuff. The tabs vs. spaces debate even made it into a famous episode of the HBO show Silicon Valley.

Well in this article, I will finally give you the definitive answers you seek.

Early in my career, I engaged in all kinds of holy wars. I would read some article about why a particular convention was correct, while another was totally wrong. …

Have you ever shipped a system completely free of technical debt? An application where no corners were cut and no compromises were made in service of deadline or budget? Small personal projects aside, over a 20+ year career, I have never seen such an application in a professional setting.

Author’s Note: This post is an excerpt from my weekly Dev Mastery newsletter. It was originally sent to Dev Mastery subscribers on December 8, 2016.

Check out this article from Tech Crunch about strategically planning your technical debt so that it can be managed and leveraged for maximum benefit.

The article…

I’ve shared some pretty awesome links and resources through the Dev Mastery newsletter this year. Here are my top 5 favourites.

#5 — My Dog Taught Me to Code by Dave Thomas

Here is a video where the inimitable “Pragmatic Dave” Thomas shouts at you for almost an hour with really amazing advice that will help you improve your code. If you’re impatient, just skip to 4:52

My Dog Taught Me to Code by Dave Thomas

#4 — Turning the Database Inside Out

Martin Klepmann makes the following provocative statement and provides a fascinating alternative model for Databases whose time I think has come.

“Databases are global, shared, mutable state. That’s the way it has been since the…

Have you heard of serverless architecture? Have you experimented with it? I have and I’m a big fan.

Serverless architecture lets you concentrate on code and not have to worry about anything else. Your logic just runs in this ephemeral, stateless container that comes and goes on demand. All the big cloud companies now support this; Amazon has AWS Lambda, Azure has Azure Functions, and Google has Google Cloud Functions.

Author’s Note: This post is an excerpt from my weekly Dev Mastery newsletter. It was originally sent to Dev Mastery subscribers on December 1, 2016.

One of the most thorough…

I have to make an embarrassing confession…

Many years ago (around 2002) I built a website in PHP. It was for a — now defunct — theatre company and included some basic functionality like a calendar and some lightweight content management features in a custom admin module I built. It was a small side project that I took on, in part, to learn PHP.

I came away from that experience thinking PHP was a steaming pile of garbage and I would tell anyone that would listen to me how terrible I thought PHP was. Here’s the embarrassing part; despite trashing…

Bill Sourour

DevMastery.com | Consultant | Teacher

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store