Refactoring in Rust: Introducing Traits
In the same codebase as last time, we extract data from a HashMap<String, String> called headers, presumably dealing with something similar to HTTP headers.
View ArticleRefactoring in Rust: Abstraction with the Newtype Pattern
The following piece of code takes a PathBuf and extracts the file name, eventually converting it to an ownedString.
View ArticleAnnouncing the TypeScript Cookbook
Oops, I did it again! I’m writing another book, and it’s again about TypeScript. I’m happy to announce The TypeScript Cookbook, to be published in 2023 by O’Reilly. You can check it out in Early...
View ArticleTypeScript: Iterating over objects
There is rarely a head-scratcher in TypeScript as prominent as trying to access an object property via iterating through its keys. This is a pattern that’s so common in JavaScript, yet TypeScript seems...
View ArticleThe road to universal JavaScript
Universal JavaScript. JavaScript that works in every environment. JavaScript that runs on both the client and the server, something thinking about for years (see 1, 2). Where are we now?
View Article10 years of fettblog.eu
I missed a little anniversary. Roughly 10 years ago (on April 8, 2012), I started blogging on fettblog.eu! Time flies! I think this is my longest-running project, let’s take some time to reflect.
View ArticleRust: Tiny little traits
Rust’s trait system has a feature that is often talked about, but which I don’t see used that often in application code: Implementing your traits for types that are not yours. You can see this a lot in...
View ArticleIntroduction to Yeoman
A few weeks ago I did a short talk on Yeoman at the Linzer edition of Codeweek and how it helps us in our daily workflow. For the first time I tried to have some sort of script, and afterwards I even...
View ArticleThe TypeScript converging point
Usually, when doing TypeScript talks, I just open up a code editor and hack away some cool types that help in a certain scenario. This time, I was asked to do the same thing but within a 20-minute time...
View ArticleHow not to learn TypeScript
“TypeScript and I are never going to be friends”. Oh wow, how often have I heard this phrase? Learning TypeScript, even in 2022, can be frustrating it seems. And for so many different reasons. People...
View ArticleGetting started with Rust
Learning and teaching Rust has been a big part of me in the last couple of years. Interest in the Rust programming language has brought me to found the Rust Linz meetup with Rainer Stropek, to teach...
View ArticleIntroducing Slides and Coverage
There’s a new section on this website! Since today, you’re able to see full coverage of my workshops and talks in the new slides and coverage section. That’s the announcement. If you want to see more,...
View ArticleTypeScript: The humble function overload
With the most recent type system features like conditional types or variadic tuple types, one technique to describe a function’s interface has faded into the background: Function overloads. And there’s...
View ArticleTypeScript + React: Children types are broken
I currently work with a couple of newcomers to React and teach them both TypeScript and React to create apps. It’s fun, and for me who’s been using that for a while now, it’s a great way of seeing this...
View ArticleTypeScript: In defense of any
A couple of days ago I found this beauty on the internet: Give up and use any. That’s a fantastic website, absolutely hilarious! It also shows how much TypeScript has grown in popularity. You have to...
View ArticleRust: Enums to wrap multiple errors
This is a follow-up to Error handling in Rust from a couple of days ago. The moment we want to use error propagation for different error types, we have to rely on trait objects with Box<dyn...
View ArticleDissecting Deno
I had the chance to toy around with Deno recently. And with “toy around” I mean dissecting it into little pieces and see how the sausage was made. So, my view is not from a user’s perspective who wants...
View ArticleError handling in Rust
I started doing university lectures on Rust, as well as holding workshops and trainings. One of the parts that evolved from a couple of slides into a full-blown session was everything around error...
View ArticleTypeScript: Unexpected intersections
Sometimes when writing TypeScript, some of the things you’d usually do in JavaScript work a little different and cause some weird, and puzzling situations. Sometimes you just want to assign a value to...
View ArticleUpgrading Node.js dependencies after a yarn audit
It’s Tuesday! The day of your weekly dependabot alerts from GitHub! A nice reminder to check on your projects, and usually just a few clicks worth of work, the automatic update is wonderful.
View Article