Recent submissions

Comment · 3 years ago
Comment · 4 years ago
Comment · 4 years ago
How does this compare to https://github.com/wtfutil/wtf/?

/edit: I wish these kind of projects would add a compatibility layer to pre-existing modules of competing libraries. That would jump-start adoption, instead of having to re-invent every single module again.

Comment · 4 years ago
Comment section.
Comment · 4 years ago
Interesting, for me it's the exact opposite.

I've tried a couple of times to get into awk, but still find the syntax arcane.

Comment · 5 years ago
One alternative to estimations are projections via (for example) Monte Carlo simulations. I've been happily using https://getnave.com/ for that. The results seem to be in the same ball-park as my old estimations, but with less stress overall.
Comment · 5 years ago
Concept art for games, movies, perhaps.
Comment · 5 years ago
A violin is the pure opposite of user-friendly design, and yet, there are millions of people playing it.
Comment · 5 years ago
Agree, I intentionally didn't change the names to mirror the other examples in sibling comments as I meant to focus on the "named parameters" bit.
Comment · 5 years ago
In addition to the other TypeScript examples, here's one that I would actually use. Now, it's not encoding the types not as positional, but named arguments via objects. Allows me to destructure them, for added clarity.

  type Circle = {x: number; y: number; r: number};
  type Rectangle = {x: number; y: number; w: number; h: number};
  
  type Shape = <T>(xs: {
      circle: (args: Circle) => T;
      rectangle: (args: Rectangle) => T;
  }) => T;
  
  function Circle(x: Circle): Shape {
      return ({circle}) => circle(x);
  }
  
  function Rectangle(x: Rectangle): Shape {
      return ({rectangle}) => rectangle(x);
  }
  
  const exampleCircle = Circle({x: 2, y: 1.4, r: 4.5});
  const exampleRectangle = Rectangle({x: 1.3, y: 3.1, w: 10.3, h: 7.7});
  
  const area = (shape: Shape): number =>
      shape({
          circle: ({r}: Circle) => Math.PI * r * r,
          rectangle: ({w, h}: Rectangle) => w * h,
      });
  
  console.log(area(exampleCircle));
  console.log(area(exampleRectangle));
/edit: Fixed formatting. /edit: Clarify something.
Comment · 5 years ago
Comment · 6 years ago
While I agree with the notion of treating microservices with caution, I found the article a bit too shallow, barely supporting the claim. Especially the second "fallacy" reads like a draft and it overall ends abruptly.
Comment · 6 years ago
Comment · 6 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton