Coding Horror

programming and human factors

I Fight For The Users

If you haven't been able to keep up with my blistering pace of one blog post per year, I don't blame you. There's a lot going on right now. It's a busy time. But let's pause and take a moment to celebrate that Elon Musk destroyed Twitter. I can't possibly say it better than Paul Ford so I'll just refer you there:

Every five or six minutes, someone in the social sciences publishes a PDF with a title like “Humans 95 Percent Happier in Small Towns, Waving at Neighbors and Eating Sandwiches.” When we gather in groups of more than, say, eight, it’s a disaster. Yet there is something fundamental in our nature that desperately wants to get everyone together in one big room, to “solve it.” Our smarter, richer betters (in Babel times, the king’s name was Nimrod) often preach the idea of a town square, a marketplace of ideas, a centralized hub of discourse and entertainment—and we listen. But when I go back and read Genesis, I hear God saying: “My children, I designed your brains to scale to 150 stable relationships. Anything beyond that is overclocking. You should all try Mastodon.”

It's been clear for quite some time that the early social media strategery of "jam a million people in a colosseum and let them fight it out with free speech" isn't panning out, but never has it been more clear than now, under the Elon Musk regime, that being beholden to the whims of a billionaire going through a midlife crisis isn't exactly healthy for society. Or you. Or me. Or anyone, really.

I tried to be fair; I gave the post-Elon Twitter era a week, thinking "how bad could it possibly be?" and good lord, it was so much worse than I could have possibly ever imagined. It's like Elon read the Dilbert pointy-haired-manager book on management and bonked his head on every rung of the ladder going down, generating an ever-growing laundry list of terrible things no manager should ever do. And he kept going!

It's undeniably sad. I really liked Twitter, warts and all, from 2007 onward. In fact, it was the only "social network" I liked at all. Even when it became clear in the Trump era that Twitter was unhealthy for human minds, I soldiered on, gleaning what I could. I'm not alone in that; Clay Shirky's moribund signoff at the end of 2022 reflected how I felt:

Indeed, Twitter was murdered at the whims of a billionaire high on Ketamine while it was (mostly) healthy, because of the "trans woke virus".

I urge you, all of you, to disavow Twitter and never look at it again. No one who cares about their mental health should be on Twitter at this point, or linking to Twitter and feeding it the attention it thrives on. We should entomb Twitter deep in concrete with this public warning on its capstone:

This place is not a place of honor...no highly esteemed deed is commemorated here ...nothing valued is here.

In the end, I begrudgingly realized, as did Paul Ford, that Elon unwittingly did us a favor by killing Twitter. He demonstrated the very real dangers of any platform run by a king, a dictator, a tyrant, a despot, an autocrat. You can have all your content rug-pulled out from under you at any time, or watch in horror as your favorite bar... slowly transforms into a nazi bar.

I've been saying for a long time that decentralization is the way to go. We can and should have sane centralized services, of course, but it's imperative that we also build decentralized services which empower users and give them control, rather than treating them like digital sharecroppers. That's what our Discourse project is all about. I propose collective ownership of the content and the communities we build online. Yeah, it's more work, it's not "free" (sorry not sorry), but I have some uncomfortable news for you: those so-called "free" services aren't really free.

Geek-and-poke-pigs-free

Which, again, is not to say that "free" services don't have a place in the world, they do, but please don't harbor any illusions about what you are sacrificing in the name of "free". Grow up.

I take a rather Tron-like view of the world when it comes to this stuff; in the software industry, our goal should be to empower users (with strong moderation tools), not exploit them.

So I encourage you to explore alternatives to Twitter, ideally open source, federated alternatives. Is it messy? Hell yes it's messy. But so is democracy; it's worth the work, because it's the only survivable long term path forward. Anything worth doing is never easy.

I'm currently on Mastodon, an open source, federated Twitter alternative at https://infosec.exchange/@codinghorror – I urge you to join me on the Mastodon server of your choice, or quite literally any other platform besides Twitter. Really, whatever works for you. Pick what you like. Help make it better for everyone.

To inspire that leap of faith, I am currently auctioning off, with all funds to benefit the Trevor Project which offers assistance to LGBTQ youth, these 10 museum quality brass plaques of what I consider to be the best tweet of all time, hands down:

