Live data from Hacker News

Figma’s Journey to TypeScript

figma.com

41–50 of 257 posts

Re: Figma’s Journey to TypeScript

#42
post #33

Earlier quoted context omitted.

I also hate microsoft. I worked with their piece of shit browser for 20 years. From ie3 onward they all sucked and lagged behind. Their OS was complete garbage and somehow they managed to penetrate like 90% of the desktop market. but beyond that typescript i find is cognitive overload for someone who considers themselves an expert at vanilla javascript. It more than doubles the development time. I rarely use the infl…

Yeah, I think that's a good point. I'm actually quite on the fence about dynamic and static typing - I like both. With a small team that knows what they're doing, I tend to go dynamic. With a larger team, it does tend to become a bit of a mess and weird workarounds to not having static typing (like some mystical 100% test coverage) start to surface. I love the approach Python and MyPy took there: Python supports but…

I'm not absolutely certain, but doesn't Typescript work exactly the same way Python does if you set it up to do so? I think the reason you may think you can't have dynamic types in Typescript is because it's generally recommended not to do so. Sort of because that if you're using dynamic types, then you might as well be using pure JavaScript with JSDoc. Having a couple of decades of experience with dynamic and static typing, I tend to prefer static typing because it's just "easier" (more maintainable, lets you onboard people faster, lets you do a lot less code-reviewing, and other advantages all of which are more on the "managing people" side of things). Dynamic typing can be good and it certainly lets you prototype faster, but to do it well over a 5 year period you're going to need some serious governance.

One thing I never liked about Python is that sometimes it "guesses" the types wrong behind the scenes. This is sort of an issue with most "magic" that you'll also see in some of the parts where Java, C# and others, lets you skip writing a lot of boring code by "guessing" your intentions. But where it's relatively easy to tell the runtime environment how to do it the way you want it in something like C#, it's not in Python. It's also often a lot less obvious unless something fails in a manner you've taken steps to expect.

With JavaScript (and this includes Typescript) you have another set of issues. Since classes, types and so on are all abstractions of object and since Javascript will happily pass "nothing, but not null" around. Well... It's just so easy to make spaghetti or even code which isn't very performant. Things like classes have very little function in Typescript, I'm not saying you should never use them, because you should never be religious about these things. For the most part it's typically better to use a type/interface and a stand alone non-hoisting functions.

Personally I prefer rather opinionated languages like Go, or very strict languages like Rust where everything is very locked down and unmutable until you specifically tells it not to be. Of course Rust comes with it's own "interesting" things like the borrow checker.

Re: Figma’s Journey to TypeScript

#43
post #27

Earlier quoted context omitted.

Why don't you like it? Personally, I don't like it either. Firstly - entirely irrationally - because I don't like Microsoft. I grew up with them acting incredibly hostile towards the open source community and the rest of the industry, and I find that hard to forget. I know that has nothing to do with the merits of TypeScript, but I can't say it's not there. Secondly, I don't like the complexity incurred by any compil…

I also hate microsoft. I worked with their piece of shit browser for 20 years. From ie3 onward they all sucked and lagged behind. Their OS was complete garbage and somehow they managed to penetrate like 90% of the desktop market. but beyond that typescript i find is cognitive overload for someone who considers themselves an expert at vanilla javascript. It more than doubles the development time. I rarely use the infl…

I'd argue that if you ever use a single "any" then you're not using Typescript but simply writing JavaScript with more steps and a compile time. Any can be useful during development, but it should never reach production. I think the reason you see so much of it in a lot of open source packages is that they've only really adopted Typescript because their consumers expect it and it was just easier for them to do it this way.

We use very strict Typescript, but a lot of our internal utility packages are actually written in pure JavaScript because of the way the Node package environment works. Like our date tool, our helper API package for odata, and, our fascist linting extension package. They're all pure JS with provided types. This is because the handful of people, and the handful of times we work on these libraries it's always people who know exactly what they are doing while they do it. These same people (myself included) won't necessary be in similar positions when we write Typescript, which is why we don't use JavaScript in our day-to-day development. Since our strict Typescript setup protects us from ourselves.

I'm not personally a big fan of Microsoft. Professionally I do think they are one of the absolute best IT-business partners for organisations either enterprise-sized or approaching, because of how they run their support for operations. That being said, I do think what they've done with both Typescript and C# where they sort of mix the best from both languages, has been really good for both languages. At least until you look at something like Blazor which is basically just rebranded web-forms. But I guess that's what happens with large organisations, and at least as far as Typescript is concerned, they seem to be making the "right" decisions.

Re: Figma’s Journey to TypeScript

#44

Surprising to hear Figma had a custom language for JS. Even more surprising that it was faster than TS. And then they migrate off it onto slower TS! Seems to happen a lot though. Company makes custom stuff early on, gets big, then migrates to something "standard".

