HNHacker News
TopNewBestAskShowJobs

kolme

707 karma · joined December 17, 2013

submissionscomments
kolme··on Code review antipatterns
Possible solution: mandatory pre-commit or pre-push hook that lints the code.
kolme··on Good refactoring vs. bad refactoring
There was a great refactoring chance in the example where the cache was removed.

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.

kolme··on Good refactoring vs. bad refactoring
A refactor does not change behavior, period. By definition.

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.

kolme··on Good refactoring vs. bad refactoring
> every cycle creates an anonymous function

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.

kolme··on Ask HN: Pragmatic way to avoid supply chain attacks as a developer
That's great advice, thanks! What are you using to scan the packages/images if I may ask?
kolme··on VanillaJSX.com
Nice, I love lit-html(1)!

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!

kolme··on Former Google CEO Eric Schmidt's Leaked Stanford Talk
Well, I don't know. If we look at the body counts, I think being in the receiving end of getting democratized by the USA is actually worse.

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.

kolme··on CSS Grid Areas
Floats are not weird. They were just utterly misused, using them for layout is an ugly hack.

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...

kolme··on Former Google CEO Eric Schmidt's Leaked Stanford Talk
I wish you were right about this.

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.

kolme··on Former Google CEO Eric Schmidt's Leaked Stanford Talk
Pax Americana is a farce. There was always war going on and America was always involved, and for their own imperial interests.

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.

kolme··on Former Google CEO Eric Schmidt's Leaked Stanford Talk
> Don't you think that people in China just want to live just like people in the US?

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.

kolme··on Former Google CEO Eric Schmidt's Leaked Stanford Talk
> And one of the things to know about war is that the offense always has the advantage

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.

kolme··on Scrum is the Symptom, not the Problem
> So what is the real solution? Engineers need meaningful ownership. If engineers could acquire enough ownership to represent a significant percentage of the company, they could demand to be part of decision making.

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.

kolme··on Transcribro: On-device Accurate Speech-to-text
This looks great! I've been wanting to drop the Swipe keyboard ever since I saw sneaky ads on it (like me typing "Google Maps" and getting "Bing Maps" as a "suggestion").
kolme··on Multiple airlines disrupted due to Microsoft Azure outage
Oh, you know them as well.
kolme··on The demise of the mildly dynamic website (2022)
Fun fact: nextjs was inspired by PHP and can generate static pages that you can throw into a web server.

Another technology that kind of covers the use cases of the article (the mildly dynamic pages) would be htmx and friends.

kolme··on Scan HTML faster with SIMD instructions – Chrome edition
Hey. Webdev here ;-)

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.

kolme··on Lisp: Icing or Cake?
That's rad! What libraries are you using?
kolme··on Try Clojure
Source code:

+: https://github.com/clojure/clojure/blob/clojure-1.11.1/src/c...

*: https://github.com/clojure/clojure/blob/clojure-1.11.1/src/c...

Docs:

+: https://clojuredocs.org/clojure.core/%2B

*: https://clojuredocs.org/clojure.core/*

kolme··on Try Clojure
Babashka scripts are interpreted, the babashka binary itself is compiled with GraalVM.

But: you can also build regular Clojure programs using GraalVM and create a fast-starting binary.

kolme··on Try Clojure
+ is a function, there are no operators in Clojure.

That allows for some nifty tricks like:

(reduce + [1 2 3]) ; returns 6

kolme··on What makes a translation great?
I'm quite proficient in German and English, but still translating is astonishing hard, even into my mother tongue Spanish. The translation always sounds weird. I'm always in awe at great translations.

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.

kolme··on Htmx and the Rule of Least Power
Not really, all the rendering is done in the server.

All HTMX is doing is fetching HTML snippets from the backend and patching them onto the DOM.

kolme··on Aider: AI pair programming in your terminal
And might be wrong.
kolme··on Why is the LinkedIn app almost half a gig?
Localisation means in this context the translations, date and number formatting, currency, etc.

So no, that doesn't change depending on where you are.

kolme··on Show HN: magick.css – Minimalist CSS for Wizards
> It seems like a privacy/tracking issue, or am I offbase?

It absolutely is, and if you do include them you have to show a consent popup in the EU.

kolme··on Goodbye GUI … Hello NUI (1997)
I guess they mean UIs built using XUL, which is a XML-based declarative user interface markup language. Kind of an HTML variant for desktop UIs.

https://en.m.wikipedia.org/wiki/XUL

kolme··on Serving my blog posts as Linux manual pages
There's also star wars over telnet:

https://itsfoss.com/star-wars-linux/

kolme··on Zellij: A terminal workspace with batteries included
Tmux is more keyboard oriented, I guess. For example: I can copy and paste from one pane to another without touching the mouse, which is something I think is not possible with Konsole. (I haven't used Konsole or KDE for many years, so that might've changed).

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.

kolme··on Sapling: Experimental vi-inspired editor where you edit code, not text
Other commenter mentioned Hy, but what about Clojure? It is a lisp on top of Java, and all of its variants (Clojurescript -> Javascript, etc). Then there's Fennel (Lua) and others I can't remember right now.
← PreviousPage 2 of 8Next →