HNHacker News
TopNewBestAskShowJobs

hmeh

159 karma · joined February 9, 2010

Contact: aaronjensen at gmail

Software Development Articles: https://github.com/aaronjensen/software-development/#software-development

submissionscomments
hmeh··on Differential: Type safe RPC that feels like local functions
Understood, and perhaps the difference here is more about what I said in my other comment. I don't see this as particularly useful, and I see it as deceptive. What matters is that when we intend to do something is that it happens. We actually want retries. We want exactly-once processing with at-least-once handling. That's the only way that I know of to build resilient systems.

Our back end components literally crash when they fail. No other processing is done. They crash and if there is a bug they will keep crashing. Because our back end components have autonomy, this results in a very narrow service disruption. We fix the issue, identify the root cause and eliminate it. As a result, we have extremely resilient systems that, even in the face of 3rd party downtimes, we can know that every command that gets submitted will be effected. Dead letter queues or anything of the sort are anathema. We try until we succeed. Idempotence is considered in every single handler all the way from the inside to the outside as it must be, mathematically.

hmeh··on Differential: Type safe RPC that feels like local functions
This would likely require a longer, higher bandwidth conversation than we could or should do in a comment thread. If you're interested, you can join me in the Eventide Slack [4], but I will warn you there's already some discussion about this offering (though, nothing I haven't said here). But, I'm here, so... :)

When I say it's like DCOM/CORBA, I'm referring to the notion of RPC. Specifically, the notion that it's a good idea to perform synchronous remote calls as a matter of course. It significantly reduces autonomy. In my opinion, we should not be encouraging people to build distributed monoliths, even if we can make it look like a regular monolith.

Monolithism is the problem [1] [2], and distributing that monolith only solves technical issues, but not the productivity ones that typically matter more. Distributing them also creates technical issues in terms of latency and cascading failures.

The existence of a control plane doesn't impact my concern about this, but it does add an additional concern. See smart pipes vs. dumb pipes. [3]

> I do apologise for having a modern looking marketing page.

That's not necessary, I wasn't saying that was bad. It looks nice, but if it's marketing something that can be harmful, that would be the problem. Its aesthetics are a differentiating factor. I wasn't trying to say anything more about it than that.

> But the reason why this has been tried before in the software development history tells me that the proper abstraction is somewhere out there.

Maybe, or maybe we don't pay enough attention to our past learnings and the body of knowledge that came before us.

> Wise words, but I'd appreciate it if you could dive into the way things are [1] [3] a little bit, and let me know if you hold the same views.

I read these, and there's nothing that I would consider new, although it is somewhat surprising to read what effectively amounts to the goal being to add network hops and complexity to monolithic code in order to get scaling and other technical benefits.

> Monolithic codebases provide a great developer experience, but resulting monolithic services often do not.

I disagree [5]. They only appear to provide that to teams that don't yet have the skills necessary to do proper partitioning. I believe that teams, and developers in general, will be better served by learning how to do this. They will unlock long term continuity [6] in productivity that they couldn't have imagined.

> Instead of n services talking to n services...

Here's a hint at the fundamental disconnect. Services shouldn't talk to other services. Period. Not if that can be avoided. See: autonomy. This is where pub/sub comes in. When services have autonomy, developers have productivity, and products are more resilient (at the very least).

[1] https://github.com/aaronjensen/software-development/blob/mas...

[2] https://github.com/aaronjensen/software-development/blob/mas...

[3] https://twitter.com/sbellware/status/1760037861347258416

[4] https://eventide-project.org/

[5] https://github.com/aaronjensen/software-development/blob/mas...

[6] https://github.com/aaronjensen/software-development/blob/mas...

hmeh··on Differential: Type safe RPC that feels like local functions
I see elsewhere you mention that you use at most once processing. So, I was possibly mistaken that the function can be called more than once assuming you did this right (cleared the job before even invoking the job). My primary point still stands: this is not idempotent, at least not in the way that matters. This is single-try processing. If all you are doing is returning a synchronous error to the user so that they can retry (and again, every other operation leading up to the one that failed to process is actually idempotent) then this would not be catastrophic. The issue is when people start to think that this actually is idempotence, i.e., they attempt to reuse an idempotence key across requests when the first one straight up failed (or not, who knows).

In other words, don't use the idempotence helper if you care about the thing happening. If it's optional, sure, go for it. You could rename it to "tryOnce", or "maybeRun" rather than "idempotence" and it'd be more accurate / less misleading.