(Blissfully, @horse_ebooks is also on Mastodon. As they should be. As should you. Because everything happens so much.)

If you'd like to bid on the 10 brass plaques, follow these links to eBay, and please remember, it's for a great cause, and will piss Elon off, which makes it even sweeter:

https://www.ebay.com/itm/225895658859
https://www.ebay.com/itm/225895658395
https://www.ebay.com/itm/225895657953
https://www.ebay.com/itm/225895656856
https://www.ebay.com/itm/225895655560
https://www.ebay.com/itm/225895655243
https://www.ebay.com/itm/225895654889
https://www.ebay.com/itm/225895654391
https://www.ebay.com/itm/225895654002
https://www.ebay.com/itm/225895653408

I will sign the back of every plaque, because each one comes with my personal guarantee that it will easily outlive what's left of Twitter.

Discussion

The 2030 Self-Driving Car Bet

It's my honor to announce that John Carmack and I have initiated a friendly bet of $10,000* to the 501(c)(3) charity of the winner’s choice:

By January 1st, 2030, completely autonomous self-driving cars meeting SAE J3016 level 5 will be commercially available for passenger use in major cities.

I am betting against, and John is betting for.

By “completely autonomous”, per the SAE level 5 definition, we mean the vehicle performs all driving tasks under all conditions – except in the case of natural disasters or emergencies. A human passenger enters the vehicle and selects a destination. Zero human attention or interaction is required during the journey.

By "major cities" we mean any of the top 10 most populous cities in the United States of America.

To be clear, I am betting against because I think everyone is underestimating how difficult fully autonomous driving really is. I am by no means against self driving vehicles in any way! I'd much rather spend my time in a vehicle reading, watching videos, or talking to my family and friends … anything, really, instead of driving. I also think fully autonomous vehicles are a fascinating, incredibly challenging computer science problem, and I want everyone reading this to take it as just that, a challenge. Prove me wrong! Make it happen by 2030, and I'll be popping champagne along with you and everyone else!

