This via Hacker News today: Minimal CSS Framework for semantic HTML.
Category Archives: Web
Principles & Best practices of REST API Design
Some thinking points for service design: Principles & Best practices of REST API Design.
100+ Internet Statistics And Facts For 2021
Ran into this: 100+ Internet Statistics And Facts For 2021.
cgi-bin example
------------------- Sun Nov 21 14:08:26 [bash:5.0.17 jobs:0 error:0] root@tact:/usr/lib/cgi-bin # cat test.sh #!/bin/bash echo 'Content-Type: text/plain' echo '' echo 'test' -------------------
The relevance of PHP
Seen today: Yes, PHP is Worth Learning/Using in $CURRENT_YEAR. There’s some good discussion on some of the more recent PHP language features and other notes about what’s available in the broader ecosystem.
Tailwind CSS
Getting ready to use Tailwind CSS in anger. I like their headline: “Best practices” don’t actually work.
InfoWorld articles
Today I discovered InfoWorld with these articles:
- Complexity is killing software developers
- Why you should use a microservice architecture
- No one wants to manage Kubernetes anymore
And a bonus article from Spotify: How We Use Golden Paths to Solve Fragmentation in Our Software Ecosystem .
Also, I should note, I very much like the InfoWorld URL format: https://www.infoworld.com/article/3614850/no-one-wants-to-manage-kubernetes-anymore.html — this is the same URL structure I use in my own designs.
Time To First Byte
This was suggested on #lobsters today:
$ curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" https://www.progclub.org/
Bad web services API
I’m reading RESTful Web Services Cookbook and on page 17 the author gives this example:
# Request POST /user/smith HTTP/1.1 Host: www.example.org Content-Type: application/xml;charset=UTF-8 Slug: Home Address <address><street>1, Main Street</street><city>Some City</city></address> # Response HTTP/1.1 201 Created Location: http://www.example.org/user/smith/address/home_address ...
There are two problems with this: the first is that “POST /user/smith” has the semantics “register address”, so it would be better if that was clear; the second is that some of the input to the business process is in the XML payload, while some of it is in the HTTP headers (viz Slug). It would be better if all the input was in the payload.
So how would I design this service?
# Request POST /api/v1/processor HTTP/1.1 Host: www.example.org Content-Type: application/x-www-form-urlencoded action=register_address&user=smith&street=Main+Street&city=Some+City&type=home_address # Response HTTP/1.1 303 See Other Location: http://www.example.org/user/smith#home_address
Actually in my designs the /api/v1/processor could be anything, including /user/smith, because the business process is indicated in the request ‘action’ with is submitted with POST. Just like God intended. Idempotency, optimistic concurrency control, authentication, authorisation, auditing, version control, all that good stuff implemented with business logic via business process for ‘register_address’.
Documenting APIs: A guide for technical writers and engineers
Today I discovered: Documenting APIs: A guide for technical writers and engineers.