‘A’ Level Software Development Leads

‘A’-level software development leads aren’t the people who write the best code.

That’s an ‘A’-level senior software developer.

No, the best development lead is someone who can take mediocre or junior developers and have them perform at a level that takes minimal effort, produces easy results and makes everyone look good.

How do you do that?

  • Automation: Automate everything you can, whether is through programmatic scripts or documented procedures and processes.
  • Documentation: Documentation is king. It’s how developers know those procedures and processes, and how to find solutions to problems that have come before. It’s hated by those who have to write it but loved by those who need it. But it’s not enough just to write – you have to write the documentation well (it’s usability for words).
  • Time and effort: It takes both to do the work to automate and document. It takes both to learn the people you need to lead and manage.
  • Mentoring: Everyone – everyone – needs at least one mentor to help them learn, understand and grow. If you can mentor those you lead then you’re not a leader.
  • Dedication: If you’re not dedicated to the task then you will never get the most out of those you lead.
  • Understand, acceptance, patience, empathy and reflection: These are not things you do, but they are things you need within yourself to be a leader. These allow you to grow as a leader and allow you to get inside the mind of those you are leading.

There are no shortcuts to either leadership or the ‘A’-level. If you’re not prepared to commit completely you will never be an ‘A’-level leader.


(The astute may notice something seems missing from this is: anything to do with coding and technical understanding. Those aren’t required by an ‘A’-level software development leader. They are required, but in the same way as reading and writing and breathing are required. Which is to say, they are not even worth mentioning.)

The State of Websites as We End 2018

In a word: fucked.

Have you noticed that just about every website you visit nowadays shows a popup that either asks for your location or wants to push notifications at you?

Or you see an article in the Google suggestions feed only to find the it’s behind a paywall?

That’s on top of the 5 million fucking ads embedded in the page or popping over what you’re reading because you moved your mouse or it hit a timer.

I long for the 1990s when the worst you had to worry about was a page visitor counter and/or a subtle “guestbook” icon at the bottom of a page, and good old <blink> and <marquee> text just sitting there quietly doing its thing.

I Just Quit the Social Platforms

A few hours ago I deleted my Facebook account (an account I’ve I’ve diligently held on to since around 2006/7, before Facebook was the rage), Instagram (I only tried it to follow my wife), Twitter (for the second and I hope last time), and finally, LinkedIn (which is now as bad as Facebook in terms of trash feed, only it populated “so-called” professionals – mainly young recruiters – who also just SPAM you after keyword searches).

And I can say this about it: I feel a relief.

Nothing to follow. Less clickbait. Less distraction. More time for me.

And the people I really care about…?

Oh fuck… I still know how to talk to them.


The big questions is probably: why?

And the answer is simple. I don’t trust any of the big socials services. And I want to limit how much of my identity (my soul) I’m giving away. I’m still with Google and Microsoft, but I am paying both of them.

I’m taking small steps. Feeling my way. But I can already stay I feel much better for it.

Recruiters don’t help their network advance in a career

Where are the recruiters who help their network “advance” a career? Or shift across disciplines?

No one stays in the same role forever. Especially in the tech sector.

I had to leave “employed” life to break free from being “just a programmer”, and still, I continue to get pinged for what I consider mid-level programming roles.
I’ve been programming for 20 years. I’m not interested. Was a recruiter ever going to ask what else I want to do?
(Well, sorry, too late. I’ve done it already, on my own. In the last 12 months I’ve now architected a business web-application platform, co-run a business and lead/manage/mentor overseas staff.)

If you’re a recruiter and want to stand out, help people move “up” or “sideways”, not just into the next dead-end, same-old-same-old job.

But then, that would require “cultivating” a network, getting to know people and staying in touch.

platform_browser_dynamic_1.platformBrowserDynamic is not a function

I received the following error today in a project I’m working on (the relevant part is in bold):

MainModule.bundle.js:27136 Uncaught TypeError: platform_browser_dynamic_1.platformBrowserDynamic is not a function
   at Object.__decorate (MainModule.bundle.js:27136)
   at __webpack_require__ (Polyfills.bundle.js:55)
   at webpackJsonpCallback (Polyfills.bundle.js:26)
   at MainModule.bundle.js:1

You can see my response to a similar problem at https://github.com/angular/angular/issues/10732#issuecomment-417173741.

And my response here as well, for completeness:

I just had the same issue in a project I’m working on. We’re using Angular 5.0.2 and Webpack on Windows in an IIS/ASP.NET project, with our primary browser as Chrome.
My issue randomly appeared after rebooting my PC and loading up my dev environment again (no code or configuration changes).
I managed to resolve the issue after a couple of attempts at starting the project (in Visual Studio) by also browsing to the the app URL Microsoft Edge. It loaded find. I then did a hard refresh (Ctrl+F5) in Chrome and it came good too.
Note: we manually start and leave running Webpack in separate command window, but start the actual application from withing Visual Studio.
My guess is Webpack crapped out behind the scenes and needed some time and a hard refresh in the browser to get the correctly compiled code to the browser again.

