Is it still possible to muddle through?

I was reading this article while waiting for some code to deploy this morning, and a couple of sentences really leapt out at me…

data-animation-override>
The British way is to muddle through on the basis of vaguely understood traditions and conventions. Our entire culture, from our political constitution to the way we queue, is based on that principle of minimal principles.
— https://www.theguardian.com/commentisfree/2017/sep/18/level-playing-field-commuters-british-green-lanes-tube

The same has been true in the IT world, or at least my IT world, for the longest time. Getting code from my machine into production is never a consistent process. It depends where I’m working, what regulatory framework is in place, what technology is being used, how advanced the organisation is.

In my current job we use a lot of the latest and greatest technologies: node.js, microservices, Docker, Kubernetes, Splunk and so on. And the philosophy we try and adopt is called “build, run, own”. That is, you take ownership over every element of the code you write, from conception through to support. 

It’s a good theory, but every so often we get stuck. I do own my code, but someone else owns the Kubernetes platform, a different team is responsible for splunk and they don’t all necessarily do the right thing, especially in test environments. In some environments I’d have the ability work around these sorts of problems – muddling through – but it is not possible in this highly connected architecture where various elements present themselves as black boxes. 

It makes for some interesting challenges and dependencies and means that muddling through is no longer an option. The positive is, or at least should be, that, because we have to do everything within well known, tightly defined constraints, that when my code finally reaches production it is far more stable.

Evernote to Bear

I’ve been an Evernote user for years. But recently it’s been an on and off thing as I get more and more annoyed with their service. The problem is that I keep trying to find something that will do everything I need, find a tool that I think might work and it never quite does so I crawl back to Evernote with my tail between my legs.

The issues with Evernote are several, I use it all day long for note taking in meetings, writing blog posts, planning out code changes and so on. Over time, the software has just become a bit too bloated, the editor doesn’t support Markdown which is de rigueur these days, and then there’s the pricing changes, the data leaks. Basically, if I can find something better then I will jump ship.

Well, I think I may have finally done just that. Bear is a much cut down note taking tool, it syncs beautifully across Mac / iOS, supports Markdown and it’s a really nice text editor to use.

The only issue I struggled with so far was bringing across tags and notebooks from Evernote. There is no concept of a notebook in Bear (that I can see), but you can “sub tag” content. So you’ll need to work out a strategy to bring across your Evernote documents. For me it was a case of doing it a notebook at a time, but YMMV.

So, for the moment, this is what I’m trying out. Do you have any better suggestions?

Do you know what your users are doing?

There are levels to this question. I’m sure most of us that run web apps know to some degree what our users are doing, but, if you have the need, you can find out in real detail what they’re doing and in what order.

Obviously there are paid tools, entire companies that make this their business such as SessionCam. And what they do is great if you have the budget. But what about for those of us with slightly smaller wallets?

My usual approach to the problem these days is to use Google Analytics (or GA as it is inevitably shortened to). I suspect most people know that you can drop a simple GA JavaScript file onto a web page and any visits to the page will be automatically recorded, analysed to identify what type of user is visiting so that you can get a picture, even real time, of traffic to your site. 

What’s maybe less well known is that you can actually use that GA JavaScript to record events on your page so that you can really drill down into what is happening once the user loads the page.

ga(‘send’, ‘event’, ‘MySuperPage_OKButton’, ‘Clicked’);

If you add the above line to the onclick event on a button on your page then, in your GA analysis you’ll be able to see how often that particular button is clicked. And, really, you can track everything that the user does, every single key press, click and page load. 

Well whoop-de-do you might say. That’s a lot of data, but what use is it? Well, imagine you’re adding or testing a new feature, wouldn’t it be good to know how often it’s actually being used. Or you may need to keep an eye on the volume of usage for a particular feature. Or your management may want to understand better how far through a process people are getting before dropping out. The point is that having more data is very rarely a bad thing and the development cost of adding this to an application is surprisingly low.

The question really is why you wouldn’t do something like this for an application.

Oh, ah-linting I will go

Often when I talk with developers who are firmly in the C# or Java camp their main objection to JavaScript is that it’s not strongly typed. And indeed, if you’re new to the world of JavaScript, this is a big thing to get over.

But there are strategies, best practices if you will, which can make the transition easier. One I thought worth mentioning is ESLint. This is a process whereby you statically validate your code to make sure it adheres to a set of rules you define. These rules can be as lax or strict as you like, but, applied properly they make your code more supportable, more readable and less error-prone.

So, how to get started I hear you ask? A lot depends on your working environment. If you use a modern editor like VS Code, Atom or Sublime Text then there will be a plugin you can install to help you along. In your project, you add a .eslintrc file which defines the rules you want to apply and then you look, with horror, at the hundreds of errors that have suddenly appeared in your code.

But fear not, things aren’t as bad as they appear. Your ESLint plugin will probably have a command to automatically fix “easily fixable issues” such as using single quotes rather than double quotes for strings, or indentation of your code. Once these are all addressed you can fix the rest of the issues manually, and relatively quickly.

I’ve recently completed this exercise with a large code base primarily because we want to put some focus on performance: if I have code that is predictably organised, then this makes the process a lot easier.

A great side effect is that the rest of the developers on the team can pick up the code I’ve been butchering and immediately have some familiarity with the style.

The most popular eslint configuration is published by AirBnB as an open source project. It’s a great starting point, but the beauty of these configurations is that if you don’t like a rule then you can simply turn it off. Or, on a case by case basis you can also turn off the rule in your code. As an example, here is the LDC Via .eslintrc file.

Linting your code is not, in itself going to make it great code, but it will be a big help to you and, at the end of the day you can go home with a slightly smug feeling that you’ve gone that extra step to be a good programmer. And who doesn’t like to feel a bit smug sometimes?

