Live data from Hacker News

Learn how to unleash the full potential of the type system of TypeScript

type-level-typescript.com

241–250 of 256 posts

Re: Learn how to unleash the full potential of the type system of TypeScript

#241
post #225

Earlier quoted context omitted.

Twitter seems like a good way to miss it. I don't check Twitter every day...

I don't have (or want) a Twitter account, which kind of rules me out.

I was agreeing with you, and adding that even if you have a Twitter account, you would still be likely to miss an update to the tutorial among the author's other Twitter posts.

It seems that the author added a way to get notified by email, which might work for you: https://type-level-typescript.com/03-objects-and-records

Personally I set a crontab to alert me if the next chapter page's size increases above 50kB.

Re: Learn how to unleash the full potential of the type system of TypeScript

#242

Earlier quoted context omitted.

I’ll admit that my understanding of these things is rather superficial. I might understand more than the average person but that’s not exactly a high bar to set. However I always understood potential to be different to polarity. And that AC (which, to my knowledge, all electric grids globally carry) is the literal oscillation of polarity. What am I missing/misunderstanding from the GPs post?

English isn’t my native language, so I mixed up those two terms. But that’s what I meant, the UK and US plugs (as well as switzerland I think?) theoretically have one pin always be hot, one always be neutral. With Schuko, you can reverse the plug, and it'll still work, which is on the one hand awesome when you've got a tight space and want more plugs to fit, but can also require higher costs, as you've always got to…

Ahh I see. Thanks for the clarification

Re: Learn how to unleash the full potential of the type system of TypeScript

#243

Earlier quoted context omitted.

English isn’t my native language, so I mixed up those two terms. But that’s what I meant, the UK and US plugs (as well as switzerland I think?) theoretically have one pin always be hot, one always be neutral. With Schuko, you can reverse the plug, and it'll still work, which is on the one hand awesome when you've got a tight space and want more plugs to fit, but can also require higher costs, as you've always got to…

Ahh I see. Thanks for the clarification

The transformer on the pole delivers 240V rms center tapped, with the center tap being connected to ground at the pole. The center tap wire is actually uninsulated, and the two hots are wrapped around it for support. The center tap is connected to the neutral bus at the breaker panel.

Half the breakers are connected to one hot, and half are connected to the other hot. For 120V you wire hot/neutral to the receptacle, while for 240V you wire hot/hot. (Plus ground, of course.)

In the EU, receptacles are wired hot/hot, and there is no neutral conductor.

Re: Learn how to unleash the full potential of the type system of TypeScript

#244
post #93

Earlier quoted context omitted.

True that. Once types get so complex, I’ve no idea what’s going wrong. Today I had code running fine but throwing errors all over the place because some deeply nested type mismatch between two libraries. I just any’d it… i aint got no time for that shit

But would the code really work without the type checking?

Yes. I had a huge testing suite on the project and all tests were green even though there were tons of type errors.

Re: Learn how to unleash the full potential of the type system of TypeScript

#245

Earlier quoted context omitted.

True that. Once types get so complex, I’ve no idea what’s going wrong. Today I had code running fine but throwing errors all over the place because some deeply nested type mismatch between two libraries. I just any’d it… i aint got no time for that shit

You maybe just lack experience with more complex types. Which is totally expected, since you probably learned programming the runtime all the time, but not the typesystem - unless you come from one of those rare languages that have a similar powerful typesystem. But just like you probably struggled with and overcame many things before, it will be the same now. It's just that you can opt out of the typesystem in types…

I’ve used C++, C# and Java. Do these count as languages with complex types? I also used typescript a lot and have plenty of more complex types using generics and dynamic generation of types based on other types.

The problem with typescript is that the types are very often wrong or needlessly complicated.

Having separate type definitions from the library is stupid. Having types missing from @types/node is stupid. Many libraries lie about their types.

You can act like typescript is some kind of magic miracle that will save you time, but in reality it is just riddled with many small time-consuming stupidities. Typescript is just trying to a polished turd. Shiny on the outside, but shit within, and this is by design because it needs to work with JS and other poorly typed libraries and code.

If I haven’t convinced you TS is a polished turd, just wait until you find out how to import a modern nodejs module in a typescript project. Hint: you have to import a .js file, even though your file is called .ts.

