2019-10-15
859
#typescript#what's new
Paul Cowan
8357
Oct 15, 2019 ⋅ 3 min read

New in TypeScript 3.7

Paul Cowan Contract software developer.

Recent posts:

Comparing Mutative Vs Immer Vs Reducers For Data Handling In React

Comparing React state tools: Mutative vs. Immer vs. reducers

Mutative processes data with better performance than both Immer and native reducers. Let’s compare these data handling options in React.

Rashedul Alam
Apr 26, 2024 ⋅ 7 min read
Radix Ui Adoption Guide Overview Examples And Alternatives

Radix UI adoption guide: Overview, examples, and alternatives

Radix UI is quickly rising in popularity and has become an excellent go-to solution for building modern design systems and websites.

Nefe Emadamerho-Atori
Apr 25, 2024 ⋅ 11 min read
Understanding The Css Revert Layer Keyword, Part Of Css Cascade Layers

Understanding the CSS revert-layer keyword

In this article, we’ll explore CSS cascade layers — and, specifically, the revert-layer keyword — to help you refine your styling strategy.

Chimezie Innocent
Apr 24, 2024 ⋅ 6 min read
Exploring Nushell, A Rust Powered, Cross Platform Shell

Exploring Nushell, a Rust-powered, cross-platform shell

Nushell is a modern, performant, extensible shell built with Rust. Explore its pros, cons, and how to install and get started with it.

Oduah Chigozie
Apr 23, 2024 ⋅ 6 min read
View all posts

8 Replies to "New in TypeScript 3.7"

  1. So typescript is going to have pretty much every feature C# has. (what a coincidence, they’re designed by the same person)

  2. The optional chaining operator just tells me that I am going to show up at client sites where every single dot in the application is preceded by a question mark, the same way that async permeates through the code.

    It tells me that nobody is actually going to know anything about the data that runs through the system, and it’s going to hide bugs that are ridiculous to solve, because they could have happened at any `?.` upstream from where your data was supposed to be.
    Moreover, this affects all downstream systems, as well.

    I’m not saying that 10,000 null checks is good, either. What I am saying is that we are programming backwards. What I am saying is that we should have systems that are hermetically sealed, and operate only on types that are known, not types where every member is optional/nullable. If you can’t build an instance of a type with the pieces you have been given (plus any reasonable defaults), then you should take a different path in code, rather than passing in a tree that is garnished with nulls.

    The invention/inclusion of null in programming languages was Tony Hoare’s billion dollar mistake, and instead of thinking about how we can program without it, we are making it easier to make everything null, at all times, without crashing.

    However, the null coalescing operator is a good tool for building those known and trusted data types from untrusted data sources (server responses, database fields, localStorage, user input), *if* the field you are settling has a valid default/empty/identity state. Optional chaining would be fine to use in the case where you were grabbing an expected value from an unknown data source, and using the coalescing operator to set the default, when building a closed system of well-defined types… but we all know that isn’t how it’s going to be used.

  3. Personally I think the worst thing about their announcement blog post is the dubious formatting of ternary operators. I mean, everybody knows that you’re supposed to format them
    “`
    var result = condition
    ? first_expression()
    : second_expression()
    “`

Leave a Reply