This blog post was originally published on blog.ldcvia.com.

Do you use your own product?

We’re just back from holidays down in Cornwall and Devon and a lovely time was had by all.



View of Falmouth

A view of Falmouth from one of our walks

Of course there has to be one exception: whenever we do any travel in the UK, I rarely carry change with me these days. And so, when parking the car, we rely on the various mobile parking apps to pay for our spaces.



Parkingapps.png

After a couple of weeks away, I end up with a page of parking apps installed like this.

Some of the apps have nice features, but not one of them is actually staying on my phone now that I’m home.

And what’s the point of this post? Well, not a single one of the many different parking apps that I’ve installed, used and then deleted as quickly as possible over the years is any good to use. The registration process is awful and opaque. You have to enter your name, a card type (why?), a card number, expiration date, CVC and only then is validation run and a single mistake clears out all the fields and you have to start again.

I’ve reached the point where I’m pretty sure that the people responsible for the apps have ever actually tried to use them, while standing in a car park, in the rain, with impatient children tugging at your shirt because they want to get to the beach. NOW!

If you write apps that people have to use in sub optimal locations, as opposed to behind your desk with fast wifi, please, please, please think about how they will be used in the real world. Even if the app will be used from the comfort of a sofa, why not actually try using it for real yourself before inflicting it on the rest of the world?

Three months in with the new MacBook Pro

A few months ago our house got burgled. Luckily it was just “stuff” that was taken and the insurance companies sorted everything out with remarkably little fuss and bother.

One bit of “stuff” that went was my work laptop, so I immediately got a new MacBook Pro 15″, restored my backup and was able to carry on working.


mbp15touch-gray-select-201610.jpg

The problem is that I’m still not feeling like I’m able to work as well as I was on the old machine. Now, admittedly that old machine had had the same design for several years, but everything about it was just good, the keyboard, the ports, everything really.

Not so much with the new design. The first, and still most notably annoying thing to me is the keyboard. I simply cannot type with the same speed and reliability as I can on other keyboards, I don’t know what it is about it; maybe the lack of travel on the keys, or that they’re bigger than before, or that aesthetically they show every bit of human contact in the form of fingerprints, or that it seems to be incredibly noisy when I’m bashing out long form text. I’m getting to the point where I’m considering getting an external keyboard and carrying that around with me, which would be insane.

The trackpad is also too big. Until using this laptop, I had never encountered the situation where, by resting my hands below the keyboard I’d mistakenly move the mouse while typing, but now it happens regularly.

Likewise with the silly gimmick that is the touchbar where there should be function keys. It’s very much a case of “you don’t know what you’ve got ’til it’s gone”. Apparently I used the F keys more often than I realised and swapping them out for typeahead suggestions that would take me longer to touch than simply typing the word feels like a step back to me.

It’s not all bad, the screen is lovely and larger than before, but still no touch? Seems like a missed opportunity to me when compared to Windows 10. And the battery life is pretty amazing, I actually have travel days where I don’t plug into the mains the whole day and still have 20% battery left, and that’s without dialling down any settings or using it any less hard than I normally would.

All in all, if I were to buy a new laptop today I would end up buying a Windows machine; a Lenovo or a Surface over a MacBook Pro. I’ve not really been able to say that for well over ten years and it makes me sad.

Browser tracking and digital advertising in the modern era

In the day job, I deal with a lot of interactions between members of the public and ourselves, and our partners. If you’re in any way involved in working with user data, then you’ll have heard about GDPR.

To be honest, this is quite a new world for me. Even though I’ve been working in web development for many many years, it’s generally been in the business or corporate space where we’re less concerned about these issues. What I’ve learned has really opened my eyes to exactly how you see those adverts tracking you around the internet and the huge amount of data that various providers know about you to be able to do it.

The video below is only 30 seconds long, and, to be honest, slightly underplays the number of companies that get to see your profile data as you browse around the internet. But it’s a good grounding.

GDPR is going to shake up a lot of how this all works and I don’t think there is really a plan for how internet advertising is going to work after May 2018, but, in the meantime it’s worth visiting YourOnlineChoices.eu in the short term to see what’s being tracked in your browser.

The service there is a voluntary one which the main players in digital media have signed up to. It allows you to opt out of being offered adverts by different providers. So, if you opt out of everything there, then, often you’ll see far less advertising as you browse.

If you want a good grounding in the GDPR space, then Rene linked to an excellent set of pages offered by his employer, Salesforce.

XControls 1.7.0 Released

I’ve been most remiss in not talking more about the XControls project which lets you quickly build an application that will run on desktop, iOS and Android with as little coding required as possible.


It’s the little open source project that just keeps rolling along. As and when I get the chance, I’ll have a blast through the Github issues list and put out a new version. Today has been one of those days where I’ve fixed a few bugs, added a few changes and released it to the website, and OpenNTF.

If you’d like any assistance in getting started with XControls or, indeed, if you’d like an application created, then please do drop me a line.

Jade / Bootstrap pagination mixin

I’ve been working on a new node.js application for the last few weeks. It uses LDC Via as a back end, but that is by the by. On the front end I am rendering HTML using Jade and Bootstrap

As I have the need to display quite a lot of data, I’m using Bootstrap pagination and had need to make a re-usable “mixin” that I can insert into many different pages. There are a few examples out there on t’internet that do this, but none that did exactly what I needed, so I’ve created by own.

To use it you just enter something like this in your Jade template:

– var pages = 10
– var currentpage = 3
+pagination(1, pages, currentpage, ‘/index/’)

And you end up with a pagination control that looks like this: