Wednesday, June 11, 2025

the internet's one weird trick

 One could criticize no-code for not offering the flexibility and nuance you can get by writing your own code, line by line. But the truth is, for all the hoopla about Silicon Valley's innovative genius, a huge number of apps don't do much more than awfully simple things. Seriously: Silicon Valley's main trick is just shoving things into a database and pulling them out again. I'm exaggerating, but only a bit.

 
I think of this quote so often, but was bad at googling about it.

But as frontend gets more and more complicated it seems more and more silly. Still the same stuff but in much harder ways.

Sunday, June 8, 2025

false simplicity

I probably spend too much time thinking about my "unpopular opinions" in coding, looking for like-minded souls who might agree with me that the industry has emphasized some of the wrong thing over the past decade or two, and trying to come up with arguments to persuade smart coders who disagree with me that even where I don't share their intuitions, I understand both sides enough not to be too much of a pain in the butt curmudgeon about it.

Really I might be better off shutting up, getting to work, and pretending that TypeScript is obviously The Right Thing, and OF COURSE testing every line of code as a unit, in a reductionist context free way, carries its weight. I'm well into the back 9 of my career, my best hope is to fend off AI bots (or rather learn to leverage them but hope they don't suddenly become good at big picture, senior level coding rather than extremely helpful junior level bots that are also good at remembering documentation) long enough to stumble into retirement without TOO much a salary collapse. Maybe I should save my unpopular views, no matter how thoroughly rationalized, for my side projects where no one will care if I'm just a overgrown-script-kiddy lone-gun-cowboy/caveman.  

 So, that disclaimer aside (though there's always disclaimer...)

The number one thing the web UI industry has lost is appreciating simplicity and transparency for its own sake. For a lot of challenges they faced, the answer was get a shiny new toolkit, add in a layer, learn a new specialized syntax. (A reverse of "NIH", not invented here - the impulse is "lets find a toolkit to do this for us rather than trusting our own code") There is sometimes a false simplicity in these tools, a veneer of "use our complex engine humming under this glossy metal hood" - but god help you if the engine goes wrong (or you lazily didn't read QUITE enough of the docs to use it right) and you now have to figure out why its way of solving your problem PLUS a hundred other company's problems isn't going sour and no longer solving your problem.

(At the risk of frustrating one coworker who I might be brave enough to show this to - Tailwind for CSS is one example of a false simplicity for me. I mean, at one level it starts off obviously more complex, needing a build system vs the old day of "use any editor, save, reload in browser" ... and then requiring learning a new set of (admittedly crisper) tokens for CSS properties I already have to be fluent in. But I want to keep talking with this coworker and try to "get" the appeal of it more, I think he sees something in it I should lean into more.)

But I trust enough of my fellow devs will at least acknowledge the idea of simplicity and transparency enough that they'll understand some gripes I got stuck in my head last night.

Lately I've run into some lint rules or code smell guidelines that seem to deprecate comments - I guess the idea is code should be self-documenting so most explanatory comments are a sign things are awry. And then I get hit by lint rules forbidding commented-out code. I mean yeah, I guess grepping through files could be confusing if a TON of your code was comments, but often commented out code is just helpful signposts of where you've been - and where you might want to go again! Comments are right there at hand in proximity to the code in a way commit messages and PR comments aren't, and while you should always debug the code not the comments, I don't quite see why people don't trust comments more.

Another anti-simplicity aspect is over-zealous unit testing. Most unit tests either fall into: you're writing the same functionality twice (i.e. testing for something simple that's like, just right there in the code), or you're testing your mocks more than you're testing you're code. Or you're describing your contract with the outside world but more likely than not describing your implementation, not your higher level result.

And like yeah, TypeScript. TypeScript is an awkward at best syntax, and I think makes it harder to get the gist of code, even as it does better at empowering autocompletion in editor. And I feel like lately I've really been suffering through "oh you said this can be a string or undefined, NOT string or null". I'm not going to live long enough to what to ponder the "correct nature of nothingness" that deeply... but anyway. TypeScript feels less agile. You can't just change some code (and some of the code calling it) you have to change at least one other place to describe it. Like to be there's just this weird seeming contradiction with people who on the one hand seem to hate comments, and want the code to speak for itself, but also don't want the code to speak for itself, they want to make sure everything is in a formalized type. 

Anyway. Just my ranting for today. I don't know how much I want to publicize this article, lest I be seen as a old fart pain in the ass about where modern software has gone. But I try to reach out to my fellow "hey things have gotten out of hand. we're not solving that many harder problems than we were 20 years ago, we just have more complex ways of doing so"...

Wednesday, May 28, 2025

feeling loopy

Today at work I was solving two infinite loops, both based on having to finesse dependency arrays in useEvent() or useMemo() type things in React.

Hopefully this is less of an unpopular opinion than it was a while back (I think the industry as a whole is more aware of React's limitations) but React's flavor of declarative programming is so damn "jumpy" compared to, say, the jQuery stuff that preceded it. jQuery coding could suck if you weren't sure what was modifying the DOM, but in general the DOM was stable and the methods to change it (often after doing server side rendering, another technology people had to reinvent for some reason) were more or less transparent.

(And hell... when you have React controlling an <input> tag by using state? So that every thing the user types in changes the state, and then React sets the value tag? The ONLY reason the cursor doesn't jump to a default position is because of React's optimizations to recognize it doesn't actually need to rerender that text box. It seems crazy to me that a fundamental UX experience of being able to type anywhere in an input field is dependent on an optimization like that, since cursor position is some kind of hand-wave-y implied state.)

But now with React... like we used to have MVC, Model-View-Controller as a no frills way of doing UI. But React has always mashed together the Controller into the View. And when it's hard to realize you're modifying the Model, aka the state, or accidentally looking at the wrong state to trigger more actions, man, that's just a recipe for infinite loops and rendering that never ends.

Maybe some year the industry will recognize the power of simplicity. Or not, and we'll just hope the AI bots are doing a good job of thinking through the edge cases.

Tuesday, May 27, 2025

unix quotes

 I like this page of Unix quotes especially 

Contrary to popular belief, Unix is user friendly. It just happens to be very selective about who it decides to make friends with.   -- unknown

 and

UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity.   -- Dennis Ritchie

but most importantly 

UNIX was not designed to stop its users from doing stupid things, as that would also stop them from doing clever things.   -- unknown (generally attributed to a Doug Gwyn, but no information found about him) 

 


Tuesday, May 20, 2025

thoughts on AI and autocomplete

Heh. Over the weekend I was thinking about that "TypeScript Origins: The Documentary" documentary a coworker linked.

I've only watched the first part one of the big points was the the in-editor/developer experience - especially stuff like autocomplete etc being much more robust when you have everything typed, and some of the devs complained about wasting half day chunks so much time with typos etc. (Which to me seems a little exaggerated maybe? Like if I have my tight iterative code-run loop going, if I don't immediately notice that I typo'd a field, something is probably really wrong.)

 

But it does make me think about the experience of code editors in general. One thing that shocks me is how popular autocomplete of quotes, braces, parens, and tags has become - like it seems weird to me that that's the default, and people are ok with it - for me the extremely minor convenience of saving a keystroke is vastly outweighed by the unpredictability of it all... I type code like syntax in a number of environments, and some complete and some don't, and while I'm barely a touch typist I really do like the idea that "what you type is what you get".

 

And now with AI being thrown into VS Code, my wide ranging ambivalence grows. Like sometimes it's hella helpful and the ChatGPT hints are just the right thing. But man... visually it's a mess. Sometimes it's literally difficult to see, is this code that's there, or is this code proposed by AI. (And a few times the AI - with its "this sounds very likely!" mentality - is actually fighting with the "old school autocomplete" that TypeScript was designed to support... I remember one humble refactor of some relative imports that was made maddeningly difficult as the AI tried to override what the older version of the editor could have done automagically) It's like you're constantly dealing with a pile of AI hallucinations...

 

This is why sometimes I still like sandboxing AI, but then I'm worried I might be a little left behind, that these systems with more collaboration and proactive file manipulation by LLM might be the neartime future

Thursday, May 15, 2025

the not-so-hidden costs of "simplicity and elegance"

 (This one for my fellow UI tech heads. Especially folks who cut their teeth on earlier eras of tech.)

Video: React is imploding, and that's a good thing...

My favorite comment comes early:

"But with the latest advancements, I was feeling like maybe I’m too old, too busy or maybe just too dumb to use this new modern flavor of React. And, by the looks of it, this feeling was shared by many other developers."

It goes on to explore how weird it is that Dan Abramov uses a different framework, Astro, to explain how React Server Components are doing their division of server vs client activity (as the video says "Dan is a core team member of the React team, and he spends most of his time explaining and shaping the mental models around React. Having a designated person in charge of  “explaining the mental models” behind a UI library that paints buttons on the screen should already be a red flag")

Besides the horrendous push to vendor lock-in, RSC's agenda seem bizarre - to paraphrase Ben Franklin it pays too much for the whistle of potentially having the same code bits reused back end and front (especially since because the serverside stuff can't use hooks? like what non-trivial component of the past 5 years would have avoided using a hook for managing its state?) Muddling the two codebase sides seems weird. (Hell, I feel like my ancient preferred evergreen/buildless stack of PHP plus Vanilla JS shares Astro's concise division, and that both offer a cleaner, more honest approach than Vercel's stepchild)

All this is part of a wider industry trend towards ignoring complexity as a significant developer cost multiplier. Often we are sold paradigms that sound simpler in the abstract but then the implementation ends up with huge complexity costs. Module Federation seems like a great way to break up a monolith and let separate teams cook, but WOW is its mix of "every client piece has its own server" rough to untangle when things go wrong. TypeScript - yes, there are many benefits of not having a morass of unclear JSON-y jumbles, but man the syntax is HARSH to read. (Maybe I'm biased but I think Java/C's way of showing primitive types was a world better - "int foo" vs foo:int where the meaning of any ":" character is utterly context dependent...)

(Those are two hot takes and potentially unpopular opinions so don't assume I CAN'T use these when called upon, I just think they have questionable cost/benefit ratios)

Sometimes it feels like a huge pile of "lets ensure job security" but if you've been in the industry for decades, it can really take its toll. UI is still addressing the fundamental problem of "how do we get information on and off some centralized computer" that we were 20 years ago, but the techniques now tend to be wolves in sheep's clothing of complexified 'simplicity', not to mention how we've eaten so much "flavor of the month" we're all feeling a bit sick.