If you read carefully they migrated all the perf sensitive parts to C++/WASM. At that point only glue was left and their custom language didn't have a reason to exist anymore.

Re: Figma’s Journey to TypeScript

#45
post #27

Earlier quoted context omitted.

Why don't you like it? Personally, I don't like it either. Firstly - entirely irrationally - because I don't like Microsoft. I grew up with them acting incredibly hostile towards the open source community and the rest of the industry, and I find that hard to forget. I know that has nothing to do with the merits of TypeScript, but I can't say it's not there. Secondly, I don't like the complexity incurred by any compil…

I also hate microsoft. I worked with their piece of shit browser for 20 years. From ie3 onward they all sucked and lagged behind. Their OS was complete garbage and somehow they managed to penetrate like 90% of the desktop market. but beyond that typescript i find is cognitive overload for someone who considers themselves an expert at vanilla javascript. It more than doubles the development time. I rarely use the infl…

I felt the same about typescript early on. Now I really like it as I can easily program logic for hours without running the app once. I'm not sure I could do that without typing.

It also makes reading code a lot easier. I can see where something is used, where it's defined, etc etc. It's much easier to get around.

Re: Figma’s Journey to TypeScript

#46
post #20
post #12

Earlier quoted context omitted.

Why the laughter? CoffeeScript was great. TypeScript is even greater. All IMHO and YMMV, of course.

Some companies built a lot in CoffeeScript. Maintaining that won't be fun.

IIRC it compiled down to readable JS, so one reasonable option is just to delete the CoffeeScript and maintain the generated JS code.

Re: Figma’s Journey to TypeScript

#47

Earlier quoted context omitted.

Can you elaborate what you consider "crutches" in this case?

They had a custom language giving them full flexibility to achieve making a product in the browser that put them ahead of everyone else, and instead of embracing that, they throw it out to be able to hire of the shelve developers to code in a language that doesn't let them move freely. Typescript is like crutches in the sense that it might support you in not falling, but you only really need them if you're crippled i…

What are you talking about? Typescript is a fantastic improvement on JavaScript.

Skew doesn't look fundamentally better enough that it would be worth the downsides. Lack of IDE support alone is probably enough to cancel out a productivity gains from a better language.

Re: Figma’s Journey to TypeScript

#48
post #27

Earlier quoted context omitted.

Why don't you like it? Personally, I don't like it either. Firstly - entirely irrationally - because I don't like Microsoft. I grew up with them acting incredibly hostile towards the open source community and the rest of the industry, and I find that hard to forget. I know that has nothing to do with the merits of TypeScript, but I can't say it's not there. Secondly, I don't like the complexity incurred by any compil…

I also hate microsoft. I worked with their piece of shit browser for 20 years. From ie3 onward they all sucked and lagged behind. Their OS was complete garbage and somehow they managed to penetrate like 90% of the desktop market. but beyond that typescript i find is cognitive overload for someone who considers themselves an expert at vanilla javascript. It more than doubles the development time. I rarely use the infl…

I use JSDoc instead of TypeScript on a codebase where I am the sole developer. It skyrockets autocompletion, helps memory recall after off time and helps prevent stupid human errors that I am bound to make unconsciously. That's IMO what type systems are designed to do - reduce the error rate of human driven development.

Re: Figma’s Journey to TypeScript

#49
post #15

For people like me who know little about Figma, what motivates their use of WebAssembly?

You probably know that Figma is a UX design software. This means it’s basically a graphics program: you draw shapes, you scroll and zoom around. It does that extremely well. It’s unbelievably snappy even on a very large canvas with many complex UI screens. Very few desktop applications run nearly as well these days. I’m convinced that this kind of optimization is an important part of their success.

unbelievably snappy until you build something complex with complex components that have a lot of hidden variants, exponentially scales the number of existing layers and it goes dogshit with <10 fps, lag, and screen freezes (even on apple chip)

Re: Figma’s Journey to TypeScript

#50
post #27

[flagged]

Why don't you like it? Personally, I don't like it either. Firstly - entirely irrationally - because I don't like Microsoft. I grew up with them acting incredibly hostile towards the open source community and the rest of the industry, and I find that hard to forget. I know that has nothing to do with the merits of TypeScript, but I can't say it's not there. Secondly, I don't like the complexity incurred by any compil…

You may like JSDoc[1] if you just want some type-safety from the IDE without the compilation overhead.

It’s done wonders when I’ve had to wrangle poorly commented legacy JavaScript codebases where most of the overhead is tracing what type the input parameters are. Otherwise it’s just nice when writing a small library where you don’t want to setup a bunch of build tools.

Personally, I’m impartial to TypeScript or JSDoc at this point. But I’d rather have either over plain JavaScript.

[1] https://jsdoc.app/

Post reply on HN