Hacker Newsnew | past | comments | ask | show | jobs | submit | ts0000's commentslogin

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&



I'm surprised there isn't an AWS module already, they have a bunch of providers. Wonder if there is a reason for that or if someone just needs to put the work in, I see a feature request for it. I may dig into it.


No, as I recall, the wtf widget only shows information about recent builds/pipeline runs. It can't show an ADO dashboard (which includes other info about tickets/releases/etc).


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.


I’ve just re-setup at wtfutil for my new job, and am also curious about this question. DevDash just seems the same but with less widgets afaict?


Comment section.


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.


I don't know; I wouldn't presume to tell you what you do or don't find arcane, but once I understood the somewhat unusual flow of awk ("for every line, check if the line matches this condition, and if it does run this block of code") I found it's quite easy to work with. It's "arcane" in the sense that it has an implicit loop and that it's a specialized language for a very limited class of problems, but I found that for this limited class of problem it's surprisingly effective.


  > an implicit loop
As an occasional awk user, I'd love if you expand on this. Maybe it will help clear things up for me. You're not referring to the fact that awk operates on every line independently, are you?


My mental image of awk has always been something along these lines:

    for line in readfile()
        for block in script:
            if block.match(line)
                run_block(block)
            end
        endfor
    endfor
Where the "for line in readfile()" is the "implicit loop", and the blocks are the "condition { .. }" blocks.

The actual flow is a little bit more complex and has some exceptions e.g. (BEGIN/END), but this is about the gist of it.


Thanks. Yes, I agree that my mental image is pretty much the same but it's nice to see it expressed in Python modulo end keywords ))


To expand on the other reply, there are a couple more implicit loops. There's a loop over all of the command line arguments/files, then a loop for every line in each of those files, then there is kind of a loop over the whitespace delimited fields of each of those lines. The main thing that helped me understand AWK was that every block in a script is just a pattern/action pair. When I saw snippets like

  ... | awk '{print $2}' 
I thought there was all this confusing syntax, but something like

  awk '/pattern/ {print}'
was more clear to me. In the first case, the empty pattern matches every line of the input, and the action is simply to print the second field of each line. Patterns can vary in complexity from the empty pattern to long chains of logical operators and regular expressions, such as /pattern/ in the second example. The outer quotes are just to prevent the shell from eating your dollar signs or other special characters. In a standalone AWK script you can write it like

  /pattern/ {
    print
  }
which also makes it look more like another language.

If you can get your hands on a copy of The AWK Programming Language, it's a pretty quick and pleasant read that helped everything make more sense to me. I do most of my data analysis for my research using AWK and really enjoy working with it.


  > The AWK Programming Language
I see it's public domain and discussed here on HN: https://news.ycombinator.com/item?id=13451454

I'll go over it, thank you very much for the suggestion.


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.


Concept art for games, movies, perhaps.


A violin is the pure opposite of user-friendly design, and yet, there are millions of people playing it.


Yes, but only a violin can make the violin sound.


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.


This feels like a pattern where the naming choices obscure the intent. The ‘Shape’ type doesn’t capture the essence of a ‘shape’ - it captures the essence of being ‘visitable by a visitor that knows about shapes’ or ‘able to handle shapes’. The things which are instances of Shape are functions that accept circles or rectangles, not actual circles or rectangles. So maybe call it ‘VisitableShape’, or ‘ShapeHandler’; and instead of calling its functions ‘circle’ and ‘rectangle’, call them ‘visitCircle’ or ‘handleCircle’...

Also, you seem to have created functions and types with the same names (Circle and Rectangle) which seems dangerous.


> The things which are instances of Shape are functions that accept circles or rectangles, not actual circles or rectangles.

The naming is confusing, but it's misled you in the opposite direction. Things that are instances of Shape are functions that accept handlers of circles or rectangles. The handlers, unfortunately, are named `circle` and `rectangle`. I would prefer `onCircle` and `onRectangle` in this context, because we're lacking the context of a true `match` expression to disambiguate the naming.

    type Shape = <T>(handlers: {
      onCircle: (args: Circle) => T;
      onRectangle: (args: Rectangle) => T;
    }) => T;
> Also, you seem to have created functions and types with the same names (Circle and Rectangle) which seems dangerous.

I think this is an idiom for defining a canonical constructor for a type. It's a little funky here because they're returning Shape, not Circle or Rectangle, and the latter are not subtypes of Shape. But it mostly tracks alongside the rest of the encoding.


Nah, the Circle function takes an instance of Circle and returns a Shape. It’s not a constructor of circles.

The ‘exampleCircle’ is not an instance of Circle, it’s an instance of Shape.

I like the ‘onCircle’ naming though.


You're speaking at the level of the code, while I'm speaking at the level of the domain. Neither of us are wrong, but we're talking past each other.

The Shape class itself is formally the sum of Circle and Rectangle -- you can think of this as a "prefer composition over inheritance" principle, but it's still a way of relating Circle to Shape. In particular, the Circle and Rectangle factories are canonical injections of these two classes into the Shape class. The naming of the factories is a little suspect, but if the only use of Circle and Rectangle is meant to be in the context of Shape, it mostly flies.

> Nah

This came across as excessively dismissive.


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.


Why not link to the actual reddit thread directly? https://old.reddit.com/r/LambdaSchool/comments/kb87od/lambda...


Because it gets deleted (silenced & censored): https://www.reddit.com/r/LambdaSchool/comments/k7bmj6/it_wou...


Most probably because reddit mods can take the post down.


In case it gets deleted


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: