This post is part 79 of 81 in the series Programming by Stealth

Finally, after much teasing, we get our first taste of JavaScript Promises! This will just be a taste though, Promises are simultaneously really simple and really counter-intuitive. In many ways teaching promises reminds me a lot if teaching recursion — there is a tipping point where the concept goes from infuriatingly mind-bending to obvious and logical. Getting to that tipping point can be quite the challenge though.

So, we’re going to take it slow with promises. They will provide us with a way out of callback hell, but that path to salvation is unlikely to be obvious to you by the end of this instalment. It will take one or two more instalments until we get that far. All I can ask is that you please trust, me, how ever bumpy the journey gets, the destination is worth the struggle!

You can download this instalment’s ZIP file here.

Listen Along: CCATP Episode 595

MP3 File

Read more

Tagged with:

This post is part 78 of 81 in the series Programming by Stealth

For boring real-life reasons this instalment is a bit of an intermission. In the previous instalment we learned about so-called call-back hell, and were all set to learn how Javascript Promises would be our liberation, but that’s going to have to wait until next time. Promises are a very important concept, and I don’t want to rush them.

What we’re going to do in this instalment is focus entirely on my sample solution to the challenge set at the end of the previous instalment, which I’ve used as an opportunity to demonstrate two new tools to add to our programming tool belt — the micro-checking library is.js, and Bootstrap Popovers.

You can download this instalment’s ZIP file here.

Listen Along: CCATP Episode 593

MP3 File

Read more

Tagged with:

This post is part 77 of 81 in the series Programming by Stealth

My plans for this instalment were to quickly demonstrate so-called callback hell, and then move on to the solution, JavaScript Promises, but in light of some listener feedback I changed my plans a little. There was some confusion in the community about what callbacks really are, so, now seemed like an opportune moment to spend a little time re-familiarising ourselves with some callback basics. This sets things up for a bit of a teaser-ending because we’ll get as far as demonstrating callback hell, but not as far as using Promises to get back out of hell, that will have to wait until the following instalment!

You can download this instalment’s ZIP file here.

Listen Along: CCATP Episode 592

MP3 File

Read more

Tagged with:

This post is part 76 of 81 in the series Programming by Stealth

Having laid a very strong foundation in the previous instalment, we’re now ready to learn how to make HTTP requests with JavaScript using a technique known as AJAX.

We’ll start our journey into AJAX using more traditional JavaScript techniques, i.e. we’ll use callbacks to handle HTTP responses. As we’ll discover, this works very well for single AJAX requests, but the model really starts to get complicated when you have multiple inter-dependent requests. We won’t complicate things in this instalment though — we’ll start with just simple stand-alone requests this time.

You can download this instalment’s ZIP file here.

Listen Along: CCATP Episode 590

MP3 File

Read more

Tagged with:

This post is part 75 of 81 in the series Programming by Stealth

Having wrapped up our introduction to Mustache templates we’re going to spend the next few instalments learning about AJAX, a very powerful JavaScript technique for loading information from a given URL. In future instalments we’ll use this technique to load external templates and data for use with our Mustache templates.

AJAX is a mechanism for making a HTTP requests via JavaScript, so before we’re ready to learn about AJAX we need to take the time to learn about the HTTP protocol itself. Unless you understand the mechanics and the terminology of HTTP, AJAX-related documentation simply won’t make any sense.

Listen Along: CCATP Episode 589

MP3 File

Read more

Tagged with:

This post is part 74 of 81 in the series Programming by Stealth

In the previous instalment we got our first look at Mustache templates. In this instalment we’ll finish our look at this handy little third party library with a look at some of Mustache’s more advanced features. This will set us up perfectly to finally introduce AJAX into this series. This is an extremely common technique for fetching external resources with JavaScript. We’ll learn how to use AJAX to fetch both Mustache template strings and JSON data from URLs.

You can download this instalment’s ZIP file here.

Listen Along: CCATP Episode 587

MP3 File

Read more

Tagged with:

This post is part 73 of 81 in the series Programming by Stealth

In the previous instalment we took our first look at using templates with JavaScript to create cookie-cutter content like Toast notifications more easily than building them up piece-by-piece with jQuery. We started our exploration of the topic with a look at HTML5’s new <template> tag. In this instalment we’ll introduce a third-party templating tool, Mustache, and see how it can take our templates to the next level with concepts like conditional and looped sections.

You can download this instalment’s ZIP file here.

Listen Along: CCATP Episode 585

MP3 File

Read more

Tagged with:

A few days ago Facebook founder and CEO Mark Zuckerberg shared a lengthy post laying out the vision that will be driving his company’s implementation of private messaging going forward. There was a lot to like in that message from a privacy point of view, but the scope was limited — this was not a revolutionary vision for transforming all of Facebook, just for evolving their private messaging offerings.

Big-picture-wise the post laid out six principles that will drive the evolution of private messaging on all Facebook-owned platforms — private interactions, encryption, reducing permanence, safety, interoperability, and secure data storage. Note that the interoperability Zuckerberg describes is between Facebook-owned services, not between Facebook services and services from competitors, so that’s not actually good news from a privacy point of view. This refers to Facebook’s plans to merge private messaging within all its products into a single messaging architecture. This is a privacy loss not a privacy gain, but there is a silver lining — the post promises the merging will be opt-in, and users will be able to choose to keep separate identities on the separate services if they wish. Obviously encryption is good, as is not keeping privately shared stuff for ever.

But, does any of this change the fundamental problem, Facebook’s business model? Nope!

Facebook will continue to make its money by offering users a free service in exchange for their personal information — Facebook remains freepi (and creepy)!

Read more

Tagged with:

We call the common business model where you give users something for free, and more for money Freemium. It’s a nice simple portmanteau of free and premium.

There’s another business model I think we badly need a word for — the one where users get to use something at no financial cost, but are made to pay, knowingly or un-knowingly, with their personal information instead.

I’d like to propose the word Freepi, pronounced like creepy to describe this Free-for-Personal-Information business model. It’s a combination of the word free and the initials pi for personal information. The fact that many companies who employ this business model do really creepy things just makes the word that much more appropriate.

If you value your privacy, beware companies with freepi business models, they’re very likely to do creepy things!

Related Posts:

Anyone who listens to my podcast contributions is probably sick of hearing me repeat the mantra to follow the money. If you want to evaluate whether or not a given product or services is likely to present a privacy risk, you need to start by figuring out how it’s financed. Why? Because the financing sets up the incentives that will ultimately drive the provider’s behaviour. You’ll generally have a good experience with a product or service when the provider’s incentives align with your best interests, and conversely, things will almost certainly go south when the provider’s incentives are opposed to your best interests.

When you pay for a product or service things are usually straight forward — you are the customer, so the provider is incentivised to keep you happy so you’ll keep giving them your money. Things can of course go sour even with paid products or services when the price you pay is below the economic cost of the product or service (e.g. Amazon & Google smart speakers and TV dongles), or, when the market isn’t free, and you’re locked in to a single provider in some way (e.g. broadband in the US). But still, most of the time, if you’re both the user and the customer, your privacy is unlikely to be exploited.

Where things tend to get more complicated is when we’re not paying for products or services with money. That’s when you really need to pay close attention!

We very rarely get physical things for free, so in this post I’m only concerned with online services that are financially free to use.

We need to start by acknowledging the obvious fact that it costs money to run any online service, so if you’re not paying into the pot, someone else must be. Who ever that is, that’s who the people running the service are incentivised to keep happy. In other words, the service provider is strongly incentivised to align their actions with the interests of the people who pay them. When you figure out who that is, you can usually figure out the incentives, and whether or not they align with your best interests.

Remember, sooner or later, quickly or slowly, every organisation eventually follows the incentives acting on it. Incentives might not be fast-acting, but they are relentless, so movement is inevitable!

I want to suggest four simple categories you can group online services providers into to help you figure out the incentives at play, and whether or not they align with your best interests — free, freemium, free-for-now, and what I’ve decided to call freepi (pronounced like creepy). Yes, it will be an over-simplification, but that doesn’t mean it can’t be a useful lens to look at the world through. The real world may be messy and complex, but most things still approximate our crude categorisations!

Read more

Tagged with:

« go backkeep looking »