Sponsored
TLDR WEB DEV 2024-10-03
Parse notes
- Subscription/account footer truncated before parsefooter_truncated
01GENERAL
02ARTICLES & TUTORIALS
THE HARDEST BUG INVESTIGATION OF MY CAREER AND THE INSANE CODE THAT CAUSED IT
A weird bug in an augmented reality system caused disorienting visual glitches and interestingly, only happened every Wednesday. After an extensive, months-long investigation involving robotic arms, lasers, and a high-FPS camera, the root cause turned out to be due to a time-translation hack using day-of-week words in German and English neglecting to account for the German word for Wednesday, "Mittwoch." This oversight led to timestamp discrepancies, resulting in the weekly glitches and an unpredictable error correction mechanism.
"WE RAN OUT OF COLUMNS" - THE BEST, WORST CODEBASE
This is the story of a massive, poorly designed legacy codebase with a chaotic database structure, including a table with a single column and row used for generating IDs and a manually-updated calendar table. The codebase itself was a mishmash of technologies, with a mix of VB and C#, various JavaScript frameworks, and even a shipping manager built in a weekend by a lone developer. Despite its flaws, developers found the chaotic nature of the system freeing, as they were forced to create isolated, independent solutions within the larger mess.
SERIALIZATION IS THE SECRET
JavaScript is a mutable programming language, while Elixir leans towards immutability. While both languages appear to have similar variable assignment behavior, Elixir achieves this through "rebinding," creating new variables with new values instead of mutating existing ones. This immutable approach, along with Elixir's process-based concurrency, eliminates the possibility of race conditions and unexpected state changes that are common in mutable languages.
03OPINIONS & ADVICE
HASH ORDERING AND HYRUM'S LAW
Hyrum's Law states that any observable behavior in a system, even if undocumented, will be relied upon by some users. This has massive consequences, especially during large-scale migrations, as users might depend on seemingly insignificant details like hash iteration order. One example is the iteration order of hash tables in Java, which is technically unspecified but often remains stable for years. This can lead to users inadvertently writing code that depends on the order, causing problems during Java version upgrades.
GOOD PROGRAMMERS WORRY ABOUT DATA STRUCTURES AND THEIR RELATIONSHIPS
Linus Torvalds (the creator of Git and Linux) says that data structures are more important than code in software development since good data structures lead to better code design and maintainability. This developer supports this view with personal experience, describing how restructuring data in a project allowed a team to move faster in the long run. The prioritization is also how Git grew to be the dominant version control system.
HEALTHY PERFORMANCE MANAGEMENT FOR ENGINEERS? IT'S POSSIBLE!
Traditional performance reviews can be ineffective for engineering roles. Instead, a better way to manage performance is by setting clear expectations while also being dynamic, since the nature of development is always changing.
04LAUNCHES & TOOLS
Sponsored
FREE VIRTUAL TICKETS TO CAMUNDACON NYC, THE ANNUAL PROCESS ORCHESTRATION CONFERENCE
IF YOU'RE INTO AUTOMATION — AS A SOFTWARE DEVELOPER, ARCHITECT, OR DIGITAL TRANSFORMATION EXPERT — YOU DON'T WANT TO MISS [14]CamundaCon [15]. Level up in technical sessions and business talks (including speakers from Gartner, Forrester, Capital One, and Walmart) and get new ideas for your automation projects. Join virtually for $0
TINYJS
TinyJS is a JavaScript library for dynamically creating HTML elements with deep property assignment. It makes DOM manipulation easier by allowing you to generate standard HTML tags programmatically, apply properties, append content, and select DOM elements.
ULTIMATE EXPRESS
Ultimate Express is a drop-in replacement for Express.js that offers faster performance using µWebSockets while maintaining full Express compatibility.
THE FASTEST MUTEXES
Cosmopolitan Libc's new mutex implementation is much faster than other popular libraries. One of the secrets behind the implementation is nsync, a C library written by a distinguished engineer at Google.
05MISCELLANEOUS
IN THE LAND OF LLMS, CAN WE DO BETTER MOCK DATA GENERATION?
Using LLMs to generate mock data has proven to be much harder than expected. A team explored using LLMs to generate Rust code for dynamic INSERT queries for their database platform, but found the generated code bad. Eventually, the team developed a hybrid approach, using LLMs to predict faker (Python package) methods for data generation while using topological sorting for accurate insertion order.
OFFLINE UX PATTERNS
Expensify's offline UX patterns prioritize "optimistic responses," assuming API requests will succeed when the user is back online and allowing them to proceed as if the action is complete. These responses can be incorporated with or without feedback, where the user is either aware or not aware that a request is pending and/or sent.
WEB SCRAPING WITH YOUR WEB BROWSER: WHY NOT?
Web scraping can be effectively done directly within a web browser, despite the widespread reliance on Python and other external tools. While limitations like CORS restrictions exist, they can be overcome with the use of proxy servers. This article shows a simple web scraper built entirely within a web browser using just a few lines of JavaScript code.
06QUICK LINKS
DON'T SLEEP ON ABORTCONTROLLER
AbortController is a JavaScript API that allows you to abort various operations like network requests, event listeners, and streams in a clean way.
WP ENGINE SUES AUTOMATTIC AND WORDPRESS FOUNDER (62 PAGE PDF)
WP Engine has sued Automattic and WordPress founder Matt Mullenweg for libel, slander, attempted extortion, unfair competition, and more.
WHY TCP NEEDS 3 HANDSHAKES
TCP requires three handshakes to establish a connection because it makes sure both parties confirm their ability to send and receive data.
ANGULAR ROUTING ESSENTIALS: ALL YOU NEED TO KNOW IN ONE POST
A comprehensive guide to Angular Routing that covers essential concepts like defining routes, links, and outlets and advanced features like data resolvers and route protection.