Blog

Stream of consciousness and other rants and ramblings

TypeScript Approach

Rethinking my incredibly stupid hot take on TypeScript and rethinking my life

By Published

After writing a long rant about TypeScript yesterday, it gave me the ability to rethink my approach. Basically my thinking is that TypeScript will help with react by being able to define strict values to manage state. My biggest issues with TyepScript and React is the syntax needed to create the classes, but looking online, it seems that most of the content was focused on using React with functions in TypeScript. That way I only need to declare interfaces for the structs for the properties being passed into a component, and not much else.

This generally means that I’ll need to learn how the useState function works, which means I’ll need to get more familiar with React. But it seems this approach is simpler as it allows me to pick my battles and not get too heavily involved in quirky syntax games, and be able to focus on making content instead of pulling out my hair.

In terms of mitigation, I should probably switch to golang. As it’s like writing C with a crayon. But more importantly it has bindings for GTK, and Vulkan. So it seems supported on the Linux desktop side of things. It can write a fast strongly typed server, and it can can be compiled to web ASM. I looked at the JS compiled, and I was a little disappointed it doesn’t produced typed arrays. So I think that client web will still be React + Typescript.

So my focus for TypeScript should probably be focused on Express + TypeScript and React + TypeScript and basically think of it as the new syntax required to work with these, as in all likelyhood it’s a syntax that will be required more and more in web development.

Liked the article? Share it!