Recent submissions

Comment · 2 months ago
I have a slight visual disability, so I kept wanting to read this on my e-reader at my own font size instead of clicking through dozens of pages on a bright screen. That's why I built a script that pulls the docs straight from the w3c/wcag repo and produces both an EPUB and a PDF/UA-1 file.

Getting the PDF properly tagged (real heading structure, reading order, language, alt text carried through) felt like the bare minimum for this particular document. :-)

Planning to open source the build script once it's a little more mature.

Comment · 1 year ago
Learn how a ClockInterface helps you decouple time and write stable, testable code.
Comment · 1 year ago
Comment · 1 year ago
I agree, but I had to draw the line somewhere on this article as it was already getting pretty long. And since I'm tackeling concurrency in the next post, it made more sense to me to start talking more about async there, with examples. Bear with me. Once that post is out, I'm updating this one which will reference the other for async examples. Thank you for your feedback!
Comment · 1 year ago
Just to clarify my intent with posts like this:

I'm not suggesting that PHP is the ideal tool for every use case. The goal is to share a concept that might be unfamiliar to some developers, using PHP as the context.

Sometimes learning about a concept in a familiar language helps you recognise where it might be useful elsewhere or apply it in a language that supports it better.

Terms like coroutines, concurrency, promises, etc, can be confusing; I just like to demystify them with easy-to-grasp examples. That does mean that examples can be contrived or very simple, but they are designed to get the point across.

Thanks for all the comments so far!

Comment · 1 year ago
Yes, there is! However, even if the `iterable` it was yielding from a different Generator, the "outer" generator would still be "running", which still makes it asymmetrical. `yield from` is mentioned in the other post on Generators, though.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton