Sat 14 Jan 2023

Formalizing f-strings

Python's formatted strings, or "f-strings", came relatively late to the language, but have become a popular feature. F-strings allow a compact representation for the common task of interpolating program data into strings, often in order to output them in some fashion. Some restrictions were placed on f-strings to simplify the implementation of them, but those restrictions are not really needed anymore and, in fact, are complicating the CPython parser. That has led to a Python Enhancement Proposal (PEP) to formalize the syntax of f-strings for the benefit of Python users while simplifying the maintenance of the interpreter itself.

Source: Formalizing f-strings, an article by Jake Edge.

Javascript Hoisting: Thank you for nothing

As a JavaScript developer, I’m sure you’re well aware of the “joy” that is hoisting. But in case you need a refresher, hoisting is the behavior in JavaScript where variables and functions are automatically moved to the top of their scope before code execution.

Now, some might argue that hoisting is a useful feature, allowing us to reference variables and functions before they are actually declared in our code. But let’s be real here: the cons far outweigh the pros when it comes to this “feature.”

Source: Javascript Hoisting: Thank you for nothing, an article by Krishna Singh.