Recent submissions

Comment · 1 year ago
That abstraction is another layer though. And additional layers are additional complexity. So, if you add another layer, the software is less simple than before. You might need to have caching in your software. I don't doubt that. But there's simply no way it makes the software more simple except if you assume some unfortunate starting point where you could get rid of any high-complex performance optimizations in your existing code by replacing them with a more simple cache solution. But then the statement should be "refactoring makes your code simpler".
Comment · 1 year ago
"I think now caching is probably best understood as a tool for making software simpler" - that's cute. Caching might be beneficial for many cases, but if it doesn't do one thing then this is simplifying software. There's that famous quote "There are only two hard things in Computer Science: cache invalidation and naming things.", and, sure, it's a bit ironical, but there's some truth in there.
Comment · 2 years ago
Not far. Just show all changes. Like the blog article already states, for many projects you already have code formatters, so changes in format usually don’t happen a lot - and if they do there might be a reason you don’t want to hide (like… you change your rules of code formatting). For all the other example I neither see the point why you would want to hide it. If you don’t want to see commas added in a list, make it a rule that the comma always has to be appended after the last element. Most languages allow that. Semantic equivalence? The JS example isn’t even equivalent because „this“ may have a different context. I’d prefer to have a „dumb“ diff that simply shows all the changes instead of adding these kind of complexities. Just keep your MRs small and there’s no real issue.
Comment · 2 years ago
This is default on Mac if you use the Trackpad. Just to be sure I just tested with "man ls", which is also used in the example video. If I use my keyboard, I prefer to not have smooth scrolling.
Comment · 2 years ago
You're right. But this only means that it won't be possible that you use the same template for different slots. Personally, I don't remember I ever needed that. Actually, most template engines I know work this way (https://twig.symfony.com/doc/2.x/templates.html#template-inh..., "{% block content %}"). But still, it's easy to archieve that by just creating another sub template. So your first template file is the layout, the second one contains the main block definition, and that definition you just include another sub template which can be reused elsewhere.
Comment · 2 years ago
Comment · 2 years ago
The same is still possible in PHP to include HTML code into you PHP files. But it's rarely still being done like this. It's considered good practise to separate your PHP (business) and HTML (view) logic.
Comment · 2 years ago
Both is possible. See here an example how to implement use case 2: https://github.com/ckilb/golang-layout-tpl-example

I don't like Go's template engine too much, I find it a bit cumbersome in many cases. But it's quite capable.

Comment · 2 years ago
Please, please don't mix up ORMs with ActiveRecords. ActiveRecords are one way to implement an ORM, but it's not the only way. I think many say they hate ORMs when they actually mean ActiveRecords. For bigger projects ActiveRecords suck, yes. But also you need to have some database layer logic which most likely does some Object & Relation Mapping (ORM).
Comment · 3 years ago
Comment · 3 years ago
Use human readable dates:

Every blog post should include a human readable date. In fact, this extends to almost anything online and even offline. Timestamps are hard to read.

Use date and time:

Every blog post should include the time it has been created. In fact, this extends to almost anything online and even offline. I was reading Jan Kremers post about blog timestamps and it was not immediately clear to me what time the post was created. Only when I did a look into the HTML source I discovered the time there.

Comment · 3 years ago
Syntax highlighting? Aaaaaand... it's gone!
Comment · 3 years ago
Sooo deeeep. Woooow!
Comment · 3 years ago
There are so many unknowns and unknown unknowns in medical sciense, especially regarding the human body. Did evolution really keep two kidneys if you actually just need one? I doubt it. When considering a donation you should also not only think about if you might die. There are more factors like quality of life. In the end, a whole organ will be removed from your body. This will have some effect.
Comment · 3 years ago
Is there still demand? Is it better paid? There's a German website where you can compare average hourly rates for different programming languages and according to this COBOL developers get lower than average. This might not be significant, but does someone know how the situation is globally/in the US?

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton