Recently, at work, we’ve been encouraged to try out a bunch of new “AI” tools. So, I’ve been using the Claude “AI” app, an “AI assistant” developed by Anthropic, to help with some Rust programming tasks. I’ve been trying (as requested) to learn its strengths and weaknesses, and how I might be able to use it to make my work more efficient. But mostly I’ve just been building an intuition of what it is.| The Coded Message
What Features Should Rust Have? Part II| The Coded Message
In my previous post, I talked about programming language design, and try to discern some heuristics for what features should be added to a programming language, on my way to explaining why Rust should not include inheritance as a feature. I’d like to expand more on that blog post now (so I guess it’s become a series?). Do I think Rust is perfect how it is? (No.) Are there features that I want in Rust that Rust currently does not have?| Welcome to The Coded Message! on The Coded Message
Programming language design, like API design, and computer UX design (especially for technical tools like build systems and admin systems) is a difficult form of engineering, bridging computer science and cognitive science. Sometimes, it’s more art than science, because building systems that other technical workers will use comes with nearly infinite trade-offs and judgment calls. The effort and quality matter too. Different programming languages have different strengths and weaknesses. Som...| The Coded Message
I was recently working on a (company-internal) GitHub pull request I’d written. A colleague left a few comments in a review and “requested changes” from me, effectively giving me a TODO list of items that needed to be done before the PR could be merged. Because he’d specified that he was “requesting changes,” GitHub knew to prevent someone from merging the PR before those requests had specifically been addressed. Once I’d finished addressing these TODO items, I had a conversatio...| Welcome to The Coded Message! on The Coded Message
I just read an article in The Atlantic that AI is failing to justify itself economically. This is pretty dire for AI, especially given that this is such an overly expensive technology even with tons of brazen stealing from content creators. I feel like it should go without saying that if your business isn’t profitable even with a ton of stealing, maybe it’s not that great a business. But of course, who doesn’t want a confident confabulator incapable of critical thinking?| Welcome to The Coded Message! on The Coded Message
AI, particularly this new round of large language models, scares me on behalf of society and the future. I don’t just say that because it’s transformative. I don’t say that as a generic warning that we haven’t considered the consequences (as in this XKCD comic). No, I have specific consequences in mind, consequences that I have considered, and I am rather worried about them! They are not so much problems about the technology itself, but about how we use it, and specifically how we use...| Welcome to The Coded Message! on The Coded Message
C++, like all things, has numerous problems. Pointing out how Rust addresses many of them is a major topic of my blog, but some of the problems are bigger than others. The biggest, most famous, loudest problem, the problem that got the federal government’s attention and resulted in a surreal flame war between Dr. Bjarne Stroustrup and the NSA (which I also commented on/contributed to), is C++’s lack of memory safety.| Welcome to The Coded Message! on The Coded Message
I was Googling for sources about nuclear power for my new political views garden, and I came across the following statement in reference to nuclear waste: I know that burning fossil fuels is bad, but we can’t just start another problem just because we can’t fix the first one. I’m not trying to single out the person who wrote this (and therefore no link, and the quote has been edited for spelling and grammar which I hope has rendered it un-Googleable), but I do want to respond, generally...| Welcome to The Coded Message! on The Coded Message
Since my previous post, I haven’t posted about Asahi Linux. This is for a simple reason: I wasn’t using it. I never took the time to set up a tiling window manager, get dropbox working, and all the things I felt I needed, and I slipped back to using my trusty Dell Ubuntu laptop for Linux, and using my MacBook M1 just for macOS. But then I tried again! And wow, has Asahi Linux changed!| Welcome to The Coded Message! on The Coded Message
This is part of my new series on what the 0’s and 1’s in computers mean, how computers use them to store various kinds of information, and why all of this works the way it does. When I was a boy, my schoolmates, knowing that I was interested in computers, would sometimes ask me if I could read binary. They imagined I would see some binary, and be able to read it out loud like they could read letters, perhaps some binary that looked like this:| Welcome to The Coded Message! on The Coded Message
How do we ask the other people in our lives for the things we need and want? This can be difficult for everybody. Many of us have trauma from a society that continually tells us that we don’t deserve to have help meeting our needs, or from past situations where our needs have been neglected. We are also often aware that asking for things can sometimes be upsetting to the people we ask.| Welcome to The Coded Message! on The Coded Message
I was explaining two’s complement recently1 to a friend, and I thought my explanation was decent, so I decided to write it up and share it with you, my general blog audience, as well! If you already know about two’s complement, this will pretty much just be a review. If not, you may learn something, and you may not understand all of it. Try to get what you can without getting too anxious, there will not be a test!| Welcome to The Coded Message! on The Coded Message
Polymorphism is a powerful programming language feature. In polymorphism, we have generic functions that don’t know exactly what type of data they will be operating on. Often, the data types won’t even all have been designed yet when the generic function is written. The generic function provides the general outline of the work, but the details of some parts of the work, some specific operations, must be tailored to the specific types being used.| Welcome to The Coded Message! on The Coded Message
So, there are now two additional repos of my code on GitHub that recently got published, both under the MIT license. Neither is any show-stopping major project, but I figured I’d let everyone know nevertheless, and write up a few notes about it. Both have been added to my programming portfolio garden. Repo #1: Crate Version of Prefix Ranges Arvid Norlander (blog, GitHub) reached out to me to ask if I wanted to publish my little Rust module from my post on prefix ranges as a crate, or, faili...| Welcome to The Coded Message! on The Coded Message
This was a great read about how the United States should reframe many of its basic political assumptions. It is tempting to think of life as a zero-sum game. Having more for me, even enough for me, means less or even not enough for others. Usually, we have the open-mindedness to feel like we can cooperate with some few – our family, our community, or perhaps our nation or religion or even (problematically) our ethnic group.| Welcome to The Coded Message! on The Coded Message
US politics continue to be interesting. As many of you know, the Colorado Supreme Court has recently ruled that Donald Trump should be struck from the ballot in Colorado. Under Section 3 of the 14th Amendment to the US Constitution, if you’ve sworn to support the Constitution, and then engaged in (or “given aid or comfort to”) an insurrection, you are no longer eligible to serve in office. The Colorado Supreme Court applied this law to Trump, citing the Capitol attack of January 6, 2021.| Welcome to The Coded Message! on The Coded Message
Another year has gone by And in response, I simply sigh Another year has taken place I guess I’ll handle it with grace? Another year, the same old grind… And yet I feel I’ve fallen behind As you might know if you’ve read my equivalent post from last year, I am now 35 years old (and 3 days). If we consider “working years” to range from 20 to 65 – which seems a decent definition – then I am 1/3 of the way through them, 1/3 of the way through my career.| Welcome to The Coded Message! on The Coded Message
In this next1 post of my series explaining how Rust is better off without Object-Oriented Programming, I discuss the last and (in my opinion) the weirdest of OOP’s 3 traditional pillars. It’s not encapsulation, a great idea which exists in some form in every modern programming language, just OOP does it oddly. It’s not polymorphism, also a great idea that OOP puts too many restrictions on, and that Rust borrows a better design for from Haskell (with syntax from C++).| Welcome to The Coded Message! on The Coded Message
This is a revision of a flash fiction piece first posted in 2018. After a year of talking, and another year of planning, the project was complete. Mothers Against Drunk Driving, the local clergy, and the town council had finally done it: Right in the town square, they installed a giant loudspeaker. From thenceforth, every two minutes, a booming voice would spread all over town, announcing: ARE YOU SURE? Foolhardy decisions, they had decreed, would soon be a thing of the past.| Welcome to The Coded Message! on The Coded Message
Endianness is a long-standing headache for many a computer science student, and a thorn in the side of practitioners. I have already written some about it in a different context. Today, I’d like to talk more about how to deal with endianness in programming languages and APIs, especially how to deal with it in a principled, type-safe way. Before we get to that, I want to make some preliminary clarifications about endianness, which will help inform our API design.| Welcome to The Coded Message! on The Coded Message
This is my newest post in my series about operating systems. Yes, it was last updated in 2019 – I’m a hobbyist blogger. This is a post about the command line, a computer topic, but it is for educating a non-technical (but tech-curious) audience. Most of the programmers in my audience will already know everything I have to say, and may be bored by some explanation of things they already know, though I intend to discuss some technical details of how computers work.| Welcome to The Coded Message! on The Coded Message
This blog post isn’t about ChatGPT. It isn’t about machine learning, neural nets, or any mysterious or border-line spiritual form of computing. That’s a whole ’nother set of philosophical and metaphysical conundrums (conundra?). This is about a way people sometimes speak, informally, about bog-standard boring non-AI computers and computer programs. You’ve probably heard people speak this way. You’ve probably spoken this way sometimes yourself: “The server thinks your password is...| Welcome to The Coded Message! on The Coded Message
I remember hearing an idea once – I’d like to cite it, but proper citation seems difficult, as I heard it from an acquaintance, and Mr. Google isn’t being his usual helpful self. The idea was, different politicians have these verbal tics, these filler catch-phrases, that indicate their deepest conversational anxieties. For President Obama, it’s “let me be clear.” According to this thesis, he is really concerned about being unclear, and this tic is so prominent in his speech that i...| Welcome to The Coded Message! on The Coded Message
UPDATE: I have updated this post to address C++ features that address these issues or have been purported to. I have long day-dreamed about useful improvements to C++. Some of these are inspired by Rust, but some of these are ideas I already had before I learned Rust. Each of these would make programming C++ a better experience, usually in a minor way. Explicit self reference instead of implicit this pointer UPDATE: This is coming out in C++23, and they did it right!| Welcome to The Coded Message! on The Coded Message
One of the minor points I discussed in my response to Dr. Bjarne Stroustrup’s memory safety comments was the controversial, apparently deeply upsetting term C/C++. It is controversial and interesting enough that I decided to say a little more about it here. A little background: Many people, especially outside the C and C++ communities (which, to be clear, don’t always like each other that much) use the term C/C++ to talk about the two programming languages together, as an informal short-h...| Welcome to The Coded Message! on The Coded Message
UPDATE: Wow, this post has gotten popular! I’ve written a new post that adds new papercuts combined with concrete suggestions for how C++ could improve, if you are interested. Also, if you want to read more about C++’s deeper-than-papercut issues, I recommend specifically my post on its move semantics. Thank you for reading! My current day job is now again a C++ role. And so, I find myself again focusing in this blog post on the downsides of C++.| Welcome to The Coded Message! on The Coded Message
TLDR: I am adding a new link for RSS subscribers who just want to subscribe to technical posts. The RSS feed has always been available, but it is now explicitly one of the links across the top, for those who want their RSS feed to only give them my new technical posts. I am writing this post primarily to let people know about this new link, but I also want to muse on it a little.| Welcome to The Coded Message! on The Coded Message
TRIBUNAL PROCEEDING TRANSCRIPT SUB LEGIBUS ORDINIS SACROSANCTI IMMORTALIUM PROVISIONAL PROOF TEXT IN THE CASE OF: ŌRDŌ SACROSANCTUS VERSUS THE NAMELESS DAUGHTER OF MUŠMAḪḪU THE SEVEN-HEADED SERPENT, SHE WHO IS KNOWN TO THE MORTALS AS EUNICE LORD JUSTICE MEPHISTO, PRESIDING LORD JUSTICE DRACHENMILCH, LORD JUSTICE BA’AL-HA-KHUMUS, AND LORD LADY JUSTICE XYXXYZ MR. AZAXAZALIA, ESQ., PROSECUTOR MS. “EUNICE”, DEFENDANT A RECORD OF EUNICE‘S TESTIMONY TRANSCRIBED BY GEORGE SMITH, HUMAN...| Welcome to The Coded Message! on The Coded Message
Here’s a story; stop me if you’ve heard it before. There’s a child, an energetic, enthusiastic child, perhaps hard to deal with in some ways, but all around just beautiful. And then they go to a parochial school – or perhaps they just have a rather strict public school teacher. In either case, the authority figure makes it their wicked mission to suppress all the beautiful children’s personalities into identical, well-behaved zombies in the interest of the idol of order.| Welcome to The Coded Message! on The Coded Message
Update: Arvid Norlander has gone through the trouble of refactoring this code into a crate and publishing it. Thank you, Arvid! Rust’s BTreeMap and corresponding BTreeSet are excellent, B-tree-based sorted map and key types. The map implements the ergonomic entry API, more flexible than other map APIs, made possible by the borrow checker. They are implemented with the more performant but more gnarly B-Tree data structure, rather than the more common AVL trees or red-black trees.| Welcome to The Coded Message! on The Coded Message
I already enjoyed the Monk and Robot series by Becky Chambers (A Psalm for the Wild-Built and A Prayer for the Crown-Shy). It’s now one of my favorite books. so I was excited to also read her earlier work, the Wayfarer series, starting with The Long Way to a Small, Angry Planet, and it did not disappoint me. Both these series are science fiction. While Monk and Robot is solarpunk, a relatively new sub-genre focused on imagining a world with major environmental (and economic) problems solved...| Welcome to The Coded Message! on The Coded Message
I am no stranger to programming language controversy. I have a whole category on my blog dedicated to explaining why Rust is better than C++, and I’ve taken the extra step of organizing it into an MDBook for everyone’s convenience. Most of them have been argued about on Reddit, and a few even on Hacker News. Every single one of them have been subject to critique, and in the process, I’ve been exposed to every corner, every trope and tone and approach of programming language debate relig...| Welcome to The Coded Message! on The Coded Message
Tolkien was trying to make a new mythology, a new set of deeply resonant stories, for modern (especially English) culture, and he succeeded. He transformed fantasy, and founded the concept of high fantasy. His detailed legendarium (as his mythology is called) is a masterpiece of world-building, with deep symbolism and emotional complexity, a mythology with arguably more depth and room to explore than many ancient ones. Tolkien scholars work full-time to study it, and many more people draw fro...| Welcome to The Coded Message! on The Coded Message
I’d like to share with you how I use my computer, in a way that is (for me) ADHD friendly and well-suited for implementing my organization system. Tools are important to any organizational and productivity system, and optimizing your tools for your brain and your workflow are important. My computer is my most important productivity tool, where my work happens, and where my life/chore/errand/calendar organization happens, so it should be an interesting example of an optimized key tool.| Welcome to The Coded Message! on The Coded Message
In this post, I continue my series on how Rust differs from the traditional object-oriented programming paradigm by discussing the second of the three traditional pillars of OOP: polymorphism. Polymorphism is an especially big topic in object-oriented programming, perhaps the most important of its three pillars. Several books could be (and have been) written on what polymorphism is, how various programming languages have implemented it (both within the OOP world and outside of it – yes, pol...| Welcome to The Coded Message! on The Coded Message
Today, in liturgical Western Christianity, it is the 10th day of Christmas. Merry Christmas to those who celebrate the extended edition of the holiday! Unfortunately, this essay is not a celebration of Christmas, but rather an explanation of why I have often found it disappointing recently in life, because of a disconnect between the promise and the reality. Every time Christmas comes around, I think of a classical sacred choral piece that I’ve performed in multiple different choirs in yout...| Welcome to The Coded Message! on The Coded Message
Happy December! Happy Winter Holidays! We’re almost done with 2022! I just had my birthday yesterday, on December 20. I am now 34 years old, which is more than a third of a century! I generally take the opportunity on my birthday to do some reflection on the previous year, and to set a theme for the next year. I wanted to share both with you, my audience. The past year has been intense for me personally.| Welcome to The Coded Message! on The Coded Message
If you’re confused by how to use JIRA effectively, do not worry! If you learn this process, which is very simple not literally impossible, you too can become good at JIRA passingly competent at JIRA not liable to being fired for being bad at JIRA. Here are the steps: Create personal TODO item to write JIRA ticket Accumulate requirements for JIRA ticket in personal notes Often more complicated than the feature itself This is the System Working™ Write TODO items strategizing how to: Share t...| Welcome to The Coded Message! on The Coded Message
In my previous post on organization, I concluded with this statement: As everyone’s brain works differently (whether ADHD or not), people differ tremendously in what their ideal organizational systems are. For me, I am much less productive if I have a less than ideal system – the stakes are very high. But even for people who can be productive on any system, I think that tailoring their system to their brain, their lifestyle, their job and schedule and hobbies, can have amazing results.| Welcome to The Coded Message! on The Coded Message
It took me a long time to admit to myself that the venerable Unix command line interface is stuck in the past and in need of a refresh, but it was a formative moment in my development as a programmer when I finally did. Coming from that perspective, I am very glad that there is a new wave of enthusiasm (coming especially from the Rust community) to build new tools that are fixing some of the problems with this very old and established user-interface.| Welcome to The Coded Message! on The Coded Message
I am an Ivy League-educated professional who regularly has to write for my job, who was always in the top English classes in school. And sometimes, I mix up “your” and “you’re.” I know how grammar works. I always, if I stop to think about it, can figure out which one to use. I know all the tricks. Most of the time, I don’t have to think about it, and the right one comes out.| Welcome to The Coded Message! on The Coded Message
We decided to write up our thoughts on each of the short stories nominated for the 2022 Hugo awards. Of course, here be spoilers, spoilers galore. If you don’t want these stories spoiled, go read them, and then come back here. This is the same concept as Jimmy’s review of the 2021 nominees, and so we shall adapt the explanation from that post: As an exercise, we read each of these stories and told each other what we thought the themes were, and I reference that throughout these reflections.| Welcome to The Coded Message! on The Coded Message
There’s more than one way to do it. Perl motto There should be one– and preferably only one –obvious way to do it. The Zen of Python (inconsistent formatting is part of the quote) When it comes to statically-typed systems programming languages, C++ is the Perl, and Rust is the Python. In this post, the next installment of my Rust vs C++ series, I will attempt to explain why C++’s feature-set is problematic, and explain how Rust does better.| Welcome to The Coded Message! on The Coded Message
I’ve been feeling recently like I’ve been spinning my wheels in my personal life. I’m pressing on the metaphorical accelerator as hard as I can, probably too hard for safety, and instead of moving forward, the wheels are just spinning, spinning, spinning. I think a large part of it is my perspective of time. “Time is canceled,” my friends and I would say continuously during the lockdown. And it isn’t back, not yet, not how it used to be, not for me.| Welcome to The Coded Message! on The Coded Message
NB: These are for the 2021 Hugo awards, not the recently-announced 2022 Hugo awards. That one is coming soon. I decided to write up my thoughts on each of the short stories nominated for the 2021 Hugo awards. Of course, here be spoilers, spoilers galore. If you don’t want these stories spoiled, go read them, and then come back here. As an exercise, a friend and I read each of these stories and told each other what we thought the themes were, and I reference that throughout these reflections.| Welcome to The Coded Message! on The Coded Message
I like beer, and I like comic books, so I was excited to read The Comic Book Story of Beer. And it was overall quite a fun read! It contextualized how important beer was in antiquity – including theories that beer catalyzed the agricultural revolution – and how important it’s been in society ever since, taking a social approach to the entire history, while also explaining a lot of the science alongside the primarily social narrative.| Welcome to The Coded Message! on The Coded Message
What is “bad” Rust? When we say that a snippet of code is “bad” Rust, it’s ambiguous. We might on the one hand mean that it is “invalid” Rust, like the following function (standing on its own in a module): fn foo(bar: u32) -> u32 { bar + baz // but baz is never declared... } In this situation, a rule of the programming language has been violated. The compiler stops compiling and does not output a binary.| Welcome to The Coded Message! on The Coded Message
I just bought a house, and it came with a mortgage. I bought the house and committed to the mortgage all in one ceremony, in a cute little office where I signed enough papers that the sellers were able to solemnly hand me the keys to my new castle. In the lead-up to this, I was told how early payments, mortgage insurance, and refinancing works, and it’s – I think very reasonably – been on my mind since.| Welcome to The Coded Message! on The Coded Message
Imagine you don’t know who Napoleon was. You know he’s a figure from history, but you don’t even know he has to do with France. And imagine, when you read the Wikipedia article, for some reason you skip the opening paragraphs above the fold, and you’re reading about his upbringing in Corsica as a petty Italian noble under French rule. And you just want to know, why’s this guy important, what’s his deal, why do people keep talking about him (something military, it seems?| Welcome to The Coded Message! on The Coded Message
Finally in 2019, Rust stabilized the async feature, which supports asynchronous operations in a way that doesn’t require multiple operating system threads. This feature was so anticipated and hyped and in demand that there was a website whose sole purpose was to announce its stabilization. async was controversial from its inception; it’s still controversial today; and in this post I am throwing my own 2 cents into this controversy, in defense of the feature.| Welcome to The Coded Message! on The Coded Message
I have been working on a serialization project recently that involves endianness (also known as byte order), and it caused me to explore parts of the Rust standard library that deals with endianness, and share my thoughts about how endianness should be represented in a programming language and its standard library, as I think this is also something that Rust does better than C++, and also makes for a good case study to talk about API design and polymorphism in Rust.| Welcome to The Coded Message! on The Coded Message
Humpty Dumpty sat on a wall Humpty Dumpty had a great fall All the king’s horses and all the king’s men Were too busy deciding who would be king… To even TRY to put Humpty Dumpty together again. And he’s just sitting there, all yolk and shell, waiting…| The Coded Message
I enjoyed reading Atomic Habits, which was recommended to me by my therapist. I found this blog post basically finished in my attic folder while sorting through things, and I found it up to posting, even though my records show I read Atomic Habits way back in … October 2022. Self-Help in General Atomic Habits is pretty fundamentally a “self help book.” This is a pretty controversial genre in my experience.| The Coded Message
So you might or might not be aware about the debt ceiling argument currently taking place in the US. I’ve already written about this, but President Biden for some reason didn’t listen to me (perhaps because he doesn’t read my blog – which is disappointing). Other, more famous people have written about it too,, but the President insists on pretending he has to make a deal with the Republicans. So, to catch everyone up, here’s how this all works.| The Coded Message
Intel has just released a new white paper, where they discuss removing a lot of the legacy cruft of the Intel/AMD architecture they call Intel64. Only 64-bit operating systems – and a narrow set of 32-bit legacy apps that don’t use segmentation (a small subset in theory but basically all of them in practice) – will be supported. I am surprised at how excited I am, although after all this time perhaps the better word is “relieved.| The Coded Message
I was reading my ADHD blog post today, considering whether to send it to a friend, and it was surprisingly hard for me to bring myself to. I realized I was embarrassed at the voice, the phrasing, the lack of beauty in the individual words, all of which is something I paid relatively little attention to before – and which my friend, who also writes, will definitely notice. It’s something I’ve paid less attention to than I should.| The Coded Message
Here it is, the Rust vs C++ mdbook. I’ve wanted for a while to re-organize some of the content on my blog into gardens. I got the idea from the blog post “The Garden and the Stream: A Technopastoral”. Basically, some content is ill-suited to date-based, time-organized systems like blogs. In fact, most of my content remains valid over a long period of time, rather than participating in conversation (with some exceptions), but rapidly becomes less discoverable after I’ve written it, as ...| The Coded Message
Intro programming classes will nag you to do all sorts of programming chores: make sure your code actually compiles, write unit tests, write comments, split the code into functions (though sometimes the commenting and factoring advice is bad). Today, however, I want to talk about one little chore, one particular little habit, that is just as essential as all of those things, but rarely covered in the CS100 lectures or grading rubrics: logging.| The Coded Message
I know I set the goal for myself of doing less polemics and more education, but here I return for another Rust vs C++ post. I did say I doubted I would be able to get fully away from polemics, however, and I genuinely think this post will help contextualize the general Rust vs. C++ debate and contribute to the conversation. Besides, most of the outlining and thinking for this post – which is the majority of the work of writing – was already done when I set that goal.| The Coded Message
Does the choice of programming language matter? For years, many programmers would answer “no”. There was an “OOP consensus” across languages as different as C++ and Python. Choice of programming language was just a matter of which syntax to use to express the same OOP patterns, or what libraries were needed for the application. Language features like type checking or closures were seen as incidental, mere curiosities or distractions. To the extent there was a spectrum of opinions, it ...| The Coded Message
This is a collection of little Rust thoughts that weren’t complicated enough for a full post. I saved them up until I had a few, and now I’m posting the collection. I plan on continuing to do this again for such little thoughts, thus the #1 in the title. serde flattening What if you want to read a JSON file, process some of the fields, and write it back out, without changing the other fields?| The Coded Message
The validity of the public debt of the United States, authorized by law, including debts incurred for payment of pensions and bounties for services in suppressing insurrection or rebellion, shall not be questioned. US Constitution, 14th Amendment, Section 4 The debt ceiling is unconstitutional. We’ve let the Republicans play their games for long enough, in the interest of “stability of the economy” and a general fear of rocking the boat, but that time is over now.| The Coded Message
The NSA recently published a Cybersecurity Information Sheet about the importance of memory safety, where they recommended moving from memory-unsafe programming languages (like C and C++) to memory-safe ones (like Rust). Dr. Bjarne Stroustrup, the original creator of C++, has made some waves with his response. To be honest, I was disappointed. As a current die-hard Rustacean and former die-hard C++ programmer, I have thought (and blogged) quite a bit about the topic of Rust vs C++.| The Coded Message
ADHD is a controversial topic, and it’s never been more relevant. Diagnoses are soaring right now, driven up by a variety of interacting forces. Open discussion about ADHD – and the related general concept of “neurodiversity” – has been exploding on the Internet. And recently, there’s been a very unfortunate Adderall shortage. So I wanted to take an opportunity to share some thoughts about it. I would say that I was taking this opportunity to clear things up, but unfortunately, th...| The Coded Message
Rust doesn’t support default parameters in function signatures. And unlike in many languages, there’s no way to simulate them with function overloading. This is frustrating for many new Rustaceans coming from other programming languages, so I want to explain why this is actually a good thing, and how to use the Default trait and struct update syntax to achieve similar results. Default parameters (and function overloading) are not part of object-oriented programming, but they are a common ...| The Coded Message
Rust is not an object oriented programming language. Rust may look like an object-oriented programming language: Types can be associated with “methods,” either “intrinsic” or through “traits.” Methods can often be invoked with C++ or Java-style OOP syntax: map.insert(key, value) or foo.clone(). Just like in an OOP language, this syntax involves a “receiver” argument placed before a . in the caller, called self in the callee. But make no mistake: Though it may borrow some of th...| The Coded Message
I bought my M1 Mac over a year ago with the intention of installing Asahi Linux on it, but I never got around to it until now. I am still thrilled to be using an ARM workstation made by a major computer manufacturer, and it’s good to be able to run the operating system of my choice on it (though macOS is acceptable for entertainment and video calls, Linux is what I work and do my organization in).| The Coded Message
I don’t want you to think of me as a hater of C++. In spite of the fact that I’ve been writing a Rust vs C++ blog series in Rust’s favor (in which this post is the latest installment), I am very aware that Rust as it exists would never have been possible without C++. Like all new technology and science, Rust stands on the shoulders of giants, and many of those giants contributed to C++.| The Coded Message
As promised in my previous posts about organization, I will now go into some detail about my own organizational system. But before I start talking about it, and how I came to develop it, I’d like to emphasize a few points, or more specifically, three caveats, lest Zeus strike me down with a thunderbolt for my hubris: Caveat the First: My system is a work in progress. Even though it is overall very helpful, it’s always falling apart a little bit.| The Coded Message
I’m a Rust programmer and in general a fan of strong typing over dynamic or duck typing. But a lot of advocacy for strong typing doesn’t actually give examples of the bugs it can prevent, or it gives overly simplistic examples that don’t really ring true to actual experience. Today, I have a longer-form example of where static typing can help prevent bugs before they happen. The Problem Imagine you have a process that receives messages and must respond to them.| The Coded Message
I came across a programming problem recently where I wanted to use dynamic polymorphism with serde. This turned out to be much easier than I expected, and I thought it was an interesting enough case study to share, especially for people who are learning Rust. A Brief Discussion of Polymorphism in Rust As most of you will know, Rust’s system for polymorphism – traits – supports both static and dynamic polymorphism, with a bias towards static polymorphism.| The Coded Message
Memory Leak I have an excellent memory. I have a terrible memory. Well, which one is it? This is a confusing state to be in. It can be frustrating to people around me. How is it – my father used to ask me when I was in high school – that I could remember all the lessons and readings for my tests in school, and get all the good grades, but couldn’t ever remember to do the simplest task or household chore, or to bring with me the simplest item?| The Coded Message
Using async in Rust can lead to bad surprises. I recently came across a particularly gnarly one, and I thought it was interesting enough to share a little discussion. I think that we are too used to the burden of separating async from blocking being on the programmer, and Rust can and should do better, and so can operating system APIs, especially in subtle situations like the one I describe here.| The Coded Message
UPDATE 2: I have made the title longer because people seem to be insisting on misunderstanding me, giving examples where the only reasonable thing to do is to escalate an Err into a panic. Indeed, such situations exist. I am not advocating for panic-free code. I am advocating that expect should be used for those functions, and if a function is particularly prone to being called like that (e.g. Mutex::lock or regex compilation), there should be a panicking version.| The Coded Message
I enjoyed Plain Truth by Jodi Picoult. I finished it a couple of months ago, when I was feeling very restless and impatient about everything going on in my life. At the time, I desperately needed fun books to read, but I was simultaneously having a lot of trouble finishing books. This book pulled me the whole way through when other books were failing to: It was in a setting, the Amish communities, that had always interested me.| The Coded Message
The Error Message I’ve written before about just how befuddling Haskell error messages can be, especially for beginners. And now, even though I have some professional Haskell development under my belt, I ran across a Haskell error message that confused me for a bit, where I had to get help. It’s clear to me now when I look at the error message what it’s trying to say, but I legitimately was stumped by it, and so, even though it’s embarrassing for me now, I feel the need to write about...| The Coded Message
Preface (by Jimmy Hartzell) I am a huge fan of Jon Gjengset’s Rust for Rustaceans, an excellent book to bridge the gap between beginner Rust programming skills and becoming a fully-functional member of the Rust community. He’s famous for his YouTube channel as well; I’ve heard good things about it (watching video instruction isn’t really my thing personally). I have also greatly enjoyed his Twitter feed, and especially have enjoyed the thread surrounding this tweet:| The Coded Message
I just made a pull request to reqwest. I thought this particular one was interesting enough to be worth blogging about, so I am. We know that many C++ family languages have a feature known as function overloading, where two functions or methods can exist with the same name but different argument types. It looks something like this: void use_connector(ConnectorA conn) { // IMPL } void use_connector(ConnectorB conn) { // IMPL } The compiler then chooses which method to call, at compile-time, ba...| The Coded Message
Netflix should become a tech company. I hear the obvious response already: Jimmy, Netflix is already a tech company! Counterpoint: Is it though? Somehow, after two dot-com booms, the markets still have an aesthetic-based definition of what constitutes a “tech company”: If a company – any company – has an expensive enough app, and if its founders talk enough about “disrupting” industries, then it is a “tech company” and is therefore entitled to a valuation completely disconnect...| The Coded Message
I have worked on a lot of programming projects in my time, and while I was a programming consultant I have worked in a lot of different corporate environments. At some of them, it was easy to be concretely productive: I was able to contribute immediately, and at a rapid rate. At others, actual useful contributions would be impossible until I had a month or more of experience with a codebase, and even then every change would be a long slog.| The Coded Message
Mortgage interest rates have recently risen, and are currently very volatile. At the time of this writing, PSECU, my credit union, is offering mortgages at 5.125%, much higher than the 3.125% I locked in at, but lower than the peak above 6% I had recently read about in the news. But what does this mean in practice? Well, let’s run some numbers. Understanding how expensive a house is can be confusing.| The Coded Message
NOTE: This post has the #programming tag, but is intended to be comprehensible by everyone, programmer or not. In fact, I hope some non-programmers read it, as my goal with this post is to explain some of what it means to be a programmer to non-programmers. Therefore, it is also tagged with “nontechnical”. What is the most important skill for a software engineer? It’s definitely not any particular programming language; they come and go, and a good programmer can pick them up as they work.| The Coded Message
For my next entry in my series comparing Rust to C++, I will be discussing a specific data structure API: the Rust map API. Maps are often one of the more awkward parts of a collections library, and the Rust map API is top-notch, especially its entry API – I literally squealed when I first learned about entries. And as we shall discuss, this isn’t just because Rust made better choices than other standard libraries when designing the maps API.| The Coded Message
I am out of biking shape. I know I am out of biking shape. The pandemic has not been good to my physical fitness. (For the record, this isn’t a proper edited and outlined and triaged essay, just some notes on my past weekend.) But as out of shape as I am, I also know it’s only 25 miles from here to Philly on the Schuylkill River Trail, and so I figured maybe I could do it without any additional prep.| The Coded Message
For a time, I tried to cultivate an interest in Go. Not this Go, but this Go. The interest didn’t last long – like chess, I had a hard time getting up to even a fairly basic level of competence. And I quickly developed another enthusiastic interest to replace it – sometimes, an interest just doesn’t work out, and it’s nobody’s fault, and you have to just move on and not get too sad, because there’s plenty of fish in the sea.| The Coded Message
Let’s talk about an ancient programming language! I think we can all learn things from history, and it gives us grounding to realize that our time is just one time among many, to see what people in the past did differently, what they got wrong that we would never do now, and also to see what they got right. Do you remember MS-DOS? Do you remember that it came with an interpreted programming language?| The Coded Message
Everyone’s been asking me how India is and has been wondering if I’ve gone exploring. I haven’t really. Sunday I was just recovering from jetlag and yesterday I had work and then I immediately had to go home and crash I was so tired: so I guess again recovering from jet lag? This would normally not prevent me from exploring, but I’m honestly a little outside my comfort zone. I am not in a walkable neighborhood of a city like I expected, but next to a huge highway.| The Coded Message
The Way of NYC When I first moved to New York City, someone older and wiser than I gave me the following “rules” of New York City: Nothing is cheap. Nothing is easy. There are no exceptions to the first two rules. I found this to be extremely true in New York City. It was stressful and exhausting, and I was broke and living off an advance I’d gotten from my then-employer, living in AirBnB’s I could put on credit card, where I could maybe stay in each for a month, tops.| The Coded Message
Second collected thoughts on India. More Communitarian, Less Individualistic, Through Food and Beverage There is much less emphasis on individual choice. If you order tea (chay in Hindi) it will come with milk in it. If you order coffee, it will come with milk in it. They will not ask you how you want your coffee. Similarly, when I was in a cab ride between cities, I was not asked what food I wanted at the rest stop.| The Coded Message
Mothers Against Drunk Driving, the local clergy, and the town council had been planning this concept for over a year. Finally they did it: Right in the town square, they installed a giant loudspeaker. From thenceforth, every two minutes, a booming voice would spread all over town, announcing “Are you sure?” Foolhardy decisions, they had decreed, would soon be a thing of the past. The locals seemed to adapt pretty readily.| The Coded Message
Programmers of functional programming languages will often point out that, in functional programming languages, the order of the arguments is often significant, because of currying. If you have a function that takes two arguments (e.g. map which takes a function to apply and a list to apply it to) it actually takes the first argument, and returns a function that takes the second argument and returns the final result. This makes it more convenient to write a lambda where the second argument is...| The Coded Message
[Jesus said:] You have heard that it was said, “You shall not commit adultery.” But I say to you that everyone who looks at a woman with lustful intent has already committed adultery with her in his heart. If your right eye causes you to sin, tear it out and throw it away. For it is better that you lose one of your members than that your whole body be thrown into hell.| The Coded Message
A common trope within left-leaning American circles is to claim that the US is the only “developed” or “industrial” or “major” or “first world” country to not have X, where X is usually something like “publicly funded health care” or “government-guaranteed paid family leave” or similar. Recently this came up with Bernie Sanders and his common refrain that the US was the only “major” country to not guarantee health care as a human right.| The Coded Message
When Rajnish had agreed to mentor an intern, he was not expecting such a young girl. He was a little bit reassured when he was told how well Erica had done in college, that she was a “genius” — a dubious word, he would’ve preferred a “hard worker” or a “promising candidate” — but how could anyone deserve to be a junior in college at 17? She must be tricking everyone.| The Coded Message
A user of modern technology hears the term “operating system” thrown around a lot. Most people can name a few examples: Windows and macOS on workstations and laptops, iOS and Android on phones. Some people might even throw in Linux or Unix or ChromeOS. Most people also understand that a program or a game or even a sufficiently advanced website might work on some operating systems but not others, and might require different versions for different operating systems.| The Coded Message
I just finished singing Beethoven’s Missa Solemnis in a concert as a member of the Grace Church Choral Society, and it was the most technically difficult piece I have ever sung in a choir. It was a single piece of concert length, a mass setting, as is custom for our spring concerts. It was all in one language: in this case, in Latin. This is different from our holiday concerts in the winter, where we sing a variety of Christmas-y and otherwise celebratory works in a variety of (European, Ch...| The Coded Message
We use operating systems all the time in our life, whether designed for a computer, a phone, or for a server we’re more indirectly interacting with, but a lot of people don’t know very much about what connects the different systems we use, and what makes them distinct. We discussed fundamental concepts of operating systems in the last post, so in this post we will discuss how some of the same concepts apply to modern operating systems, going over them one at a time.| The Coded Message
Julia liked Eric. She wasn’t in love with Eric, she didn’t fantasize about marrying him or idly think about what their children would be like, but she liked him, an appropriate amount for having met him only two times. Internet dating was strange to her, and she knew that dating took work. And besides, it was a good sign she was mature enough to not feel those goofier feelings yet. She would instead be, appropriately, cautiously yet earnestly excited.| The Coded Message
Just wanted to write up a summary of random notes from my Switzerland trip, not including the conference which was also a lot of fun but I think less interesting for my non-programmer friends, slash it might make for a better separate post. SIM set up It was relatively easy to buy a Swisscom SIM card in the airport, although they did not offer to set it up in my phone for me.| The Coded Message