Developers Rail Against JavaScript ‘Merchants of Complexity’ - The New Stack
Perhaps the tide is finally turning against complex web frameworks.
Perhaps the tide is finally turning against complex web frameworks.
It me:
Broadly, these are websites which are still web pages, not web applications; they’re pages of essentially static information, personal websites, blogs, and so on, but they are slightly dynamic. They might have a style selector at the top of each page, causing a cookie to be set, and the server to serve a different stylesheet on every subsequent page load.
This rings sadly true to me:
Suppose a company makes a webpage for looking up products by their model number. If this page were made in 2005, it would probably be a single PHP page. It doesn’t need a framework — it’s one SELECT query, that’s it. If this page were made in 2022, a conundrum will be faced: the company probably chose to use a statically generated website. The total number of products isn’t too large, so instead their developers stuff a gigantic JSON file of model numbers for every product made by the company on the website and add some client-side JavaScript to download and query it. This increases download sizes and makes things slower, but at least you didn’t have to spin up and maintain a new application server. This example is fictitious but I believe it to be representative.
Also, I never thought about “serverless” like this:
Recently we’ve seen the rise in popularity of AWS Lambda, a “functions as a service” provider. From my perspective this is literally a reinvention of CGI, except a) much more complicated for essentially the same functionality, b) with vendor lock-in, c) with a much more complex and bespoke deployment process which requires the use of special tools.
I probably need to upgrade the Huffduffer server but Maciej nails why that’s an intimidating prospect:
Doing this on a live system is like performing kidney transplants on a playing mariachi band. The best case is that no one notices a change in the music; you chloroform the players one at a time and try to keep a steady hand while the band plays on. The worst case scenario is that the music stops and there is no way to unfix what you broke, just an angry mob. It is very scary.
Okay, I knew about the Python shortcut—I mentioned it in Going Offline—but I had no idea it was so easy to do the same thing for PHP. This is a bit of a revelation for me!
Once in the desired directory, run:
php -S localhost:2222Now you can go to “localhost:2222” in your browser, and if you have an index.html or .php file in your root directory, you’re in business.
The title is overkill, but these functions ported from PHP to JavaScript could be useful (especially for dealing with arrays).
Matt writes about the pleasure of independent publishing on the web today:
It feels transgressive to have a website in 2017. Something about having a domain name and about coding HTML which is against the grain now. It’s something big companies do, not small groups. We’re supposed to put our content on Facebook or Medium, or keep our publishing to an email newsletter. But a website?
But he points out a tension between the longevity that you get from hosting the canonical content yourself, and the lack of unified analytics when you syndicate that content elsewhere.
There’s no simple online tool that lets me add up how many people have read a particular story on Upsideclown via the website, the RSS feed, and the email newsletter. Why not? If I add syndication to Facebook, Google, and Apple, I’m even more at sea.
A nice little use of print (and screen) styles from Bastian—compose letters in a web browser.
Instead of messing around in Word, Pages or even Indesign, you can write your letters in the browser, export them as HTML or PDF (via Apple Preview).
Regular expressions are my kryptonite so I can definitely imagine using the PHP port of this plain English syntax.
I think there’s a lot of truth to this. By any objective measurement, PHP is clearly inferior to just about every other programming language out there …but its preinstalled out-of-the-box nature means it’s the path of least resistance.
A really handy command-line tool that scans your site for mixed content — very useful if you’re making the switch from http to https.
Rachel talks about some of the old-fashioned technologies and business practices driving Perch.
This reminds of a talk by Marco Arment at Webstock a few years back when he described the advantages of not using cutting-edge technologies: most of the time, “boring” well-established technologies are simply more stable.
A new PHP-based content management system. It uses Twig for the templating, which I like.
If you’re trying to retrofit an existing desktop-centric site for small screens, this server-side image-resizing technique might be useful but is definitely not the right tool for a content-out, small-screen-first approach.
This could be handy for the editing process in my home-grown blogging system: a PHP script to convert HTML back to Markdown.
Since Amazon decided to require signed requests for its API, I'm going to have to use this code to keep Huffduffer and The Session working. Grrrr... cool APIs don't change.
A whole heap of optimisation techniques from Google for faster CSS, JavaScript, markup and PHP.
A PHP script that adds nice typography to your markup.
Wait... I thought this was considered harmful?
Drew and Rachel's little CMS looks very nice indeed.
John Gruber provides a PHP-based way of busting out of Digg's 90s-style framing. I shall be implementing this forthwith.