(My take on VR is far more pessimistic. VR just… isn't going to happen, in any "changing the world" form, in our lifetimes. This is a subject for a different blog post, but I think AR and projection will do much more for us, far sooner.)

I'd like to thank John for suggesting this friendly wager as a fun way to generate STEM publicity. He is, and always will be, one of my biggest heroes. Go read Masters of Doom if you haven't, already!

And while I have you, we're still looking for code contributions in our project to update the most famous programming book of the BASIC era. Proceeds from that project will also go to charity. 😎

* We may adjust the amount up or down to adjust for inflation as mutually agreed upon in 2030, so the money has the desired impact.

Discussion

Updating The Single Most Influential Book of the BASIC Era

In a way, these two books are responsible for my entire professional career.

With early computers, you didn't boot up to a fancy schmancy desktop, or a screen full of apps you could easily poke and prod with your finger. No, those computers booted up to the command line.

From here, if you were lucky, you might have a cassette tape drive. If you knew the right commands, you could type them in to load programs from cassette tape. But that was an expensive add-on option with early personal computers. For many of us, if we wanted the computer to do anything, we had to type in entire programs from books like 101 Basic Computer Games, by hand... like so.

Yep, believe it or not, circa 1983, this was our idea of a good time. No, we didn't get out much. The book itself was a sort of greatest hits compilation of games collected from Ahl's seminal Creative Computing magazine in the 1970s:

As soon as Ahl made up his mind to leave DEC, he started laying the groundwork for Creative Computing. He announced intentions to publish the magazine at NCC in June 1974 and over the next few months contacted prospective authors, got mailing lists, arranged for typesetting and printing, and started organizing hundreds of other details.

In addition, he also moved his family to Morristown, NJ, and settled into his new job at AT&T. He had little spare capital, so he substituted for it with "sweat equity." He edited submitted articles and wrote others. He specified type, took photos, got books of "clip art," drew illustrations, and laid out boards. He wrote and laid out circulation flyers, pasted on labels, sorted and bundled mailings.

By October 1974, when it was time to specify the first print run, he had just 600 subscribers. But Ahl had no intention of running off just 600 issues. He took all the money he had received, divided it in half, and printed 8000 copies with it. These rolled off the presses October 31, 1974. Ahl recounts the feeling of euphoria on the drive to the printer replaced by dismay when he saw two skids of magazines and wondered how he would ever get them off the premises. Three trips later, his basement and garage were filled with 320 bundles of 25 magazines each. He delivered the 600 subscriber copies to the post office the next day, but it took nearly three weeks to paste labels by hand onto the other 7400 copies and send them, unsolicited, to libraries and school systems throughout the country.

I also loved Creative Computing, but it was a little before my time:

  • 1971 – Ahl ports the programs from FOCAL to BASIC.
  • 1973 – 101 BASIC Computer Games is first published by DEC.
  • 1974 – Ahl founds Creative Computing magazine and acquires the rights to the book from DEC.
  • 1977 – the “trinity” of Apple II 🖥️, PET ️🖥️, and TRS-80 🖥️ microcomputers are released to the public, all with BASIC built in, at prices regular people could mostly afford 🙌
  • 1978 – a second edition of BASIC Computer Games is released, this time published by Ahl himself.

As you can see, there’s no way average people in 1973-1976 were doing a whole lot with BASIC programs, as they had no microcomputers capable of running BASIC to buy! It took a while for inexpensive personal computers to trickle down to the mainstream, which brings us to roughly 1984 when the sequels started appearing.

There was a half-hearted attempt to modernize these early BASIC programs in 2010 with SmallBasic, but I didn't feel these ports did much to bring the code up to date, and overall had little relevance to modern code practices. You can compare the original 1973 BASIC Civil War with the 2010 SmallBasic port to see what I mean:

Certainly we can do a bit better than merely removing the line numbers? What about our old buddy the subroutine, merely the greatest invention in computer science? It's nowhere to be seen. 🤔

So it was with considerable enthusiasm that I contacted David H. Ahl, the author, and asked for permission to create a website that attempted to truly update all these ancient BASIC programs.

Thankfully, permission was granted. It's hard to understate how important this book was to an entire generation of programmers. At one point, there were more copies of this book in print than there were personal computers, period!

... in 1973, DEC published an anthology, 101 BASIC Computer Games. The book quickly went into a second printing, for a total of 10,000 copies sold. “That was far more books than there were computers around, so people were buying three, four, five of them for each computer.”

It went on to be the first computer book to sell a million copies. Quite a legacy.

I think we owe it to the world to bring this book up to date using modern, memory safe languages that embody the original spirit of BASIC, and modern programming practices including subroutines.

So let's do this. Please join us on GitHub, where we're updating those original 101 BASIC games in 10 memory safe, general purpose scripting languages:

  • Java / Kotlin
  • Python
  • C#
  • VB.NET
  • JavaScript
  • Ruby
  • Perl
  • Lua

(Edit: as of March 2022, we've a) offered Kotlin as an alternative to Java, b) removed Pascal since we can't guarantee memory safety there, and replaced it with Rust, which very much can, and c) added Lua which just cracked the top 20 in TIOBE and strongly meets the scripting and memory safe criteria.)

Now, bear in mind these are very primitive games from the 1970s. They aren't going to win any awards for gameplay, or programming sophistication. But they are precious artifacts of early computing that deserve to be preserved for future generations, including the wonderful original art by George Beker.

We need your help to do this right, and collaboratively together, as with all modern programming projects. Imagine we're all typing these programs in simultaneously together online, all over the world, instead of being isolated alone in our room in 1984, cursing at the inevitable typo we made somewhere when typing the code in by hand out of the book🤬.

Thanks Mr. Ahl. And a big thanks to everyone who contributed to this project when it was in beta, announced only on Twitter:

To encourage new contributions, by the end of 2022, for every functioning program submitted in each of the 10 indicated languages, I'll donate $5 to Girls Who Code. Before beginning, please read the guidelines in the readme, and if you have questions, scan through this discussion topic. And most of all, remember, this stuff is supposed to be fun.

