Urgent.News

What's breaking now, across thousands of outlets.

Tech

It is really hard to write good software in Javascript

Six years of building Golang services gave me fewer race conditions than one year of writing Javascript. I have spent that year on vidstudio.app , an in browser client only video editor, which means I have had to write a lot of Javascript and have come to the conclusion that it is in fact a challenging language to master. The worst part is how easily I got there. Most of those races I introduced…

Despite six years of experience building Golang services, the author found that writing Javascript for vidstudio.app, an in-browser video editor, presented significant challenges. The worst of it was the ease at which race conditions occurred, often unnoticed. The author's most enlightening experience came when replacing a dependency in the export pipeline, which involved demuxing, decoding, drawing, applying effects, encoding, and assembling a video file.

The original dependency, mp4box.js, was a demuxer but also capable of muxing, returning a synchronous result which simplified the coding process. However, the new muxer, mediabunny, returned a promise, forcing the author to explicitly handle the sequencing of the assembly process. This change highlighted the stark contrast between Javascript's asynchronous nature and the more predictable linear execution of languages like Golang, C++, C#, and Java.

Javascript's asynchronous I/O operations, even when not desired, necessitate explicit handling to maintain correct and efficient code. The author emphasizes the importance of understanding Javascript's event loop, which manages asynchronous operations, but notes that it adds an additional layer of complexity compared to other runtimes.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Performance no front só é Staff se a conversão sobe

Pessoal, eu ia vender Vue 3. Checkout de infoproduto. Alto volume. Micro frontend. Campanha de influenciador no ar. Timeout. Transbordo. O time discute Lighthouse e Nuxt. A pergunta não era o score.

  • Performance matters only if it boosts conversions
  • Focus on JavaScript delivery and funnel stability
  • Four optimization strategies increase conversions by 10%

97% Cars in Pakistan Have No Insurance

Only 3 percent of vehicles in Pakistan are insured, TPL Insurance CEO Muhammad Aminuddin said on Tuesday. Speaking during a … Read More The post 97% Cars in Pakistan Have No Insurance appeared first…

How I Choose a Library Before Adding It to a Project

Downloads, maintenance, framework support, API, styling and the one thing I really don't want to do - reverse-engineer a library just to use it When I started working with frontend libraries, my…

  • Examine library popularity via npm download statistics
  • Check date of latest version release for activity
  • Verify library supports chosen framework like React

More from Tuesday 15 September →