https://radekmie.dev/atom.xml@radekmie@radekmie’s take on IT and stuff2024-02-29T00:00:00+00:00Radosław Miernikhttps://radekmie.dev/blog/on-getting-paid-for-open-source/On Getting Paid for Open Source2024-02-29T00:00:00+00:00<p>When it comes to open source, I consider myself lucky. One, I authored a few <em>(arguably)</em> successful projects, e.g., <a rel="noopener nofollow" target="_blank" href="https://github.com/vazco/uniforms">uniforms</a>. Two, I worked my way to being a recognized <em>(arguably)</em> community member and core contributor, e.g., in <a rel="noopener nofollow" target="_blank" href="https://github.com/meteor/meteor">Meteor</a>. Three, I’ve been getting paid to do it since July 2015.</p> <p>In this text, I’ll go through my open source story and my view on different financing models I encountered along the way. The market is much harder today than it was a couple of years ago, but it may serve as an idea to pursue such financing yourself.</p>https://radekmie.dev/blog/on-apple-shortcuts/On Apple Shortcuts2024-01-25T00:00:00+00:00<p>Have you heard of <a rel="noopener nofollow" target="_blank" href="https://support.apple.com/en-gb/guide/shortcuts/welcome/ios">Apple Shortcuts</a>? It’s an app available for all Apple devices designed to automate <em>stuff</em>. I’d never really used it before last year, but I found it somehow… Refreshing? As a developer, I’m rather used to <em>writing</em> code and not <em>wiring</em> it in <a rel="noopener nofollow" target="_blank" href="https://scratch.mit.edu">Scratch</a>-like blocks. The latter turned out to be more fun than I first anticipated, so I dug in more.</p>https://radekmie.dev/blog/on-breaking-the-routine/On Breaking the Routine2023-12-31T00:00:00+00:00<p>This year was different. I don’t do New Year’s resolutions, but I do like to recap what happened. Not to bash myself, <em>“I could have done X!”</em> (let’s leave it for the third season of <a rel="noopener nofollow" target="_blank" href="https://en.wikipedia.org/wiki/What_If...%3F_(TV_series)"><em>“What If…?”</em></a>), but to make sure I’ll keep doing things that are good for me. Or simply more things I like.</p> <p>If you’re reading my blog to learn about things, then feel free to skip this one. There’s nothing new here, just me rambling about how happy I am with my life at the moment. Weird flex, huh?</p>https://radekmie.dev/blog/on-asynchronicity-in-blaze-again/On Asynchronicity in Blaze (again)2023-11-30T00:00:00+00:00<p>Half a year ago, I left a list of a few open topics in <a href="https://radekmie.dev/blog/on-asynchronicity-in-blaze/"><em>On Asynchronicity in Blaze</em></a>. While some stayed where they were, suggesting that the initial ideas were <em>fine</em> and nobody had issues with them, we made some progress overall. In this post, I’ll focus on what happened and what is being looked into.</p> <p>However, consider this an extension of the previous article. If you have never heard of <a rel="noopener nofollow" target="_blank" href="https://www.blazejs.org">Blaze</a>, I highly recommend at least skimming through it. It won’t be technical, but it may seem weird initially if you worked only with React or Vue.</p>https://radekmie.dev/blog/on-why-resumes-are-terrible/On Why Resumes Are Terrible2023-10-30T00:00:00+00:00<p><em>’Tis the season</em>, my friends. I once again reviewed more than two hundred resumes in less than two weeks. And no, I’m not a recruiter nor doing it full-time; otherwise, it’d take me less than a day or two <em>(or at least I was told so)</em>.</p> <p>Luckily for me, I’m also doing the technical interviews later, sometimes also the cultural ones or negotiations. I said luckily, because I have direct feedback on whether the resume I approved turned out to be a reasonable candidate.</p> <p>But even though I went through more than seven hundred resumes in my life (I’m not keeping count, but I have some events to estimate it), it still feels more like a hunch and not experience. Let’s call it a <em>well-trained hunch</em> for now.</p> <p>Now let me explain why every single one of them was terrible.</p>https://radekmie.dev/blog/on-webassembly-in-meteor/On WebAssembly in Meteor2023-09-28T00:00:00+00:00<p>Last month, in <a href="https://radekmie.dev/blog/on-css-modules-in-meteor/"><em>On CSS Modules in Meteor</em></a>, I posted a step-by-step guide on creating a <a rel="noopener nofollow" target="_blank" href="https://github.com/meteor/meteor">Meteor</a> build plugin for <a rel="noopener nofollow" target="_blank" href="https://github.com/css-modules/css-modules">CSS Modules</a>. Here’s a reasonably short follow-up for <a rel="noopener nofollow" target="_blank" href="https://webassembly.org">WebAssembly</a>, allowing us to easily integrate C++ or Rust code.</p>https://radekmie.dev/blog/on-css-modules-in-meteor/On CSS Modules in Meteor2023-08-30T00:00:00+00:00<p>We recently started working on a design system in a <a rel="noopener nofollow" target="_blank" href="https://github.com/meteor/meteor">Meteor</a> app. One of the most important decisions we had to make was deciding on <em>how</em> we are going to style it. Plain CSS or <a rel="noopener nofollow" target="_blank" href="https://sass-lang.com">SCSS</a>? CSS-in-JS, and if so, <a rel="noopener nofollow" target="_blank" href="https://css-tricks.com/a-thorough-analysis-of-css-in-js/">which library</a>? Or <a rel="noopener nofollow" target="_blank" href="https://tailwindcss.com">Tailwind CSS</a>? All of those options have their ups and downs, and we ended up with…</p> <p>None of the above. We decided to go with <a rel="noopener nofollow" target="_blank" href="https://github.com/css-modules/css-modules">CSS Modules</a>, i.e., plain CSS but with locally-scoped class names. On top of that, we decided to use the <a rel="noopener nofollow" target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/--*">CSS Custom Properties</a>, a.k.a. CSS variables. It all plays well with <a rel="noopener nofollow" target="_blank" href="https://www.figma.com">Figma</a>, so collaboration with our designer is even easier.</p> <p>Great! Now let’s set it up in our app… There’s <a rel="noopener nofollow" target="_blank" href="https://github.com/akanix42/meteor-css-modules"><code>nathantreid:css-modules</code></a>; let’s give it a try. It <em>works</em>, though it hasn’t been maintained for more than five years now. Normally, it’s not a problem for me, but it depends on <a rel="noopener nofollow" target="_blank" href="https://github.com/akanix42/meteor-css-modules/blob/98e335b45f6ebd23f4dc81943e6d57af2b016021/package.js#L19-L38"><em>really</em> old npm packages</a>, and that’s a compatibility problem with the rest of the app.</p> <p>That’s why we’re going to make our own.</p>https://radekmie.dev/blog/on-oplog-replacement-in-meteor/On Oplog Replacement in Meteor2023-07-27T00:00:00+00:00<p>Before I started working with <a rel="noopener nofollow" target="_blank" href="https://www.meteor.com">Meteor</a> back in 2015, basically every single web app I had ever worked with was either entirely static or refreshing periodically (e.g., using <a rel="noopener nofollow" target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/Guide/AJAX">AJAX</a>). Meteor was different – every database change was available in the browser <em>instantly</em>, moments after it happened.</p> <p>The best part is it takes <em>no code</em> to make it work. <a rel="noopener nofollow" target="_blank" href="https://docs.meteor.com/api/pubsub.html#Meteor-publish">Publish</a> some subset of the database on the server, then <a rel="noopener nofollow" target="_blank" href="https://docs.meteor.com/api/pubsub.html#Meteor-subscribe">subscribe</a> to them on the client, and that’s it; both client and server code is as simple as a single MongoDB query. Thanks to the isomorphic (<a rel="noopener nofollow" target="_blank" href="https://guide.meteor.com/structure.html#meteor-structure"><em>universal</em></a>) code, it can be the exact same query on both ends.</p> <p>As you may have guessed, it comes with a cost. Not a <em>problem</em> per se but rather a non-trivial performance penalty you must keep in mind while scaling your app. Let’s dive into how it works and what we can do about it.</p> <p>So, how does Meteor do it?</p>https://radekmie.dev/blog/on-backup-access-rights/On Backup Access Rights2023-07-08T00:00:00+00:00What could happen if some people I work with went rogue? Not that I expect it to happen, but it’s… Well, <em>not impossible</em>.</p>https://radekmie.dev/blog/on-asynchronicity-in-blaze/On Asynchronicity in Blaze2023-05-26T00:00:00+00:00<p>If I had to pinpoint a single biggest change in the way I write frontend code in recent years, I wouldn’t yell <em>“React!”</em> nor any other view library of framework in particular. Instead, I’d say it’s the way we handle asynchronous operations today. Whether it’s <a rel="noopener nofollow" target="_blank" href="https://react.dev/reference/react/Suspense"><code><Suspense></code> in React</a> or <a rel="noopener nofollow" target="_blank" href="https://vuejs.org/guide/built-ins/suspense.html">Vue</a>, <a rel="noopener nofollow" target="_blank" href="https://svelte.dev/docs#template-syntax-await"><code>#await</code> in Svelte</a> or <a rel="noopener nofollow" target="_blank" href="https://angular.io/api/common/AsyncPipe"><code>async</code> pipe in Angular</a>, every single one is great in its own way.</p> <p>I’m not saying we’re done with them either – <a href="https://radekmie.dev/blog/on-throw-in-react/">React <code>throw</code>s <code>Promise</code>s around</a>, Svelte (in SSR mode) won’t wait for them anyway, and Vue calls it experimental. A lot of effort went already in, but there’s a lot more to come – both from the maintainers and the users. And beta testers, of course.</p> <p>But not all view layers have caught up yet. If you worked with Meteor, you’ve most likely heard of <a rel="noopener nofollow" target="_blank" href="https://www.blazejs.org">Blaze</a>. If you didn’t, it’s basically a templating system, just like <a rel="noopener nofollow" target="_blank" href="https://mustache.github.io">Mustache</a>, <a rel="noopener nofollow" target="_blank" href="https://handlebarsjs.com">Handlebars</a>, or <a rel="noopener nofollow" target="_blank" href="https://jinja.palletsprojects.com">Jinja</a>. Its two main points are its reactivity model based on Meteor’s <a rel="noopener nofollow" target="_blank" href="https://docs.meteor.com/api/tracker.html">Tracker</a> and a direct DOM manipulation – just like Angular, React, Vue, or Svelte. <em>(In contrary to generating static HTML.)</em></p> <p>It’s about to change, and here’s how we did it.</p>https://radekmie.dev/blog/on-business-intelligence/On Business Intelligence2023-04-28T00:00:00+00:00<p>If there’s data, there’s a reason to look into it – that’s a fact. Business intelligence (BI for short) is virtually everything that helps your business thrive using the data you have (or can have). And even though hiring a psychic to analyze your database is also <em>technically</em> a BI technique, I would rather recommend starting off with a plain old and boring chart instead.</p> <p>Before we dive into the topic, let’s make it clear – BI tools are just tools. That is, they can help you answer questions and navigate through the toughest decisions. But it is <em>you</em> who use them, and it is <em>you</em> who ask questions. Sure, you can outsource it or hire a professional to help you with that, but they won’t read your mind. <em>(That’s where the psychic comes in.)</em></p> <p>But let’s start with the basics.</p>https://radekmie.dev/blog/on-jira-for-developers/On Jira for Developers2023-03-30T00:00:00+00:00<p>Whether you’re working in a small, medium, or <em>massive</em> company, you’ve almost certainly encountered <a rel="noopener nofollow" target="_blank" href="https://www.atlassian.com/software/jira">Jira</a> or any other “issue tracker” already. Many people sincerely hate them for thousands of reasons, and I was one of them for a long time. On the one hand, because it’s surprisingly slow for what it’s doing…</p> <p>On the other, because it’s where the problems come from. Descriptions are not in-sync with the discussions, priorities are not valid since ever, the backlog is a trash pile accumulated throughout the years, and the refactoring task you created four sprints ago is not even in the tenth sprint from now. Been there, done that.</p> <p>The former are apparent problems of the software itself, but the latter are not, and we should not blame it for that. No malicious Atlassian employees are messing up with our tasks for fun or profit – it’s all on us. I wanted to make it better, but others didn’t care. Or, to state the problem, didn’t get time for that.</p> <p>And then I got admin rights…</p>https://radekmie.dev/blog/on-using-rust-in-parcel-and-vitest/On Using Rust in Parcel and Vitest2023-02-28T00:00:00+00:00<p>While working on my PhD, I had to create a rather sizable set of tools for a new <a rel="noopener nofollow" target="_blank" href="https://en.wikipedia.org/wiki/General_game_playing">general game playing</a> language. It includes a parser, a bunch of optimizing and validating passes, transformations to different formats, and a tree-walking interpreter. All of this was done in my primary language of choice – TypeScript.</p> <p>Such a project takes <em>a lot</em> of experimenting, and having a fully-fledged <abbr title="Integrated Developer's Environments">IDE</abbr> with a way to visualize them is basically a must. I’m not there <em>yet</em>, but a basic syntax highlighter, a type checker with somewhat helpful error messages, and a <a rel="noopener nofollow" target="_blank" href="https://graphviz.org">visual representation</a> are enough to work with. All of that is in your browser and accessible on all devices with no setup!</p> <p>Then, as the games got more and more complex, it started to take <em>a while</em> to run all of the tests. While the small ones take less than 50ms to analyze, the more complex ones are at 3s and counting. I decided to do something about it and…</p> <p>Started rewriting it part by part in Rust. <a rel="noopener nofollow" target="_blank" href="https://transitiontech.ca/random/RIIR">That’s what people do</a>, right?</p>https://radekmie.dev/blog/on-playwright-in-github-actions/On Playwright in GitHub Actions2023-01-31T00:00:00+00:00<p>I was setting up end-to-end tests in a new project recently. While I have like five projects with the exact same setup around to <del>copy</del> <em>learn</em> from, I wanted a summary of <em>why</em> it looks like that as well (you know, for the team). As I couldn’t find one within a couple of minutes, I decided to write down my own.</p> <p>The requirements are simple and short: we want to use <a rel="noopener nofollow" target="_blank" href="https://playwright.dev">Playwright</a> and run the tests both locally (we’ll need a handy <code>npm</code> script) as well as on <a rel="noopener nofollow" target="_blank" href="https://github.com/features/actions">GitHub Actions</a>. While this text is rather tightly focused on the latter, it should be easy to adjust it to work with any other <abbr title="Continous Integration">CI</abbr>.</p> <p>The result should run all tests in multiple browsers in parallel; bonus points for parallelizing the tests within one browser. It’d be nice to have a readable report in case any test fails too <em>(because that’s what tests do, right?)</em>.</p>https://radekmie.dev/blog/on-being-responsive/On Being Responsive2022-12-28T00:00:00+00:00That’s a compliment for sure, but also something I’m not really <em>doing</em> – it just kinda happens. And as people tend to like it, I decided to sit down and think about what it exactly means to be <em>surprisingly responsive</em>.</p>https://radekmie.dev/blog/on-automata-in-rust/On Automata in Rust2022-11-25T00:00:00+00:00<p>While working on my PhD, I had to implement an interpreter of the language we’re working on. At the very core of it are finite automata and finite state machines, as well as <em>tons</em> of operations on them. In practice, it’s a directed graph with operations on the edges (assignments, comparisons, etc.).</p> <p>As I’m most familiar with JavaScript, I implemented the first of the interpreter version in it. It allowed me to have a working version rather fast; as a bonus, it works in the browser, so it’s much more accessible to other people. However, at some point, the performance was not good enough to work interactively.</p> <p>Because of that, I decided to implement the same interpreter in a low-level language. As the automata definition was a simple JSON object, I decided to go with Rust I was already familiar with. Thanks to <a rel="noopener nofollow" target="_blank" href="https://serde.rs">Serde</a>, I had a 1-to-1 matching between the TypeScript and Rust structures within minutes.</p> <p>In this text, I’ll focus on the performance of one operation that had problems in JavaScript – checking reachability. In the future, I plan to dive more into the whole project and what the rest of the code looks like.</p> <p>Shall we?</p>https://radekmie.dev/blog/on-hacktoberfest/On Hacktoberfest2022-10-31T00:00:00+00:00<p>Have you heard about <a rel="noopener nofollow" target="_blank" href="https://hacktoberfest.com">Hacktoberfest</a>? It’s a yearly initiative encouraging people to give back to open source. <em>(Or at least that’s the premise.)</em> To do that, some companies – most importantly <a rel="noopener nofollow" target="_blank" href="https://digitalocean.com">DigitalOcean</a> – lure you with some <em>swag</em>, e.g., a <del>branded</del> <em>unique</em> t-shirt and a bunch of stickers.</p> <p>Is a t-shirt enough for people to work “for free”? Most open source <a rel="noopener nofollow" target="_blank" href="https://opensource.guide/getting-paid/">maintainers are not getting paid in the first place</a>, so that’s already more than usual. As for the others, well… I find it funny, but most IT people just <em>love</em> branded t-shirts, stickers, and socks for no good reason.</p> <p>But does it actually help the open source community?</p>https://radekmie.dev/blog/on-uniforms-integration-with-zod/On uniforms Integration With Zod2022-09-28T00:00:00+00:00<p>The <a rel="noopener nofollow" target="_blank" href="https://zod.dev">Zod</a> validator is getting more and more traction. Whether it’s because it’s easy to use or out of the box type safety – people find it really appealing. I first heard of it back in 2020, when I found <a rel="noopener nofollow" target="_blank" href="https://github.com/sinclairzx81/typebox">TypeBox</a> – another great validator (schema) package with types in mind.</p> <p>The difference between these two is fundamental – the latter relies on a well-known standard of JSON Schema, while the former introduces its own. I would call myself more of a “JSON Schema person”, but I agree that often it’s simply an overkill for some projects and implies a significant bundle size impact.</p> <p>For these simple cases, <a rel="noopener nofollow" target="_blank" href="https://uniforms.tools">uniforms</a> could use a simple yet powerful schema with a low footprint, just like Zod. Luckily, in contrary to other similar packages, it’s a pleasure. It involves <em>a lot</em> of <code>instanceof</code>s, but it’s nice.</p> <p>Shall we?</p>https://radekmie.dev/blog/on-uniforms-v4/On uniforms v42022-08-30T00:00:00+00:00<p>Have you heard of <a rel="noopener nofollow" target="_blank" href="https://uniforms.tools">uniforms</a>? It’s a schema-based React forms library that I’ve been working on at <a rel="noopener nofollow" target="_blank" href="https://vazco.eu">Vazco</a> for more than 6 years now. We released 177 versions and achieved more than 1.6 million downloads in that time. It may not be a lot for <em>you</em>, but it really means a lot to <em>me</em>.</p> <p>Back in January 2021, we released v3. It included migration to the new <a rel="noopener nofollow" target="_blank" href="https://github.com/vazco/uniforms/commit/1ec3b5393ad59890cadcdf96c0cf2cab90b8164f">React Context API</a>, a handful of TypeScript improvements, <a rel="noopener nofollow" target="_blank" href="https://github.com/vazco/uniforms/pull/711">simplification of the validation flow</a>, and… A <em>lot</em> of removals. Really, check out the <a rel="noopener nofollow" target="_blank" href="https://uniforms.tools/docs/migrating-2-to-3/">migration guide</a> yourself – there are around 15 removed methods or props.</p> <p>Last week, we had a meeting regarding version 4. And you know what? We are on a <del>killing</del> removal spree again. Everything to make both our and the users’ lives easier. Or at least that’s the goal.</p>https://radekmie.dev/blog/on-database-migrations-in-mongodb/On Database Migrations in MongoDB2022-07-28T00:00:00+00:00<p>The database schema is something that tends to evolve along the code. That means, it’ll change rather rapidly at the beginning, then stay the same for a relatively long time, and finally get adjusted only from time to time. While some changes will be both easy and fast to implement (e.g., adding a field), some won’t (e.g., extracting an array field into a separate collection).</p> <p>In a way, the nature of the project decides whether or not you need a proper migration workflow. Most <abbr title="Minimum Viable Products">MVPs</abbr> don’t need one, as they are most likely fine with purging the database every time even a change is made. At the same time, designing and maintaining one is a good practice, as it builds confidence for when it’s actually needed.</p> <p>And confidence is crucial when you have millions of documents to migrate.</p>https://radekmie.dev/blog/on-the-road-to-fibers-free-meteor/On the Road to Fibers-free Meteor2022-06-27T00:00:00+00:00<p>If you’re working with Meteor, or at least know that it exists, you are most likely aware that it has one surprising and uncommon “superpower” – it can synchronously wait for a promise (<a rel="noopener nofollow" target="_blank" href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d77e0d179c0a34a5a915133199746cf3d05997c7/types/meteor/promise.d.ts#L13-L15">typings</a>, <a rel="noopener nofollow" target="_blank" href="https://github.com/meteor/meteor/blob/713e40a906edb1cc02c3eec1b961cb816a384fa8/npm-packages/meteor-promise/promise_server.js#L51-L61">source</a>). Of course, there’s nothing magical about it, just <del>a ton of hacks</del> some library called <a rel="noopener nofollow" target="_blank" href="https://github.com/laverdet/node-fibers"><code>node-fibers</code></a>.</p>https://radekmie.dev/blog/on-the-edge-of-burnout/On the Edge of Burnout2022-05-30T00:00:00+00:00<p>Should programming be <em>fun</em>? With nearly 7 years of commercial experience, it’s still a really tough question. On the one hand, I’m doing what I <em>really</em> like. On the other, I should… Get bored already?</p> <p>Programming is my hobby. <em>(Actually, I wouldn’t be where I am now, if it weren’t.)</em> As I speak to others, it’s not that uncommon among programmers. But what is also not uncommon, is the fact that it changes in the first few years of work. It’s simple – if your work is your hobby, then your hobby <em>feels</em> like work.</p> <p>Burnout <em>is</em> a thing; I hope we all know that. But let’s start small, just when the spark goes off. At first, there’s no drive for doing side projects. Then there’s no interest in new and once exciting things. At some point, it’s no longer about programming; it’s about <em>work</em>. Something got lost in the process.</p> <p>What then?</p>https://radekmie.dev/blog/on-unmaintained-software/On Unmaintained Software2022-04-27T00:00:00+00:00<p>The vast majority of software requires maintenance. That’s normal and nothing to be scared of! Most of this maintenance comes from updating the dependencies – both on the source and the API level. The former are easy, as long as there are no breaking changes – usually, it’s just a version change. However, the latter pose a great challenge.</p> <p>By “API-level dependencies”, I mean not only the API of a library or runtime you’re using but also the <em>outgoing</em> dependencies. Whether we’re talking about a library or an app, the users will – sooner or later – rely on every single part of the observable behavior; <a rel="noopener nofollow" target="_blank" href="https://www.hyrumslaw.com">that’s a law</a>.</p> <p>As people are updating their runtimes (systems, drivers, browsers, etc.), the unmaintained software slowly becomes unusable. Usually, it starts with a beta user asking whether the change was intended or not. The community often “reacts” with a workaround. But at some point, there’s nothing they can do.</p> <p>And that’s everyone’s problem.</p>https://radekmie.dev/blog/on-rss/On RSS2022-03-30T00:00:00+00:00<p>Hey kids, have you heard of <abbr title="Really Simple Syndication">RSS</abbr>? Some “older” people laugh that “younger” people nowadays are not able to use a can opener or have no idea why does a pencil combines with a cassette tape. These are two <em>extreme</em> generalizations.</p> <p>But, at the same time, I’d say that RSS is one of these things. Most people have <em>heard</em> about it at some point, and then it kind of… died? Well, luckily for <del>me</del> <em>us</em>, that’s not true. At the end of the day, aren’t you fed up with the tens of apps that you have to use in order to stay up to date with <em>stuff</em>? I certainly am.</p> <p>And that’s where the RSS kicks in! It lets you stay up to date with <em>stuff</em> but in a centralized and personalized manner. Of course, it requires some setup from the publisher, but once set, it just works! Let’s see what’s in there for <em>you</em>.</p>https://radekmie.dev/blog/on-regular-expressions/On Regular Expressions2022-02-28T00:00:00+00:00<p>Whenever I introduce a <a rel="noopener nofollow" target="_blank" href="https://en.wikipedia.org/wiki/Regular_expression">regular expression</a> – “regex” for short – in a project, there’s always someone that is not fond of this idea. I heard “write-only” and “unmaintanable” way too many times. But are they really?</p> <p>I don’t think that my daily programming practice is far from a “standard” one, whatever this means. And I do use regexes daily – while searching through the code, working with <code>git</code>, or even <a rel="noopener nofollow" target="_blank" href="https://support.google.com/docs/answer/3098244?hl=en">Google Sheets</a>. As I just checked, more than half of my Sublime Text search history actually contains a regex.</p> <p>Just like any other piece of technology, there’s some theory behind it, multiple standards, and a ton of tools to make our lives easier. In this text, I’ll go through most of it to hopefully make you less afraid of them!</p>https://radekmie.dev/blog/on-rust-in-webdev/On Rust in Webdev2022-01-26T00:00:00+00:00<p>I remember that a couple of years back, <del>we</del> everybody laughed at the idea of “everything in JavaScript”. It was right after the great success of <a rel="noopener nofollow" target="_blank" href="https://emscripten.org">Emscripten</a>. We imagined that literally <em>everything</em> will make it into a web browser: desktop applications, heavy graphics processors, or even AAA games.</p> <p>Today, with <a rel="noopener nofollow" target="_blank" href="https://webassembly.org">WebAssembly</a>, we are a thousand steps closer to this goal. As it becomes <a rel="noopener nofollow" target="_blank" href="https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md">more</a> and <a rel="noopener nofollow" target="_blank" href="https://github.com/WebAssembly/bulk-memory-operations/blob/master/proposals/bulk-memory-operations/Overview.md">more</a> powerful, it makes sense to take other languages into consideration while working on a web application. <a rel="noopener nofollow" target="_blank" href="https://twitter.com/Adobe/status/1453034805004685313">Adobe announced</a> that they managed to squeeze Photoshop into the browser – that’s huge!</p> <p>I believe there’s no need for an introduction of <a rel="noopener nofollow" target="_blank" href="https://www.rust-lang.org">Rust</a>. According to the <a rel="noopener nofollow" target="_blank" href="https://insights.stackoverflow.com/survey/">Stack Overflow’s Annual Developer Survey</a>, it’s the most loved language <a rel="noopener nofollow" target="_blank" href="https://insights.stackoverflow.com/survey/2021#technology-most-loved-dreaded-and-wanted">for six years straight</a>. As such, it gained an enormous community, including some passionate web developers. Some of them focus on rewriting everything in Rust; others began mixing it more reasonably, under the hood, as an implementation detail.</p> <p>That’s why we see JavaScript-centric projects being rewritten. <a rel="noopener nofollow" target="_blank" href="https://parceljs.org">Parcel</a> switched to an <a rel="noopener nofollow" target="_blank" href="https://swc.rs">swc</a>-based JS transformer, <a rel="noopener nofollow" target="_blank" href="https://parceljs.org/blog/beta3/">achieving 4-fold improvements</a>. Recently they announced their <a rel="noopener nofollow" target="_blank" href="https://parceljs.org/blog/parcel-css/">new CSS transformer</a> that is 100x faster. <a rel="noopener nofollow" target="_blank" href="https://rome.tools/blog/2021/09/21/rome-will-be-rewritten-in-rust">Rome</a> switched to Rust even before it got finished. All of these lead to better and faster tooling.</p> <p>How about <em>your</em> project?</p>https://radekmie.dev/blog/on-developer-experience/On Developer Experience2021-12-31T00:00:00+00:00<p>Writing concise and maintainable code is an art. It’s not only important from the developers’ perspective but also on a (seemingly) unrelated business level. According to this <a rel="noopener nofollow" target="_blank" href="https://stackoverflow.blog/2021/12/07/new-data-what-developers-look-for-in-future-job-opportunities/">Stack Overflow’s Pulse Survey</a>, developer experience became the most crucial factor in making a company <em>appealing</em>.</p> <p>On the one hand, we see an increased amount of tooling for every (no longer necessarily major) technology. Our toolboxes are no longer limited to an <abbr title="Integrated Developer's Environments">IDE</abbr> and a debugger/profiler pair. We have code linters, configuration checkers, secret scanners, complexity analyzers… Tons of bugs are no longer possible, or at least are easier to find due to the automated checks.</p> <p>On the other hand, every programming language has its idioms. If you’ve ever worked with Python, you’ve most likely heard the term <a rel="noopener nofollow" target="_blank" href="https://stackoverflow.com/a/25011492/1452194">“pythonic”</a>. There’s no clear definition, so let’s use this: <em>“feels right for an experienced developer”</em>. Other languages have their own versions of it, but somehow this term simply sticks better than the other – “javascriptic” sounds terrible.</p> <p>So what is missing?</p>https://radekmie.dev/blog/on-writing-documentation/On Writing Documentation2021-11-29T00:00:00+00:00<p>Writing a <em>good</em> piece of documentation is a heroic task. You have to deal with tens of small nuances on each sentence – or even word – just to make sure that <em>everyone</em> will understand it. You may think that you won’t be that <em>everyone</em> anytime soon, but if you’ve seen <em>things</em>, you realize that sooner or later, you will be. Most probably sooner than you realize.</p> <p>If you were lucky enough to work in a well-documented project – or should I say <em>environment</em> (I’ll get to that) – you should know that keeping it this way takes time. A <em>lot</em> of time. The details, like formatting, correct wording, style of the charts, or even doodles, are probably the most time-consuming.</p> <p>Hundreds of (mis)formatted <a rel="noopener nofollow" target="_blank" href="https://www.atlassian.com/software/confluence">Confluence</a> pages, some <del>ancient</del> <em>severely outdated</em> <a rel="noopener nofollow" target="_blank" href="https://www.google.com/docs/about/">Google Docs</a>, stale-since-ever <a rel="noopener nofollow" target="_blank" href="https://www.atlassian.com/software/jira">Jira</a> tickets, way-too-brief meeting notes on <a rel="noopener nofollow" target="_blank" href="https://slite.com">Slite</a>, and a bunch of random <a rel="noopener nofollow" target="_blank" href="https://www.notion.so">Notion</a> pages. If you are lucky, you have <em>people</em> (most probably a single person) who actually know things. And they are here since… Ever? They won’t leave.</p> <p>They won’t, right? Right!?</p>https://radekmie.dev/blog/on-multisynchronicity/On Multisynchronicity2021-10-29T00:00:00+00:00<p>The vast majority of the code that most programmers work with is executed synchronously. In this setting, every <em>instruction</em> is computed separately, one at a time, in the order defined by the language or the runtime.</p> <p>However, most programs operate with a database, communicate with external services, or do some sort of background computation. All of these operations have some kind of inherent <em>delay</em>. Classically, the program will <em>pause</em> and wait for the result. Yes, it’ll block the UI as well.</p> <p>But there’s another way! We could perform these operations <em>asynchronously</em>, i.e., schedule them as well as some code that will be executed once the result is ready. There are many ideas for implementing these APIs, with varying levels of abstractions and performance considerations.</p> <p>Ideally, we would abstract the waiting away, but we can’t. Or can we?</p>https://radekmie.dev/blog/on-throw-in-react/On <code>throw</code> in React2021-09-30T00:00:00+00:00<p>Library authors are doing their best to provide the cleanest APIs while being constrained by the language. The (clean) API itself is there not only to help people understand the code better without diving into implementation details but also to prevent them from <em>foot guns</em> of any sort.</p> <p>Of course, the bigger the target audience is, the more vital the API becomes. If it’s not going to be “good enough”, then the community won’t hold itself, as new people won’t settle in quickly. <a rel="noopener nofollow" target="_blank" href="https://wiki.c2.com/?MakeItWorkMakeItRightMakeItFast">Quality over performance</a>!</p> <p>What if we <del>abuse</del> use some language features in an <em>unexpected</em> way to achieve an excellent developer experience? On the one hand, we achieved our goal; at least partially. On the other, it may result in <em>interesting</em> behavior. That’s how I see the future (of React).</p>https://radekmie.dev/blog/on-ad-hoc-mentoring/On Ad Hoc Mentoring2021-08-23T00:00:00+00:00<p>Being a mentor for more than five years assured me that every single form of mentoring is beneficial for both sides – the mentor and the mentee. In many companies, rather than a one-time event, it’s a part of a bigger process, like onboarding or regular project- or company-wide pair programming sessions.</p> <p>But what if you suddenly have a one-time occasion with someone? It happens from time to time – someone is absent, and you are expected to make up for the missed mentoring session, there’s a blocker on another project, and you are an expert in the area, or you were asked for help.</p> <p>How to make the most of it? I have to admit that learning from mistakes is the most effective way. It not only gives you a better understanding of the final solution but is also harder to forget. However, it’s hardly applicable in one go.</p> <p>Or is it?</p>https://radekmie.dev/blog/on-cold-keyboard-optimization/On Cold Keyboard Optimization2021-07-12T00:00:00+00:00<p>If you have ever worked with a profiler, you should be aware that basically any process on your computer may affect the results. It’s simple – CPUs are complex beasts, and your <abbr title="Operating System">OS</abbr> is doing its best to keep the system responsive. The only thing you have to know is that it’s actually good at it. Like, really good.</p> <p>As all resources of our computers are strictly limited, it’s often the case that some of the processes (tasks) will not be given as much of them as needed. Or, more likely and even worse, they’ll receive a different amount each time.</p> <p>But what’s the deal with “cold keyboard”? Well, I work on a laptop with <em>some</em> Linux on it. What is important for the story (and the title!), I love its built-in keyboard, and I’m not using an external one. That means, every time the CPU gets hot, I can actually feel it. And like most people (I guess?), I honestly hate it.</p> <p>To keep my keyboard cold, I could stop pushing the CPU <em>that</em> hard. However, it’s not possible during profiling, as you want to run your program and another one in parallel to measure the performance. What else can we do?</p>https://radekmie.dev/blog/on-recruiting-full-stacks/On Recruiting Full Stacks2021-06-01T00:00:00+00:00<p>Every recruitment process starts way before there’s any candidate. Most of them end as soon as someone gets hired – we go one step further, including the onboarding. This process is a result of <em>years</em> of gradual improvements.</p> <p>This time we’ll look into the process I’ve been part of for over five years now. No, I’m not an expert, and no, I’m not educated in this direction at all. However, I think I can say I’m at least <em>decent</em> at it.</p> <p><em>Everything</em> is covered here. Let’s dive in!</p>https://radekmie.dev/blog/on-software-performance/On Software Performance2021-05-19T00:00:00+00:00<p>If you have ever talked with your manager or a client about the performance, you’ve most probably heard the dreaded <em>“Is it fast?”</em> question. There’s also the imperative variant, <em>“It has to be fast.</em>”, although far less common. In both cases, I usually follow up with a serious face, forcing the other person to stay with me and actually define what it means for it to be <em>fast</em>.</p> <p>As you slowly get angry (because nobody knows the code better than you), you start to notice that the client is not really talking about the <em>performance</em> itself, but rather the <em>feeling</em> of it – the <a rel="noopener nofollow" target="_blank" href="https://www.smashingmagazine.com/2015/09/why-performance-matters-the-perception-of-time/"><em>perceived performance</em></a>. That opens a whole new world of quirks of human perception. And hacks, of course.</p> <p>There are also other cases when something could be improved, but there are no plans nor resources for that, as it’s already <em>fast enough</em>. How can one <em>strongly</em> suggest actually putting work into it? Well, you have to know how to sell it.</p>https://radekmie.dev/blog/on-dots-and-emojis/On Dots and Emojis2021-04-21T00:00:00+00:00<p>I. Like. Dots. Okay, not like that, but I’m this kind of person who always ends their sentence with a dot. And trust me – when I say <em>always</em>, I mean it. I do so <em>everywhere</em> – not only in the “official channels” like work-related emails or chats with a client – <em>everywhere</em>, including private text messages and every instant messaging app, like Messenger or Slack.</p> <p>The weird part is that I have no idea <em>why</em>. I’m simply used to do so, at least as far as I can remember. It feels normal and more natural – somehow required by the form of a “proper sentence”. I know, it’s obvious for a linguist, but not so much for <del>an average internet user</del> the standards of online communication.</p> <p>But hey, we have emojis. Maybe we all could agree to use them… instead? For some people, emojis are far more expressive and better suited than <del>punchlines</del> dots. Let’s try this now, I think 🤷</p>https://radekmie.dev/blog/on-side-projects/On Side Projects2021-04-12T00:00:00+00:00<p>Side projects are important. And while not everyone has the time or mental capacity to have one, I think we could do better at working with them. Mine were always strictly code-related – small scripts or <abbr title="Proofs of Concept">PoCs</abbr> of some functionality.</p> <p>But the code shouldn’t be a limitation. Whether you need to solve an actual problem, verify a start-up idea, want to <a rel="noopener nofollow" target="_blank" href="https://github.com/karan/Projects">start with new technology</a>, or spend some time – pet projects are often the way to go. As long as the goal is there and you <em>want</em> to, basically everything can grow and evolve into bigger <em>things</em>. And these tend to have a need for maintenance.</p> <p>That’s where it gets (usually) far less interesting. Code ages on several levels, often faster than we’d expect and want it to. You do it almost automatically at first – covering corner cases, ironing bugs, and optimizing usual workload is <em>technically</em> a part of the implementation, right? But suddenly you feel the urge to throw it out of the window… Sounds familiar?</p>https://radekmie.dev/blog/on-javascript-ecosystem/On JavaScript Ecosystem2021-03-25T00:00:00+00:00<p>A colleague of mine recently asked whether we consider the current state of the JavaScript ecosystem <em>stable</em>. As you may know, the problem of “JavaScript Fatigue” is real. If you haven’t heard about it – or you like nice drawings – consider reading <a rel="noopener nofollow" target="_blank" href="https://auth0.com/blog/how-to-manage-javascript-fatigue/">this article on Auth0 blog</a> as a primer.</p> <p>A lot have changed within the last few years. That includes the number of things I experienced and my level of expertise. Keep that in mind, as both have a strong influence on my point of view.</p> <p>As usual, the answer is: <em>it depends</em>. While plenty of positive things has happened – we’ll get to that in a minute – there is a bunch of new problems too. I hypothesize that it’s better <em>in general</em>.</p>