Better HN
topnewbestaskshowjobs
Log inSign up

hnatiukr

3 karma · joined Feb 15, 2024 (2y ago) · 3 submissions

Submissions

comment 1y ago · link · parent

It is a playground library that closely mirrors Rust's `Option` and `Result` API. While created primarily for fun and learning, it's robust enough for real-world applications. It allows for safer, more expressive handling of optional values through a monadic interface. snake_case is used for the plausibility of the original.

The name `unwrap-or` is a playful reference to both the `unwrap_or` method found in the `Option`/`Result` types, and a hint at the package's contents - "-OR" standing for O'ption and R'esult types. It also cleverly references the logical `OR` operation, reflecting how these monadic types encapsulate one of two possible states - either `Some` or `None` for `Option`; either `Ok` or `Err` for `Result`.

2.

unwrap-or: a TypeScript implementation of Rust's Option and Result types(github.com ↗)

3 points · by hnatiukr · 1y ago · 1 comment

comment 2y ago · link · parent

> Oh, and everyone wrote HTML tags in all caps. I don’t remember why we all thought that was a good idea. Maybe this was before syntax highlighting in text editors was very common (read: I was 12 and using Notepad), and uppercase tags were easier to distinguish from body text.

The use of uppercase HTML tags in the early days wasn't primarily due to memory concerns. It was more about readability and consistency. As HTML evolved, lowercase tags became the standard for better readability and compatibility with XML.

Another point that in the early days of computing, memory was a precious resource, and every byte mattered. Some developers believed that using uppercase characters could save memory because uppercase letters have simpler representations in ASCII, occupying fewer bits. However, this difference was extremely marginal and hardly made a noticeable impact on memory usage.