Unofficial Hacker News companion — get notified on comment replies, and more.

Civet: TypeScript superset that favors more types and less typing (opens external site)

70 points by nateb2022 4 days ago | github.com | 48 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (3)

  1. Whitespace-sensitivity has not been adopted by another new mainstream programming language, and I’d ask you to consider why that is. It is not simply a matter of personal preference.

    Pipes are a great addition. Matching as well, except for the whitespace issue.

    Some of these things seem more for code golfing; particularly `&` and the way method m-chaining can work without an explicit reference to the object.

    When introducing syntactical sugar or metaprogramming, I’d ask myself, “it’s 2am and I’ve been paged. The issue lives across 10 20-line methods/functions in this language. How quickly and confidently can I identify it?”

    Anything too clever is fun when you’re writing on a lovely spring morning and hell when you’re reading under pressure during an incident. I’d optimize for the latter.

    Replies (2)
    1. Fortunately there are different languages that optimize for different things. I put the things that I like in this language.

      You can still add braces in Civet, they're just optional but proper indentation is enforced (best of both worlds?)

    2. I always say: code must be written to be read.

      I used coffeescript for a while and when I had to debug something in my own code I realized how stupid it was and gave up using it. I also thought a programming language that was close to natural language was a good idea until I tried Ruby.