707 karma · joined December 17, 2013
That is, extracting the caching logic from the API call logic.
Caching could have been a more generic function that wraps the API call function. That way each function does exactly one thing, and the caching bit can get reused somewhere else.
Instead, this weird advice was given: changing behavior is bad refactoring. Which is weird because that's not even what we call refactoring.
Edit: removed unnecessary negativity.
If something changed, it's not a refactor. It's a change.
Like in the example where the caching was removed: NOT a refactor.
Ore where the timeouts for the requests were changed: NOT a refactor.
The definition of refactor: change the structure of the code without altering the behavior.
It's like saying a crash is a bad landing.
No, that's not how it works. The function is evaluated once before the call and passed as an argument, then internally reused.
Also, you're microptimizing. Prioritizing supposed performance over readability.
And yes, for-loops and mutable structures are more error prone than map-filter-reduce. The original is OK but could be better.
I wanted to add my two pennies to the discussion. You are of correct that with that approach you lose the declarativeness but sometimes you don't need that, if the thing is mostly static.
I went this road many years ago for a project. The nice thing of this approach is getting rid of all the ugly DOM API but enjoying it's performance over innerHTML.
(1) I absolutely love lit-html but don't like the rest of the lit components framework. Luckily you can use it independently!
But this is "whataboutism" and not addressing the point of my comment.
The actual point of my comment is: the narratives of good guys / bad guys are silly propaganda.
Geopolitics were never about morals, unluckily for us.
Edit: for the record, by no means I like the Russian regime "better" than the west. Yes, Putin bad.
They were conceived to float text (or other elements) around static elements. Think text floating around a picture, like this:
https://tco-forum-uploads.s3.amazonaws.com/original/3X/0/3/0...
But then again, why does the US risk going to war with China over Taiwan?
You think it's because democracy, liberty and or human rights?
It is very obviously strong geopolitical interest.
This narrative that the US are the good guys and they are the police of the world is the propaganda of the empire. It's coolaid.
I don't think the Chinese or whatever other empire comes will be better.
But this Pax Americana is just lies. Go tell Vietnam, Chile, East Timor, Afghanistan, Iraq, and so on about it.
Honestly, I don't think so. And even if they did, they can't do anything about it. Complaining will only give them a bad social score which will make their lives difficult. I think this is geopolitically irrelevant.
> China dominating the Tech industry vs the US makes no difference to a majority of the people in the world.
Economy, technology, industrial capacity and military power absolutely go hand in hand.
If you can't get chips because the production is controlled by China. You can't build missiles, fighter jets, drones or really anything. Not even modern helmets.
If China gets Taiwan, the US are geopolitically toast. That's why the US will not tolerate it and will even go to war if necessary.
I'm no military expert, but wasn't it exactly the opposite?
The attacking army needs to be bigger than the defending army and will suffer way more casualties,even if they are successful.
That rings a bell, where did I hear such a thing? Oh yes, "workers should own the means of production" – I don't know if the author realizes this, but he's making a good case for Marx.
I think the less layers of management in the company, the better. The flatter the hierarchy, the more freedom the developers have, more stuff they get done, the happier they are. But for that you need trust and good developers.
Another technology that kind of covers the use cases of the article (the mildly dynamic pages) would be htmx and friends.
It's the other way around: after every optimization we have more "budget" to spend. More code, more bloat that we can get away with.
But: you can also build regular Clojure programs using GraalVM and create a fast-starting binary.
That allows for some nifty tricks like:
(reduce + [1 2 3]) ; returns 6
When I read translated texts (or watch dubbed films) I always catch false friends or awkward translations, and I "see" the original through the translation like it was a leaky abstraction. It's so tricky even the pros make a lot of mistakes.
All HTMX is doing is fetching HTML snippets from the backend and patching them onto the DOM.
So no, that doesn't change depending on where you are.
It absolutely is, and if you do include them you have to show a consent popup in the EU.
Tmux is more programmable. You can write scripts to automate stuff, for example setting up a layout, etc. with a degree of freedom that is not possible with Konsole.
You are probably fine with your setup, not trying to convince you ;-)
Personally: I just like fancy TUIs. One of the first things I programmed was mIRC scripts, might be because of that.