hmeh··on Differential: Type safe RPC that feels like local functions
Without looking at the code, I can tell you that this will reproduce one of two things:

1. Invoke function that has two side effects

2. Function does first side effect

3. Pull the computer's plug out of the wall

A framework can only do one of two things:

A. Invoke the function again

B. Not invoke the function again

If you choose A, you have at least once processing

If you choose B, you have at most once processing

Neither of these are exactly once, therefore, neither one of these are idempotent unless the first side effect that the function performs is also idempotent. That is, you must be able to retry that one.

I believe you mention exactly once processing in another comment. It's this. The massive lie that many of these types of frameworks tell is that they can manage idempotence for you. Aside from functions that are side effect free (that is, pure, that is referentially transparent, that is can be made mathematically idempotent) you cannot possibly make them idempotent. It's the two generals problem.

So, I believe what you have implemented is idempotence at the sender with the reservation pattern. This is not the same as idempotence at the processor which is literally the only thing that matters. Idempotence at the sender is simply a performance (or storage, in the case of event sourcing) optimization.

Please correct me if I'm wrong on any of this, but if I am, then clearly my understanding of the two generals problem and distributed systems are wrong and I'm going to have to do some significant rethinking of our system's architecture.

hmeh··on Differential: Type safe RPC that feels like local functions
Yeah, exactly. DCOM was a failure for the same reason that every other RPC thing is a failure. It turns out that introducing cascading failure or partial failure opportunities due to synchronous remote calls was never a good idea. It was always, and still is, treating the fallacies of distributed computing as first principles.
hmeh··on Differential: Type safe RPC that feels like local functions
Yes, quite. Unless my function has no side-effects, idempotency will always be my responsibility. This feature is a lie and an outright hazard. It should not be called idempotency and it should have a big bold warning stating that the function may be called more than once.
hmeh··on Differential: Type safe RPC that feels like local functions
The problem though is that you're taking the known failure mode interpretation of microservices (what we call a distributed monolith) and making it "easier" by adding significantly more complexity. As many of the other comments here have said, this has been done before. You are repeating the mistakes of DCOM and gussying it up with a modern-looking marketing page.

You demonstrate a lack of understanding of idempotence on your marketing page, which is enough to dismiss your service outright. With all due respect, I'm sure you've put a ton of work into this, and you may even manage to sell it to some teams, but this has been tried and failed so many times in software development's history. It won't be any different now. This is very likely to cause long term harm to any team that adopts it.

For anyone considering it, please make sure you actually understand idempotence and autonomy. Look into event sourcing. Study the fallacies of distributed computing. Check out the work of Udi Dahan and Scott Bellware. Run, do not walk from anything purporting to do the things that this does.

hmeh··on Utility classes aren't the same as inline styles (2021)
I wouldn't say it's often anymore, but it happens. It comes with the territory. We can sometimes avoid giving them class names by targeting them with things like immediate child selectors. We do end up with mechanical class names from time to time. But that doesn't mean we throw in the towel on modeling entirely.
hmeh··on AI commented the entire Spring Boot codebase
Given that the only comments worth having are typically those that explain why, and an AI would have a hell of a time knowing why code was the way it was, there's very little chance that this does anything but add noise. It's exactly the type of "productivity enhancement" we should expect from AI right now. That is, as long as you measure productivity by lines of code and nothing else that actually matters to the business.
hmeh··on Amazon blocks long-running FireTV capability, Breaking apps with no warning
That’s all it does?
hmeh··on Amazon blocks long-running FireTV capability, Breaking apps with no warning
I didn’t know what it was until someone posted a reply to my comment. I don’t have an Android device and I can’t be bothered to fill in the obvious gaps the author left when the thing isn’t of immediate consequence to me.

It wasn’t intentional, but one could argue by my not defining the term I helped it really sink in for people how annoying it is, heh.

hmeh··on Utility classes aren't the same as inline styles (2021)
Or it's to call to the carpet the people that are enforcing "stack requirements" of tooling that is overly complex for the job.

> I've seen projects with many engineers breaking each other's features because they weren't specific enough with their CSS targeting.