Saving yourself with Git (Pro Tip!)

I don’t fully trust source control systems. Not even Git. That’s because I’m an old fella in the industry and I’ve been bitten too many times to fully trust systems.

Point in hand. I just had a merge from ‘develop’ royally screw up some code in such a way the effort to find and fix the change is greater than the effort to just blow away my working branch and pull again from remote.

Pro Tip!

When merging from another branch like ‘develop’ into your working branch, first commit and push your changes to remote.
That way, when your merge screws something up without you realising until after you’ve re-compiled and tested the merge – you do re-compile and test your merges right? – you can reset or blow away the branch (even delete your local branch and pull again if need be) without losing your hard-won changes.

JavaScript helper: getMaxLengthString [TypeScript]

Here’s a quick JavaScript helper snippet to return a trimmed string based on the calculated maximum length of a string to fit the width of a parent container element.

Written in TypeScript.

 * Takes a full string and returns a trimmed version to fit within a parent space.
 * @param fullLengthString  The full length string to trim to a parent space.
 * @param font              String representing the font styling of the text (required to calculate text length).
 * @param maxLengthPixels   Max pixel width of the parent space to fit the text into.
 * @param removeExtraChars  The number of extr characters to remove from the trimmed space, if required. (Default: 0)
private getMaxLengthString(fullLengthString: string, font: string, maxLengthPixels: number, removeExtraChars: number = 0): string {
	let maxLengthString: string = "";

	let canvas = document.createElement("canvas");
	let context = canvas.getContext("2d");
	context.font = font;

	for (let i = 0; i < fullLengthString.length; i++) { // Build the string maxLengthString = maxLengthString + fullLengthString.charAt(i); // Test the length of the string let metrics = context.measureText(maxLengthString); if (metrics.width > maxLengthPixels) {
			// Trim the string to a max length.

			// The number of characters to remove.
			let removeChars = 1;   // At this point the length is too long, so remove 1 character to get it under.
			if (removeExtraChars > 0) {
				removeChars = removeChars + removeExtraChars;
			removeChars = removeChars * -1; // To make sure they're sliced from the end.

			// Remove characters from the string.
			maxLengthString = maxLengthString.slice(0, removeChars);

			return maxLengthString;

	// Full string is OK.
	return maxLengthString;

JavaScript helper: getTextWidth [TypeScript]

Here’s a quick JavaScript helper snippet to calculate width of a string, based on a supplied font styling.

Written in TypeScript.

Credit goes to https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393

 * Uses canvas.measureText to compute and return the width of the given text of given font in pixels.
 * @param {String} text The text to be rendered.
 * @param {String} font The css font descriptor that text is to be rendered with (e.g. "bold 14px verdana").
 * @see https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393
private getTextWidth(text: string, font: string): number {
	// re-use canvas object for better performance
	let canvas = document.createElement("canvas");
	let context = canvas.getContext("2d");
	context.font = font;
	let metrics = context.measureText(text);

	return metrics.width;

JavaScript helper: GetElementInnerWidth [TypeScript]

Here’s a quick JavaScript helper snippet to get the inner width (excluding padding) of an element in the DOM.

Written in TypeScript.

 * Return the calculated inner width of an element.
 * Returns -1 if width is unknown.
 * @param elementID         ID of the element to calculate the width for. Set to "" to use elementClassName
 * @param elementClassName  CSS class name on the element to calcualte the width for. Ignored if elementID is provided.
public static GetElementInnerWidth(elementID: string, elementClassName: string): number {
	let width: number = -1;
	let element: any = null;

	// Get the DOM element to check,
	if (elementID !== "") {
		// Lookup by element ID.
		let elementByID = document.getElementById(elementID);
		if (elementByID !== undefined) {
			element = elementByID;
	} else {
		// Lookup by CSS class name. Use first found node as actual element.
		let elementByClass = document.querySelectorAll("." + elementClassName);
		if (elementByClass !== undefined && elementByClass && elementByClass[0]) {
			element = elementByClass[0];

	if (element !== null) {
		// The outer width of the element
		width = element.clientWidth;

		// Get the calculated padding so we can remove it.
		let paddingLeft = ComponentHelpers.TryParseInt(window.getComputedStyle(element, null).getPropertyValue("padding-left"), 0);
		let paddingRight = ComponentHelpers.TryParseInt(window.getComputedStyle(element, null).getPropertyValue("padding-right"), 0);

		// Innerwidth = outerwidth - padding
		width = width - (paddingLeft + paddingRight);

	return width;