News for hackers. Stuff that matters.
Re:Things that used to be hard and are now easy by romaniv on Sunday February 20, 2022 @12:35PM (#30407400)
The general theme of this list is that technology gives us more and more hoops to jump through, then provides some trampoline to jump through them. We're supposed to be eternally grateful. I'm not. I want to focus on problem-solving, not masterfully using trampolines.

> SSL certificates, with Let’s Encrypt

Semi-mandatory SSL certificates weren't a thing on the web until fairly recently. Not managing them at all was certainly easier than managing them with Let's Encrypt, which has a lot of gotchas, requires tooling, knowledge and can suddenly break your website if something is off.

> Concurrency, with async/await (in several languages)

async/await usage is literally the main reason why my recent project is written in Go instead of C#. I like C#. I don't like Go. But dealing with all the gotchas of .NET Core async/await APIs drove me away.

Moreover, Erlang had a much more sane and powerful parallelism model way before async/await.

> Centering in CSS, with flexbox/grid

Again, like with SSL, this is technically correct, but generally incorrect. Centering in CSS has gotten much easier with flexbox/grid. However, centering in HTML only became hard because tables were abandoned as the layout mechanism. Sure, they're not "semantic". But we're talking about what became easier, right? Not about what became more ideologically correct, semantic, etc.

> Configuring cloud infrastructure, with Terraform

Again, there used to be no Cloud infrastructure to configure. Personally, I find Terrafrom annoying more than anything else.

> Setting up a dev environment, with Docker

As opposed to doing what? Keeping my dev environment simple is a constant battle and most of the time Docker is the weapon used by the other side. In 00s my dev environment was a text editor and some upload tool.

I haven't used PHP in well over a decade, but for my latest personal project I've decided to brush up on PHP 8.1. Despite awful syntax, I can do stuff by writing a handful of lines of code in a text editor. It's very refreshing. 100% focus on the outcome rather than tooling.

Re:Things that used to be hard and are now easy by tele_ski on Sunday February 20, 2022 @12:42PM (#30407462)
I've been on teams that haven't used docker for dev envs and teams that do in the last 5~ years. The teams that used docker were significantly more productive since each dev env was a replica and forced the team to maintain a common env. The dev env drift without it is huge and causes so many "it works on my machine". I can see a one man show or maybe two not needing a docker dev env but any sizable team IMO it is absolutely required now. You're absolutely right that it is a hoop to jump through, but its a hoop I find very necessary.
Re:Things that used to be hard and are now easy by tsm on Sunday February 20, 2022 @01:05PM (#30407718)
I've worked on Rails, Node, and Clojure teams where Docker was optional and was always glad I avoided it. There has never been something important in my dev environment[1] that couldn't be responsibly managed by rbenv and bundler (or their equivalents for other languages).

[1] The one exception is SQL DBs and redis, but I have always been fine using brew, linuxbrew, or apt for them.

Re:Things that used to be hard and are now easy by taeric on Sunday February 20, 2022 @12:57PM (#30407630)
Oddly, my experience is a mixed bag here. Teams I've been on that went for rigid standardization with docker have largely been much harder to upgrade than those that allow local dev however the dev wants.

This is subtle. There are more bumps along the way. However, the task of upgrading isn't neglected forever. Instead, it usually seems that each new member winds up upgrading some small piece and making sure the code works with a small change in environment.

Re:Things that used to be hard and are now easy by nirvdrum on Sunday February 20, 2022 @01:41PM (#30408116)
How did you handle differences in macOS/Windows and Linux? The last team I was on that tried to do all local development in Docker kept running into breakages. To allow the devs to use whatever editor or IDE they wanted, the source code was stored in the host system and mounted as a Docker volume. While that sounds simple, it's amazing how many times things broke depending on who set it up.

By default, Docker runs everything as root. This isn't a huge problem on macOS or Windows, where Docker runs in a VM and there's some sort of UID mapper mediating things. If a file is generated from a process within Docker (e.g., temporary or log files) and you're running in Linux, now you have files in your local system that you can't edit without "sudo". Fine, don't run the container as root. I'd have expected that to be a best practice, but it doesn't come up in Docker's best practices guide [0]. Adding our own user and switching to that isn't a huge hurdle, although this didn't seem to be an area that we'd have to chart our own path. Unfortunately, some 3rd party images don't run particularly well, if at all, if not run as root.

Once we got that running, we hit our next issue. Although things were working well for one developer, they broke for another because there still existed the same basic problem with Linux users ending up with files owned by UIDs other than their local account. It turns out that not every dev is running with the same UID. Okay, so now we need to map the UID and GID at image build time, but that might break things for people on macOS.

All of our Dockerfiles ended up with something like:

  ARG app_user_uid=61000
  ARG app_user_gid=61000
  ENV APP_USER="app"
  RUN groupadd -g $app_user_gid -o $APP_USER
  RUN useradd --no-log-init --create-home --shell /bin/false --gid $app_user_gid --uid $app_user_uid -o $APP_USER
And needed to be built on Linux with:

  docker-compose build --build-arg app_user_uid=$(id -u) --build-arg app_user_gid=$(id -g) ...
While macOS users used the simpler:

  docker-compose build ...
This all took quite some time to figure out. The person working on it would get things working, think it was all good, push it up, and only find out later that it wouldn't work on another dev's system. CI couldn't catch everything. The point of using Docker was to ensure there weren't inconsistencies against dev environments and that dev matched production. That seems like a fairly common use case, but we couldn't find anything on how to simplify this setup for teams other than mandating every user run the same exact system configuration. I have to believe we were doing something wrong, but we really couldn't find anything on the topic. I'd love to hear how you solved the problem.

[0] -- https://docs.docker.com/develop/dev-best-practices/

Re:Things that used to be hard and are now easy by mwcampbell on Sunday February 20, 2022 @12:45PM (#30407484)
> But we're talking about what became easier, right? Not about what became more ideologically correct, semantic, etc.

Then think of it this way: it became easier to make the content/UI both good looking and fully accessible (e.g. to screen reader users, for whom layout tables are indeed a hindrance).

I think the same applies to the other hoops to jump through; they're solving a real problem, just perhaps one that doesn't directly affect many of us so we tend to ignore it.

Re:Things that used to be hard and are now easy by taeric on Sunday February 20, 2022 @01:00PM (#30407667)
Sorta. Screen readers, being external programs, really had no trouble dealing with tables. The tag wasn't semantic, sure; but the intent and reasoning wasn't exactly difficult.

I suspect that the giant explosion in primitives for a screen reader to deal with had actually made the job harder.

And this is ignoring the explosion in nested divs that most modern sites have.

Re:Things that used to be hard and are now easy by mwcampbell on Sunday February 20, 2022 @01:26PM (#30407969)
Considering that I've developed a screen reader from the ground up, worked on the Narrator screen reader shipped with Windows, and routinely used screen readers to browse the web for almost 20 years, I think I know a thing or two about this.

So, it's true that screen readers have heuristics for detecting layout tables. But those heuristics aren't perfect. They're not even that sophisticated, at least the ones that I worked on. And some (most?) screen readers automatically announce any table that they don't detect as a layout table, even when continuously reading straight through the document. Notably, the screen reader I developed myself, which was the first one I routinely used, doesn't automatically announce tables unless the user is manually moving through the page, because I wanted to minimize verbal clutter when casually browsing the web. But when I went to work at Microsoft and started using Narrator to read my work email, I found the tables in certain HTML emails very annoying. Granted, Narrator didn't yet have a layout table heuristic at that time, but even when it did, that didn't entirely solve the problem. Luckily, there was also an overhaul in Narrator's verbosity levels while I was there, and that allowed me to eliminate the clutter of layout tables by reducing the verbosity level in my personal Narrator settings, perhaps at the cost of missing some other things.

Nested divs per se aren't a problem. Implementing a widget as a div without the appropriate ARIA markup is a problem.

Re:Things that used to be hard and are now easy by taeric on Sunday February 20, 2022 @02:29PM (#30408500)
This feels inline with what I intended. Used sparingly, tables probably weren't that atrocious to figure out. Similarly, deliberate use of semantic tags is likely better. I question if things are deliberate are much better now. But, you provide a convincing and authoritative answer there.

Html email feels like a trap. They are about turning up the volume and getting returns. Not about being accessible. Is that not the case?

Re:Things that used to be hard and are now easy by mwcampbell on Sunday February 20, 2022 @02:35PM (#30408542)
About HTML email, I think it's different in a work context. When I was at Microsoft, some official messages, that were actually important to read, were laid out in the style of an HTML marketing email, complete with heavy abuse of layout tables. Ditto for automated notifications, e.g. about bugs or PRs.
Re:Things that used to be hard and are now easy by taeric on Sunday February 20, 2022 @02:48PM (#30408688)
Ah, that makes sense. And feels like a mistake from the department that sent the messages.

My gut is still that better tooling support for standard messages would have helped faster than more primitives in the message. But, I welcome evidence that I'm wrong.

Re:Things that used to be hard and are now easy by kalensh on Sunday February 20, 2022 @01:21PM (#30407902)
It really depends. If table cell order happens to conform with a logical reading order, yeah, screen readers generally figured out when to ignore table semantics. But if the reading order does not make sense going row by row, then they are terribly broken.

Nested divs aren't that bad. (Ignoring overall performance considerations. And even then I'd suspect that's less a concern than download and running all these JS libraries.) Nested divs with a mish-mash of poorly applied ARIA can get pretty bad though!

Table layouts are also terrible for anyone who is not viewing the site at the browser width you designed it for. Accessibility is more than screen readers, and the ability to zoom or adjust browser width or display on a different device (hello mobile) is incredibly valuable for a lot of people. And I'd argue that the "ease" of using table layouts disappears as soon as you try to accommodate for any of that.

Re:Things that used to be hard and are now easy by taeric on Sunday February 20, 2022 @02:31PM (#30408516)
Right, my complaint in nested divs is more when they are a giant mix of different levels with no real discernable logic at the markup level. I think my memory is more from the garbage we made in early 2000s, though. I haven't tried to look at any modern page markup lately.
Re:Things that used to be hard and are now easy by BenoitEssiambre on Sunday February 20, 2022 @01:05PM (#30407722)
Yeah I may be the only one, but I still think async/await was a huge missed opportunity to get rid of promises like I proposed here for javascript:

https://es.discourse.group/t/callback-based-simplified-async...

It seems quite inneficient to me to wrap every function call in a caching layer and state machine that pretty much goes unused in the context of async/await and makes things unecessarily hard to undertand for new programmers.

Re:Things that used to be hard and are now easy by UglyToad on Sunday February 20, 2022 @12:58PM (#30407638)
Out of curiosity what were the

> [...] gotchas of .NET Core async/await APIs drove me away.

I kind of lost track of the framework to core changes but I think it became simpler with the removal of synchronization contexts?

Re:Things that used to be hard and are now easy by MaXtreeM on Sunday February 20, 2022 @01:01PM (#30407669)
Async/await is not for parallelism.
Re:Things that used to be hard and are now easy by dehrmann on Sunday February 20, 2022 @01:32PM (#30408036)
The article actually said "concurrency." In the case of the article, it's being oversold because it's not that much better than the old one thread per request model. Cross-request interactions are rare, so you're more or less writing the same code, only with async, you have to be careful not to accidentally do something CPU-intensive for 50ms, and if your runtime supports multiple cores (so not Ruby or Python), you still have to be careful with race conditions and locks.

Writing parallel code that isn't clearly a divide and conquer variant is hard. Async doesn't help with that at all; it gives you more efficient context switches.

I personally find threaded code easier to reason about because there can be a context switch anywhere, so you always need to think about locks and coordination. With aysnc code, a block of code without locks and be correct...until you add an await in the middle, and this isn't always obvious.