The tsconfig has so many options that every project is different and a lot of code isn’t interchangeable and can break if copied from one project to another.

Want to convert some TS code to JS without checking types? No can do! Ts-node can do it, but tsc cannot.

Re: Learn how to unleash the full potential of the type system of TypeScript

#246

Earlier quoted context omitted.

Ahh I see. Thanks for the clarification

The transformer on the pole delivers 240V rms center tapped, with the center tap being connected to ground at the pole. The center tap wire is actually uninsulated, and the two hots are wrapped around it for support. The center tap is connected to the neutral bus at the breaker panel. Half the breakers are connected to one hot, and half are connected to the other hot. For 120V you wire hot/neutral to the receptacle,…

What? That's wrong.

The typical EU configuration:

The transformer delivers a neutral and three phases, in a star configuration.

That means you've got L1, L2, L3, N and GND.

N to any L is 230V, any L to any other L is 380V.

That also means a typical grounded socket has e.g., L1, N and GND, so a neutral and a hot.

A high-power socket or e.g. a stove will have GND, N, L1, L2, L3.

My stove has the oven running on L1 and N in a 230V hot/neutral and the stove at L2 and L3 in a 400V hot/hot configuration.

(Belgium is the exception, having phases at 113V off the center point, so sockets are in hot/hot to get 230V between the phases)

Re: Learn how to unleash the full potential of the type system of TypeScript

#247

Earlier quoted context omitted.

The transformer on the pole delivers 240V rms center tapped, with the center tap being connected to ground at the pole. The center tap wire is actually uninsulated, and the two hots are wrapped around it for support. The center tap is connected to the neutral bus at the breaker panel. Half the breakers are connected to one hot, and half are connected to the other hot. For 120V you wire hot/neutral to the receptacle,…

What? That's wrong. The typical EU configuration: The transformer delivers a neutral and three phases, in a star configuration. That means you've got L1, L2, L3, N and GND. N to any L is 230V, any L to any other L is 380V. That also means a typical grounded socket has e.g., L1, N and GND, so a neutral and a hot. A high-power socket or e.g. a stove will have GND, N, L1, L2, L3. My stove has the oven running on L1 and…

Thanks for the EU detail! Are you saying the typical house in the EU has three phase power delivered to it? All three phases?

Here in the US, where split-phase is the residential standard, a house with three phase is quite rare. The HV lines running on poles in a neighborhood are mostly single phase, at least in rural areas like mine.

Re: Learn how to unleash the full potential of the type system of TypeScript

#248

Earlier quoted context omitted.

What? That's wrong. The typical EU configuration: The transformer delivers a neutral and three phases, in a star configuration. That means you've got L1, L2, L3, N and GND. N to any L is 230V, any L to any other L is 380V. That also means a typical grounded socket has e.g., L1, N and GND, so a neutral and a hot. A high-power socket or e.g. a stove will have GND, N, L1, L2, L3. My stove has the oven running on L1 and…

Thanks for the EU detail! Are you saying the typical house in the EU has three phase power delivered to it? All three phases? Here in the US, where split-phase is the residential standard, a house with three phase is quite rare. The HV lines running on poles in a neighborhood are mostly single phase, at least in rural areas like mine.

> Thanks for the EU detail! Are you saying the typical house in the EU has three phase power delivered to it? All three phases?

Yes! And many electrical devices rely on it, though sometimes fallback to regular 230V single-phase at 32A is possible, e.g. for stoves.

And considering a typical stove runs at 11-15kW and a typical electric water heater between 15kW to 25kW, you'll need it as otherwise you'll need far higher amps than is reasonable.

Honestly, only due to the technology connections video did I realize that the US does not use triphase power in most homes, which was genuinely surprising.

Re: Learn how to unleash the full potential of the type system of TypeScript

#250
post #241

Earlier quoted context omitted.

I don't have (or want) a Twitter account, which kind of rules me out.

I was agreeing with you, and adding that even if you have a Twitter account, you would still be likely to miss an update to the tutorial among the author's other Twitter posts. It seems that the author added a way to get notified by email, which might work for you: https://type-level-typescript.com/03-objects-and-records Personally I set a crontab to alert me if the next chapter page's size increases above 50kB.

Thanks, hadn't spotted the email addition.
Post reply on HN