I just started a plain typescript project, and was too lazy for a docker setup so I just installed Node with apt and went on my way.
I installed Typescript, that went fine, but when trying to use it it gave a vague error.
Quick search fixed it, but... I'm amazed by the cause: Typescript didn't support the version of Node I had installed, which sure.. That's okay. But why didn't NPM tell me this? NPM does not have node version constraints?!?
@thomastospace every time I try another language, I feel blessed that I'm able to work with the most powerful and reliable package manager of the world. Nothing beats #composer
The life of a maintainer (and generally any back-end engineer) - if your existence is acknowledged, something's probably gone wrong! I feel you, @jrf_nl
Thank you to all of the package maintainers out there 💕
I've just seen a #programming pattern in #PHP where a method could return two lists of things. Instead of doing that, it takes as a parameter a callable, and passes the two lists to the callable. Instead of:
[$a, $b] = getLists($param);
// Act on both lists.
we have:
$callable = function($a, $b) {
// Act on both lists
}
actOnLists($param, $callable);
If you haven't picked up a free copy of my book, Mastering Object-Oriented PHP, make sure you head over to https://masteringobjectorientedphp.com and get your copy today! Free is my way of giving back to the PHP community.