markjgsmith

2023/10/26 #

Jacascript async / await is worth the effort - For the longuest time I stuck with err first callbacks in javascript. They had already changed so many things while I was learning the language, and I was sick of it all. I figured it's all callbacks underneath anyhow, so I'll just stick with that. I was wrong.

Eventually after reading the entry level file in Eleventy I realised how I could use async / await to drastically simplify and make my code more readable. There are lots of things in Eleventy that I don't like, which is why I started writting my own static site generator, but the use of async / await and classes was eye openning for me.

It took a little getting used to it because there are a few gotchas but once you figure out how it fits in your code, it's dramatically better. Now when I read callback heavy code it looks so unbelievably ugly to me. I also started using classes. Not too much but in a few places and combined with async / await I found javascript actually starts to feel somewhat fun again.

I fucking hate Typescript though. Who knows maybe I'll be wrong about that someday. I'd love to be proven wrong. Happy to try it should the world allow me to compile again. #

Today’s links:

  • Israeli think tank lays out a blueprint for the complete ethnic cleansing of Gaza - This like a total blockage situation, it's horrible. My main concern is how to get the Gazan families to safety. Long term safety. The plan is basically a relocation plan, where they would all be moved to apartments in Egypt. When I hear the term ethnic cleansing I think of mass murders, which this isn't, but I guess technically it is a sort of ethnicity clense of the region. Isreali's can no longer sustain the terror attacks or constant threat of them in their back yard. One problem with the plan is not all apartments are built yet. I'd like to understand how the quality of life would be for them in Egypt. Would they all get full citizenship for instance? mondoweiss.net #

  • Short history of the bookmarklet - Bookmarlets are awesome, I have a few that I use regularly. Interesting history too, where they enhanced the address bar in Netscape Navigator v2 so that it recognised a URL protocol of 'javascript:' as being a script and then run the subsequent code on the current page. I imagine it was at the time quite a strange idea, but it quickly became very popular because similar to URLs they are easily shareable, and since you can drag them and store them in your bookmark bar, they are one-click. thehistoryoftheweb.com #

  • bbc/sqs-consumer - "Build SQS-based applications without the boilerplate. Just define an async function that handles the SQS message processing." - Looks like a very straight forward and useful library. github.com #

For enquiries about my consulting, development, training and writing services, aswell as sponsorship opportunities contact me directly via email. More details about me here.