In continuing this series of posts about functional JavaScript (one, two), I whimsically wondered if we could apply the SOLID principles of object-oriented programming. We took a look at S last time (the Single Responsibility Principle), and were fairly successful. The principle I introduced there was not only that the functions we write should do one thing and do it well. If we can embrace global immutability, so much the better (in other words, the function should not have side effects). Small functions of this type are also well worth writing since they help document the code via their names. It’s now time to look at O, the Open/Closed Principle. […]
READ MOREToday so far has been a comedy of errors with some web programming I wanted to do. A confederacy of dunce issues, one after the other. […]
READ MOREYesterday evening as I was putting to bed a few changes to this blog’s JavaScript (that would provide fodder for my continuing series on functional JavaScript), I decided to update the version of JSLint I was using in Sublime Text. When I had done so, suddenly my JavaScript file produce a huge slew of warnings that had not been there before. Whaaaat? […]
READ MOREOK, so this afternoon I got bitten by an issue that has bitten a gazillion web developers (and will probably continue to bite more in the future). I’m talking about the syntax for the callback function that’s used for jQuery.each()
versus that for JavaScript’s Array.prototype.forEach()
. They are, dear reader, not the same. […]
OK, call me dense. I had a problem: the new theme I have for this blog has cute little buttons for the social networks I belong to and use; they’re at the bottom of every page. Internally they use Font Awesome to deliver the individual icons. On my desktop browsers: no issue, they look great. On my iPhone? What. The. Heck. […]
READ MOREOver the New Year break, I decided it was time for a change here on the Algorithms for the Masses blog. Not necessarily a full-blown New Year Resolution, more a general feeling that the current theme was old in the tooth, had accumulated a whole bunch of cruft (and how!), and it was time to chuck it in the bin of history. Time for something clean, and, horror, responsive. […]
READ MOREBack in March last year I presented an implementation of Heap’s Algorithm – an algorithm devised to generate all permutations of a set of items – in JavaScript. The article was interesting to write because in doing so I had found a bug in the pseudo-code on the Wikipedia page for the algorithm, which led to a discussion with the main editor for the page on how to make it better. […]
READ MOREJust a very small post, this, to announce that I’m now using Open Live Writer (OLW) as my blogging tool. Maybe not all the time, at least for the next couple of weeks. You could say that I’m still experimenting with the plug-ins I have for Windows Live Writer (WLW), so no code snippet blocks yet or “Now Playing”. Those are to be tested and played around with some more before I really jump in with both feet and uninstall WLW. […]
READ MOREA couple of months ago, I was on a “Update All The Things” spree with my websites. In one of them, the blog I have for my Volvo 1800S, I’m using a purchased theme that I’ve left pretty much alone. It’s fine as far as it goes, a bit inefficient, but it did serve as a basis for my articles here on speeding up web pages (1, 2, 3). After I had written those it was time to fix the problems with the theme. […]
READ MOREAlthough this certainly didn’t all come about from the get-go, this is a fun little graphic for the different ways to contact me: […]
READ MORE