Agreed, and to add to that -- unless a team is willing to stop the line and understand why and how this happened, it will keep happening. Tailwind eliminates classes of problems without requiring people to collaborate or think. That's its "benefit". As I've said elsewhere, it comes with costs, but many of those are subtle (many devs won't have enough experience to observe them) in their short term effects.

> I'm a fan of understanding the grittier side of the box-model but I've found that I can't outpace a system designed by a team of engineers to solve the problem of quick and easy layouts and components.

> I've seen projects with many engineers breaking each other's features...

I don't usually comment on people using "engineer" to describe software developers, but the irony in these statements is a bit much. What is being described is not engineering, it is hacking. It shouldn't be a surprise that when we hack, we break things.

hmeh··on Amazon blocks long-running FireTV capability, Breaking apps with no warning
Anyone that has a mental model that includes what ATMs do. The point is that most people don't use ADB and therefore don't have that mental model. Many people have used an ATM, so if an article talked about someone stealing cards/pins on an ATM, most people would know what it meant. There are certain abbreviations that are so commonplace it may be safe to assume people know what they mean, even if they do not know what they stand for.

ADB is not one of those. This is the point, and this is the thing that anyone who is arguing against that point fails to recognize. It's myopia, or self-centered thinking. It leads to bad things in our industry (poor UX being one of them) and I'd encourage anyone thinking this way to consider what "empathy" means and how it is applicable to our field.

hmeh··on Amazon blocks long-running FireTV capability, Breaking apps with no warning
If I recall, the article seemed to indicate that certain apps would be broken. I would be worried that apps I relied on would not function anymore. This has nothing to do with me using ADB, it has to do with apps using it (at least from how I read the article).

You use adb, you have a mental model for it. It does something because you make it do that thing and see it happen. You must be able to put yourself into the shoes of a person that isn't you and doesn't have that experience to recognize what I'm saying. Note: many developers not being able to or choosing not to do this is the source of most of the bad UX that is inflicted upon us today.

hmeh··on Amazon blocks long-running FireTV capability, Breaking apps with no warning
Thank you for the correction/reminder. But I might just start pronouncing it Ahdib so I don't have to acknowledge I made a mistake. Kidding. Thanks.
hmeh··on Utility classes aren't the same as inline styles (2021)
> The markup doesn't need meaningful class names because CSS is encapsulated in reusable HTML fragments that have meaningful names.

They have meaningful names... where? In React (or whatever). They don't in the web inspector (so just use the React dev tools! Yes, more complexity). They don't for testing tools like playwright, cypress, or capybara (so just use data-test-id! Yes, now you have to name something FOR TESTING PURPOSES ONLY, which is a clear sign of failure).

> Poorly defined "design" principles have a cost, and where they conflict with concrete principles with a proven track record, like "reusable abstractions", then the poorly defined principles are wrong.

I'm not sure that attempting to redefine design into something that you can ignore will do you much good, in the long run. If you think that "reusable abstractions" are a problem, then it's highly unlikely that there is a fraction of a square inch of common ground between us and any further conversation will just lead to frustration.

hmeh··on Utility classes aren't the same as inline styles (2021)
I've also made this argument, but I was wrong. It turns out it's also possible to model a UI. And, it's possible to do that relatively well with HTML. You can see web components or React for contemporary examples of doing this (though no guarantee that the example you look at will be doing it well).

It stands to reason that if it can't be done with HTML, then it can't be done with React, or Swift UI, or anything and we are all doomed. Of course, that's not true.

> Tailwind sure is ugly, but it’s quick to write and a cinch to debug. And in my experience, most UI code is pretty ugly. It seems to come with the territory?

UI code doesn't need to be ugly. It may come with the territory for most teams, but it doesn't need to be that way. We don't need to be working in giant monoliths that take an hour to deploy and run tests either, yet many teams are. We don't need to live in squalor, but when it's all we've known, we become accustomed to it. We give TED talks telling people how great it is to live in squalor and about the "one weird trick" that makes it a little more palatable.

The only "trick" we need is design. I'm not saying it's easy (in that it is readily available and applicable knowledge for the average developer), but it is attainable.

hmeh··on Utility classes aren't the same as inline styles (2021)
> CSS doesn’t scale across teams/dependencies in its vanilla form in my experience, not at all.

In your experience. It was my experience too, until it wasn't. See this: https://news.ycombinator.com/item?id=39501442

> often with no way to even control/revert what some deep dependency does

Without looking at specifics, it is hard to say, but it is very likely that this is a design mistake. It's very likely that the person making these mistakes is also making these mistakes in code and creating tangled messes there.

The state of development is quite poor. "Average" (read: most) developers create tangled messes because it's all they know how to do and they've never taken the time to learn how not to do it. So, when something like Tailwind comes along and says "you can't make a mess with this", then of course they will jump on it. They will not, however, be very interested in recognizing the costs that come along with it. They also will be incapable of seeing that the other path is not only simpler, but it can become easier with practice.

hmeh··on Utility classes aren't the same as inline styles (2021)
For what it's worth, I was exactly where you are 3 years ago. I made all of the same arguments. I saw the value in Tailwind. I had come from rebuilding a CSS system for another application multiple times because we never could get it to work for us.

I would have never believed me now either, not until I saw it done first hand and learned how to do it. So, call it uncommon knowledge, or a rare skill, or whatever you want, but do know that not only is it possible, but the skills required are the same skills that enable you to build maintainable applications -- not just CSS.

In large part, this is why we failed in the past. We would often treat CSS as a second-class citizen and put our most junior "front end" developers on it. It should have been no surprise that it ended up as a tangled mess.

> You don't have to switch files to add CSS and invent meaningful names for styles, then ensure you use the same name in the markup file, nor do you ever have to hunt down and change these names and the markup across multiple files to ensure they are applied consistently down the road of you're using HTML components.

This isn't a real problem. The only time we've struggled to come up with a name is when CSS forces us to use some mechanical name that includes the word "container" or something like that. Usually, we just name the thing what it is. Usually, very often this is in the domain of the UI (hint, it is likely the same name as your React component, if you are using React and naming things well).

There's another problem here that complicates things. Most people shouldn't be using React for their forms over data applications. It's unnecessarily complex, but people now tend to think that server rendered HTML is yet another lost art. React plays very well with Tailwind in a sense, because you are already forced to make components for your UI, so what's sprinkling a little class soup in that file? What's sprinkling a few type declarations in the same file? What's sprinkling a few hooks in that file? What it all adds up to, once you can see it, is very difficult to read and reason about code all in one place. You can learn to see through the forest, but I personally would rather work on one tree at a time.

By the way, I'm not advocating for writing HTML in multiple places (and therefore re-using the CSS classes), that often should be abstracted in some way. In Rails, we use helpers and view template partials. Every technology has its options. Technically, web components fit this bill as well, but we don't make heavy use of them as I've found them unnecessarily complex.

hmeh··on Utility classes aren't the same as inline styles (2021)
Instead of letting our tools lead us by the nose, what if we let design principles lead us? Why would a styling tool lead me to model my markup? That's the complete inverse of how one should be thinking about it. You model the markup first, you create reusable bits if you need them first. Then you style them. If the CSS forces your hand to change the markup, then you must, but that's becoming more and more rare with modern CSS.

I have no doubt that people that don't know the fundamentals at play have an easier time with Tailwind. That's how it goes with hacks. They're usually easier to apply than proper design and implementation. We're throwing in the towel with Tailwind, plain and simple.

hmeh··on Utility classes aren't the same as inline styles (2021)
Sure, Tailwind isn't inline styles. Fine. That doesn't make it good. And yes, most CSS is average or below average in implementation. Most software is too. That's just statistics. Tailwind is an attempt to prevent people from recognizing that, like software, CSS requires design and modeling.

It's perfectly possible to have a CSS system that is completely maintainable. It takes skill. That skill can be learned, but it cannot be learned if a person is tricked into relying on rapid-application-development tooling like Tailwind and not taking the time to understand the real problems with their CSS (which is very often special cause variation and/or not taking it seriously enough).

Tailwind doesn't solve anything, it just trades one bad thing (poorly written CSS) for another. I won't list the problems with Tailwind as that's been done plenty. I'm just pointing out the fundamental mistake here.

My experience: The first version of our app used React + Tailwind. When we started to ditch React and use server rendered HTML our React components and their embedded Tailwind were useless. When we wanted to share styles with our emails, they were useless. We had to start from scratch. We now have a plain CSS system (well, SASS) that is very well maintained, has only essential variation, and is used across 20+ web apps (that are all served on the same domain -- the user thinks they are one app).

hmeh··on Utility classes aren't the same as inline styles (2021)
Have you ever tried making your SCSS/CSS codebases not a huge monstrosity? It can be done.
hmeh··on Utility classes aren't the same as inline styles (2021)
It's not about DRY. It's about modeling. It's about design. It's about being able to look at markup (as a human) and tell what the heck it is. Tailwind soup obscures what things are. How many of your Tailwind-using apps ALSO have meaningful class names and IDs in your markup? How many of you rely on data-test-id or other such hacks to make up for the fact that you are not doing design.

Classes are used to categorize the markup. It's a document model. Model the document. Then, you apply styles to that. It's about design.

hmeh··on Amazon blocks long-running FireTV capability, Breaking apps with no warning
Of course it would be. Even in your example, I would know that KDE is a desktop environment, which, from KDE alone, I would not. ADB is a debug bridge (apparently), which means it's a debugging tool, which means it likely wouldn't be terribly relevant for most typical Android users (and if that's wrong, then the article makes an even bigger mistake).
hmeh··on Amazon blocks long-running FireTV capability, Breaking apps with no warning
I appreciate people taking the time to write articles like this, but please consider the people who are going to read it. ADB is an acronym. Not everyone knows what it means. If you're going to write an entire article about a feature being removed, please at least describe the feature in a way that people can understand without having to google it so that they can have an idea as to whether or not this is relevant to them.
hmeh··on SafeTest: A novel approach to front end testing
I'm afraid the answer to this doesn't actually lie in tooling. It lies in software design. If something needs to be controlled, it needs to be controllable. Typically this means push. In a React component, this means props. It could be an optional prop, but once that prop was there, this component could be controlled. Once the component could be controlled via push, the page rendering the component could also be controlled via push. How do you push to a page? Query string params is the most straightforward.

So, imagine a page that rendered a version of this component that a human could navigate to (this is what was historically called a test fixture before Rails rewrote the meaning of this word), then imagine that that human could have complete control over this interval by setting a query string argument. A human can do all of the interactive testing they need. Then, when it comes time to automate, all we need to do is automate what the human can already do.

This is another principle of automation that has been lost in history. We should first be able to do things manually before automating them. When we (as automaters) jump right to automation we often simultaneously necessitate and embrace (again, because we identify as automaters) additional complexity in the form of tooling.

I'd venture a guess that SafeTest is not likely to be necessary for the things that it was built for. Software design could have solved the problems with significantly less complexity and tooling while simultaneously providing useful test fixtures for humans to explore.

Storybook kind of enables, but it's also tooling fixation in my opinion. That's another post, however.

Oh, and I saw your other post about rewriting components to allow testability. You may be attempted to accuse me of suggesting that here. I'm not. I'm suggesting that components are written with fundamental design principles in mind, especially the necessity to exert control.

There's more to say about this that touches on the example of the sign in, and I can expand if interested.

hmeh··on Modeless Vim
Por que no los dos? I map caps lock to escape on tap, ctrl on hold.
hmeh··on Focus and Flow: trade-offs in programmer productivity (2021)
If I understand what you are saying correctly, you are saying that if two people are pairing and the one with the better idea does not successfully communicate their idea, either from lack of trying or lack of effectiveness, then the person with the lesser idea might "win" and that is what would be implemented?

If so, I would say that the appropriate response to that is to, as a team, work to improve communication and collaboration consistently -- every day, in every work item. Leadership should reinforce the import, exemplify it, and observe and coach.

In general, what it sounds like you are saying is that people who are bad at things do things poorly. Yes, that's true, but that's why we have all the tools we have available to us to help them do things better. We don't have to like in squalor, we can choose to help each other rise above it.

hmeh··on Focus and Flow: trade-offs in programmer productivity (2021)
Pair programming is, first and foremost, a technique for implementing continuous review. The old adage: If code reviews are good, do them constantly and continuously. We pair/mob when appropriate, and we don't do pull requests. If you pair AND do pull requests, it may be worth examining that.

The secondary order effects cannot be ignored either. On our team, pairing is used to:

- Coach more junior developers into being more proficient at their work

- Share knowledge so that norms, standards, and other knowledge can propagate through the team in a more natural (and effective) way than documentation

- Share techniques at the more tactical level

- Further explore the solution space and do better planning and execution (go slow to go fast)

And others.

hmeh··on Subject-First Commit Messages
sbellware's reply says just about everything of import, but from a tactical perspective, yes, we do push to master. Sometimes we push regular commits and sometimes (if we branched) we push merge commits. We have hundreds of repos and it's very rare for there to be conflicts of note. We do reviewing as we work via pairing (and on demand, live, when necessary).
← PreviousPage 2 of 5Next →