TypeScripting the technical interview
41–50 of 180 posts
Re: TypeScripting the technical interview
#42Is this really what technical interviews are like in Silicon Valley? I’ve never seen anything like it in the “real” world.
Re: TypeScripting the technical interview
#43Is this really what technical interviews are like in Silicon Valley? I’ve never seen anything like it in the “real” world.
Re: TypeScripting the technical interview
#44TypeScript has the most complicated type system ever. Don't know why Anders&Co needed to go that far.
As much as people complain about the TS type system’s complexity, it is just modeling real world JS. The vast majority of its complexity is hardly used in TS that doesn’t interop with existing JS, because you generally won’t write such highly dynamic code when you have to define its types. But it does allow for safer interop. Even so, JS itself being so dynamic, TS still can’t claim full type safety. And as much as p…
which tends to happen at the edge of the application where it interacts with the outside world and all the interesting things happen.
Re: TypeScripting the technical interview
#45In case folks miss the link at the top of the article, this is translated from an old 2017 post by Aphyr. That post was in Haskell, where it's not too surprising that you can do serious computation inside the type system. This new post translates the ideas to TypeScript, which is more widely known, and which I once heard described as having "accidentally Turing-complete" types: https://github.com/microsoft/TypeScript…
Aphyr has a series of posts in this style, all of which are excellent.
Re: TypeScripting the technical interview
#46 import { Query } from "@codemix/ts-sql";
const db = {
things: [
{ id: 1, name: "a", active: true },
{ id: 2, name: "b", active: false },
{ id: 3, name: "c", active: true },
],
} as const;
type ActiveThings = Query;
// ActiveThings is now equal to the following type:
type Expected = [{ id: 1; nom: "a" }, { id: 3; nom: "c" }];Re: TypeScripting the technical interview
#47So he wrote all that for the typescript lsp to respond with the answer, but when it compiles down it's nothing? And we're using runes as variables just because? That is pretty neat, and silly. I also think it highlights my natural aversion to static type checking in dynamic languages. I know that I could get sucked into writing a bunch of code for the checker, instead of using my energy for making the application wor…
Re: TypeScripting the technical interview
#48So he wrote all that for the typescript lsp to respond with the answer, but when it compiles down it's nothing? And we're using runes as variables just because? That is pretty neat, and silly. I also think it highlights my natural aversion to static type checking in dynamic languages. I know that I could get sucked into writing a bunch of code for the checker, instead of using my energy for making the application wor…
this is why i love ts when not working for a megacorp. when the ts gets too cray i just nope out. throw an any or as in there and get on with my day. wouldn't pass a code review but i don't care
Re: TypeScripting the technical interview
#49Is this really what technical interviews are like in Silicon Valley? I’ve never seen anything like it in the “real” world.
Re: TypeScripting the technical interview
#50I'm reminded of https://github.com/type-challenges/type-challenges -- I've only looked at some of the more challenging problems, but one involves writing a JSON parser in the type system. The easy problems look reasonably useful to solve.