HN user

ts0000

63 karma
Posts3
Comments17
View on HN

For anyone not understanding why (neo)vim exists, or why some developers prefer it to IDEs, I suggest watching "PDE: A different take on editing code" [1]. It reframes (neo)vim as a "Personalized Development Environment".

I've been using (neo)vim for years, and don't want to use anything else. It isn't just about productivity (I would probably be as productive in an IDE). It's because its _mine_. It's a highly customized environment, catered to my needs.

[1] https://www.youtube.com/watch?v=QMVIJhC9Veg&

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.

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.

[dead] 6 years ago

I have been doing the Wim Hof method (cold showers, breathing exercise) for two weeks and it surprisingly effective in alleviating anxiety and depression. I also feel more awake.

For context, supposedly there have been done a couple of studies [1] that show benefits for strengthening the immune system.

[1] https://www.wimhofmethod.com/science

As someone strongly favoring a functional or even purely functional approach, I strongly dislike the flood of pro-functional-programming blog posts that attack the straw man of "imperative programming wrapped in classes". I don't want to believe that is what experts of the paradigm consider object-oriented programming. I would love to read an honest comparison of both, judging benefits and cost.