This post is part 21 of 21 in the series Programming by Stealth

In the previous instalment we took our first tentative steps into the browser. We learned about the Javascript console, the concept of the Document Object Model, or DOM, and we introduced the jQuery library.

Our initial introduction to jQuery was very superficial, now, it’s time to dive in deeper, and get much more rigorous in our understanding. We’ll look at how to use jQuery to select specific HTML elements on the page, and then, how to manipulate their styling, and their HTML attributes.

For this instalment we’ll still be using the Javascript console on the PBS dummy page. From the next instalment on, we’ll be embedding our JavaScript directly into our web pages, so this will be the last time we use the dummy page.

Read more

Tagged with:

This post is part 20 of 21 in the series Programming by Stealth

After six instalments, it’s finally time to bring our JavaScript knowledge into the web browser. We’ve already learned that HTML is used to specify the structure of a web page, and CSS to specify its appearance, so where does JavaScript come in? JavaScript’s primary use on the web is to add interactivity and/or automation of some kind. For example, clicking on something could cause the page to change in some way, or, icons could be automatically injected into the page to mark links that open in new tabs as being different to other links.

A key point to note is that HTML, CSS, and JavaScript are all so-called client-side technologies. It’s the web browser doing the work, not the web server. The web server simply delivers the HTML, CSS, and JavaScript code to the browser as text, just like you type it, and the browser then interprets that code and turns it into the web page you see and interact with.

Read more

Tagged with:

This post is part 19 of 21 in the series Programming by Stealth

While recording instalment 18 of the Programming by Stealth series, I promised Allison some challenges to help listeners test and hone their understanding of the core JavaScript language. Since we’ve now covered pretty much the whole language in the series, it’s the perfect time to pause and consolidate that knowledge.

These challenges are designed to be run in the PBS JavaScript Playground. You may also find the PBS JavaScript cheatsheet helpful.

Read more

Tagged with:

This post is part 18 of 21 in the series Programming by Stealth

We’ve now covered most of the core JavaScript language. We’ve learned that variables can store literal values, or references to objects. We’ve learned there are three types of literal values – numbers, booleans, and strings. We’ve learned about operators. We’ve learned about conditionals. We’ve learned about loops of various sorts, and we’ve learned about objects. We’ve learned that in JavaScript, arrays are implemented as objects with the prototype Array, and that functions are also implemented as objects.

Before we can leave the playground and head off into the world of the browser, we just have a few more loose ends to tie up, which we’ll take care of in this instalment.

Now that we know about objects, we need to re-visit the arguments object present in every JavaScript function. We need to take a detailed look at the typeof operator, and we need to look at some built-in objects and functions JavaScript provides.

We also need to look at how JavaScript handles regular expressions, and finally, we need to introduce the concept of exception handling.

Read more

Tagged with:

This post is part 17 of 21 in the series Programming by Stealth

At this stage in the series we have made very good progress towards understanding the core JavaScript language. However, there is still one very important piece missing – objects. We have mentioned them in passing in almost every instalment, and each time, we put them off until later. We finally remedy that in this instalment.

Read more

Tagged with:

This post is part 16 of 21 in the series Programming by Stealth

In the previous instalment we introduced the concept of JavaScript functions. We learned how to all existing functions, and how to create out own.

In this instalment we’re going to take our understanding of functions to the next level. The techniques we encounter today would be considered advanced techniques in most other languages, and you could spend years developing in Java and never encounter an anonymous function. However, because of how JavaScript is integrated into HTML documents, these techniques are considered fundamental in JavaScript, and anonymous functions are a dime a dozen!

Before we delve into anonymous functions, we’ll start by taking a deeper look at how JavaScript deals with function arguments.

Read more

Tagged with:

This post is part 15 of 21 in the series Programming by Stealth

At this stage we’ve learned about five key components to any programming language, and how they are implemented in JavaScript – variables, operators, branching, arrays, and loops. Now it’s time to add another – functions.

A function is a collection of statements that is given a name so it can be easily re-used. We’ve already used functions, but without knowing that’s what we’ve been doing.

Read more

Tagged with:

This post is part 14 of 21 in the series Programming by Stealth

At this stage we’ve learned about three of the key components common to just about every programming language, and how they’re implemented in JavaScript – variables, operators, and branching. Now it’s time to add two more – arrays, and loops.

Arrays store a list of related data in a single variable, and loops allow us to apply the same action over and over again. To process an arbitrarily long array, you need some kind of iteration, and loops are the simplest way of achieving that.

Read more

Tagged with:

Smiling a Little More

Filed Under Computers & Tech on April 12, 2016 | Leave a Comment

Since my initial, rather negative, reaction to Smile’s release of Text Expander 6, with it’s move to subscription pricing and forced use of their un-encrypted in-house cloud, Smile have announced some important changes.

Critically, they will continue to sell the non-cloud versions of their OS X and iOS apps (TE5 & TE3 respectively). This means that users can continue to use TextExpander for the foreseeable future, without having to trust their data to an un-tested and un-encrypted cloud. Smile have also addressed the cost issue by extending the 50% discount for existing users from 1 year to a lifetime.

It’s great to see Smile responding to their customers, and I think the price-drop for existing customers will resolve the cost issue for many people. It does for me.

Personally, I would like to be in a position to move to the new subscription version of the apps in the future, but I’m not going to feel comfortable doing that unless and until they address the privacy concerns I have about their current cloud design. I’m hopeful that they have heard that feedback too, and that encryption will show up on their cloud offering within the next year or so. If that comes to pass, I’ll happily make the switch.

I’m also hopefully that as Smile conduct their postmortem of this troubled launch, that they look again at how they use data from their support inbox when planning product changes. Support requests can serve as a good metric for what new features would be of the most value, but they provide no information at all about the relative importance of existing features. Text Expander 6 removed an existing feature, DropBox/iCloud sync, to facilitate the addition of a new feature, sharing. The support mailbox provided evidence of the desire for the new feature, but the value of the old seems to have come as a complete surprise to Smile! You simply cannot infer the value of existing features from support inboxes of Twitter feeds – the only way to figure that kind of thing out is to ask users, or to run betas. Smile kept all this totally secret until they had made a massive investment of time and resources. A mistake IMO, but then again, I am only an armchair CEO, and it’s not my livelihood that’s on the line!

The bottom line is that Smile have clearly been paying attention to the feedback, which can only be a good thing.

Tagged with:

This post is part 13 of 21 in the series Programming by Stealth

In the previous instalment we got our first taste of JavaScript. We learned about variables, literal data types, and some basic string and arithmetic operators. In this instalment we’re going to focus on booleans. We’ll look at how non-boolean values get converted to booleans when needed (e.g. is 'boogers' true or false?), we’ll learn about some comparison operators that result in boolean values, and we’ll learn about some logical operators. At that stage we’ll have all the knowledge we need to learn about our third fundamental programming concept – branching.

Read more

Tagged with:

keep looking »