(I don't want to be "that one guy", so I'm also looking for project co-owners who can help own and organize this effort. If this is a project that really appeals to you, show me what you can do and let's work together as a team.)

Perhaps as your new year's resolution you can see fit to carve off some time to take part in our project to update a classic programming bookone of the most influential books in computing history – for 2022 and beyond! 🎉

Discussion

Building a PC, Part IX: Downsizing

Hard to believe that I've had the same PC case since 2011, and my last serious upgrade was in 2015. I guess that's yet another sign that the PC is over, because PC upgrades have gotten really boring. It took 5 years for me to muster up the initiative to get my system fully upgraded! 🥱

I've been slogging away at this for quite some time now. My PC build blog entry series spans 13 glorious years:

The future of PCs may not necessarily be more speed (though there is some of that, if you read on), but in smaller builds. For this iteration, my go-to cases are the Dan A4 SFX ...

And the Streacom DA2 ...

The attraction here is maximum power in minimum size. Note that each of these cases are just large enough to fit ...

  • a standard mini-ITX system
  • SFX power supply
  • full sized GPU
  • reasonable CPU cooler

... though the DA2 offers substantially more room for cooling the CPU and adding fans.

http://i.imgur.com/odoYjle.jpg

I'm not sure you can physically build a smaller standard mini-ITX system than the DAN A4 SFX, at least not without custom parts!

DAN A4-SFX
200mm × 115mm × 317mm = 7.3 liters

Silverstone RVZ02 / ML08
380mm × 87mm × 370mm = 12.2 liters

nCase M1
240mm × 160mm × 328 mm = 12.6 liters

Streacom DA2
180mm × 286mm × 340mm = 17.5 liters

(For comparison with The Golden Age of x86 Gaming Consoles, a PS4 Pro occupies 5.3 liters and an Xbox One S 4.3 liters. About 50% more volume for considerably more than 2× the power isn't a bad deal!)

I chose the Streacom DA2 as my personal build, because after experimenting heavily with the DAN A4 SFX, I realized you need more room to deal with extremely powerful CPUs and GPUs in this form factor, and I wanted a truly powerful system:

  • Intel i9-9900KS (8 core, 16 thread, 5.0 GHz) CPU
  • Samsung 970 PRO 1TB / Samsung 970 EVO 2TB / Samsung 860 QVO 4TB SATA
  • 64GB DDR4-3000
  • Cryorig H7 cooler (exact fit)
  • NVIDIA GeForce RTX 2080 Ti GPU

Compared to my old 2015-2017 system, a slightly overclocked i7-7700k, that at least gives me 2× the cores (and faster cores, both in clock rate and IPC), 2× the memory, and 2× the M.2 slots (two versus one).

The DA2 is a clever case though less perfect than the A4-SFX. What's neat about it is the hybrid open-air design (on the top and bottom) plus the versatile horizontal and vertical bracket system interior. Per the manual (pdf):

Check out all the bracket mounting options. Incredibly versatile, and easy to manipulate with the captured nut and bolt design:

Note that you can (and really should) pop out the top and bottom acrylic pieces with the mesh dust net.

I had dramatically better temperatures after I did this, and it also made the build easier since the case can fully "breathe" through the top and bottom. You'll note that the front of the DA2 is totally solid, no air holes, so you do need that extra airflow.

I only have a few criticisms of this Streacom DA2 case:

  • The side panels are tool free, which is excellent, but the pressure fit makes them fairly difficult to remove. Feels like this could be tweaked?
  • (Don't even think about using a full sized ATX power supply. In theory it is supported, but the build becomes so much more difficult. Use a SFX power supply, which you'd expect to do for a mini-ITX build anyway.)
  • My primary complaint is that the power extension cable gets in the way. I had to remove it and re-attach it during my build. They should custom route the power cable upwards so it blocks less stuff.
  • Less of a criticism and more of an observation: if your build uses a powerful GPU and CPU, you'll need two case fans. There's mounting points for a 92mm fan in the rear, and the bracket system makes it easy to mount a 140mm fan blowing inward. You will definitely need both fans!

Here's the configuration I recommend, open on both the top and bottom for maximum airflow, with three fans total:

If you are a water cooling kind of person – I am definitely not, I experienced one too many traumatic cooling fluid leaks in the early 2000s – then you will use that 140mm space for the radiator.

I have definitely burn-in tested this machine, as I do all systems I build, and it passed with flying colors. But to be honest, if you expect to be under full CPU and GPU loads for extended periods of time you might need to switch to water cooling due to the space constraints. (Or pick slightly less powerful components.)

If you haven't built a PC system recently, it's easier than it has ever been. Heck by the time you install the M.2 drives, memory, CPU, and cooler on the motherboard you're almost done, these days!

There are a lot of interesting compact mini-itx builds out there. Perhaps that's the primary innovation in PC building for 2020 and beyond – packing all that power into less than 20 liters of space!

Read a Spanish translation of this article here.

Discussion

The Rise of the Electric Scooter

In an electric car, the (enormous) battery is a major part of the price. If electric car prices are decreasing, battery costs must be decreasing, because it's not like the cost of fabricating rubber, aluminum, glass, and steel into car shapes can decline that much, right?

ev-battery-costs

On an electric scooter, though, the effect of battery price has to be even more dramatic because scooters are such lightweight, compact, and simple machines. They aren't much more than a battery and an electric motor to begin with. Remember the the Zappy electric scooter from twenty years ago?

zappy-electric-scooter-year-2000

What killed the electric scooter back then is the same thing that killed the electric car of year 2000: terrible lead-acid battery technology. It's too heavy, it lacks power, it doesn't have enough range, it takes too long to charge. These are all different ways of saying the same thing: the battery sucks. It wasn't until Lithium Ion batteries matured that both the electric car and the electric scooter — and pretty much electric everything, if you think about it — became viable.

Thus, one way to see if Lithium Ion battery prices are indeed generally dropping independent of all other manufacturing concerns is to examine the cost of electric scooters over the last few years. Let's consider one of the most popular models, the Xiaomi Mi M365:

xiaomi-mi-m365-price-history-2018-2019

This graph only shows roughly two years, from January 2018 to now; it looks like the original price for the Xiaomi M365 when it hit the US market in early 2017 was around $800. So the price of a popular, common electric scooter has halved in three years. Very good news indeed for electric vehicles of all types!

This dramatic drop in electric scooter price from 2016 to 2019 may not be surprising versus the parallel rise of the quasi-legal electric scooter smartphone app rental industry over roughly the same time period, in the form of Bird, Lime, Skip, Spin, Scoot, etc.

electric-scooter-rentals-bird-lime

Early versions of Bird scooters were actual Xiaomi M365s, slightly modified for rental. Only by late 2018 had they migrated to custom built, ruggedized scooters optimized for the rental market. The rental industries have their own challenges, and ironically have started to pivot to monthly rentals rather than the classic 15 cents per minute.

Bird has experimented with its business model in recent months. In early March, the company altered its repair program in Los Angeles, which had relied on gig workers to fix broken scooters. It moved repairs in-house (though scooters are still charged each night by an army of gig workers). Later that month, the company introduced scooters with locks in some markets, in a bid to prevent theft and vandalism.

In April, it announced the launch of a more traditional rental program in San Francisco and Barcelona, in which users could pay $25 per month to rent a Xiaomi m365 from the company rather than paying per ride.

But this isn't meant to be a blog entry about the viability of scooter rental company business models.

I want to tackle a more fundamental question: are electric scooters the future of transportation?

Even Uber, as screwed up of a company as they still are, knows cars are overkill for a lot of basic transportation needs:

We have plenty of scooters here at my house, and the family and I enjoy them greatly, but I have never actually ridden or owned an electric scooter. So I bought one. It is of course the popular, inexpensive, and well reviewed Xiaomi Mi M365.

m365-scooter

Here's a picture of my electric scooter inside my electric car. (I apologize that I didn't have an electric bicycle to park next to it for maximum smugness, but you can bet your sweet electrons I'll work on that next!)

electric-scooter-in-electric-car

The short version of my review is this electric scooter is incredibly fun, works great, and if you can get it for a price around $300, practically a no-brainer. I love it, my kids love it, and as long as you're conceptually OK with the look, unlike Elon Musk 🛴💨 then you'll probably love it too.

I found a neat video covering the "one year later" experience of owning the scooter, and what you might eventually run into or want to tweak.

(The main thing to take away from this video is that flats super suck on tires this small, so be warned. I put Slime in my Mi's tires out of an abundance of caution, but you could also go with solid tubeless tires – at the cost of some ride comfort – if you're really worried.)

That's not to say that the electric scooter experience is perfect. There are some challenges with electric scooters, starting with the biggest one: your local government has no idea how to regulate the darn things.

  • Is this regulated like a bicycle? If not, why not?
  • Are they allowed on the sidewalk?
  • Do you have to ride them in the road, with cars … uh, depending on the speed limit?
  • Do you need a driver's license?
  • Do you need a helmet?
  • Are you even allowed to legally ride them in public at all outside of private property?

The answers also vary wildly depending on where you live, and with no consistency or apparent logic. Here are the current electric scooter laws in California, for what it's worth, which require the rider to have a valid driver's license (unlike electric bicycles) and also disallow them from sidewalks, both of which I feel are onerous and unnecessary restrictions.

One aspect of those laws I definitely agree with, however, is the 15 mile per hour speed restriction. That's a plenty brisk top speed for a standing adult with no special safety equipment. Anything faster starts to get decidedly … uncomfortable. Consider this monster of a 1165KWh electric scooter, with dual motors and dual suspension that goes up to forty freakin' miles per hour.

That … is … terrifying. Even the reviewer, in full motorcycle safety gear, wasn't willing to push it all the way to 40 MPH. And I don't blame him! But now that I've shown you the undisputed Honda Civic everyman budget model of electric scooter in the M365, hopefully this gives you a taste of the wider emerging diversity in these kinds of minimalistic electric vehicles. If you want a luxury electric scooter, an ultralight electric scooter, a rugged offroad electric scooter … all things are possible, for a price.

Another reason the M365 is available for so cheap is that is successor, the Xiaomi M365 Pro, was recently released, although it is not quite possible to obtain in the US at the moment.

Having ridden my M365 a fair bit, I can confirm all the Pro improvements are welcome, if incremental: bigger battery and disc brake, more power, better display, improved latch mechanism, etc.

xiaomi-mi-m365-vs-pro

None of those Pro improvements, however, are worth a 2× increase in price so I'd recommend sticking with the M365 for now because its value proposition is off the charts. Did I mention there's a bluetooth connection, and an app, and it is possible to hack the M365 firmware? Pretty cool how electric vehicles are inherently digital, isn't it?

Here are a few other observations after riding my M365 around a fair bit:

  • Please be respectful around pedestrians. Most of the sidewalks around here are not busy at all, but the pedestrians I encountered on the electric scooter were definitely more freaked out than I’ve seen before when using regular kick scooters (or skateboards) on the sidewalk, which did surprise me. An electric scooter has more heft to it, both physically at 26 pounds, and in the 15 mile per hour speed it can reach – but also mentally in terms of how it looks and how people approach it. I recommend slowing down to just above walking speed when encountering pedestrians, and if there is a bike lane available, I'd definitely recommend using that.

  • Hills work great. The kryptonite of traditional kick scooters is hills, and I'm pleased to report that even with a cough sizable adult such as myself riding, I was able to sustain a respectable above-walking speed on most reasonable hills. Where I looked at a hill and thought "this probably should work", it did. That's impressive, considering this isn't the upgraded Pro model with bigger battery and more powerful motor. On flats and downhills the performance is superb, as you'd expect. That said, if you are a really big or tall adult, or live in a particularly hilly area, wait for the Pro model or an equivalent.

  • Portability is good, but borderline. At ~26 pounds, the electric scooter is reasonably portable, but it's not something you a) could really get away with taking inside a restaurant / store with you to prevent theft or b) want to be carrying around on your person for any significant length of time. It's not nearly as nimble or portable as a kick scooter, but that's a high bar. You'll need to carry a bike lock and think about how to lock your scooter on bike racks, which turned out to be … more geometrically challenging than I anticipated due to the small tires, disc brakes, and the engine in the front wheel. They need more obvious locking points on the chassis.

To be honest with you I'm still bitter about the whole Segway debacle. There was so much hype back in the day. That ridiculous thing was supposed to change the world. Instead, we got … Paul Blart Mall Cop.

paul-blart-segway

A Segway was $5,000 at launch in 2001, which is a whopping $7,248 in inflation adjusted dollars. Here in 2019, cheap $200 to $300 electric scooters are basically the transformational technology the Segway was supposed to be, aren't they? Are electric scooters the future of (most) transportation? I'm not sure, but I do like where we're headed, even if it took us twenty years to get there.

Discussion