You are viewing a single comment's thread from:

RE: Getting started with Hive app development

in STEMGeeks6 days ago

If one chooses Javascript, I highly recommend to use Typescript.


I tried to give it a go, and it still feels a bit weird as compared to a native statically typed language(plus I can mix JS in between whenever I want?), any advice advice on how to make the typescript experience a bit better?

You will spend more time at the beginning but the learning curve is worth it.
Typescript + Eslint makes you a better developer I reckon. Forces you to code cleanly following standards so it's easier for someone else to join in later on or even for you to revisit old codes. As for Typescripts it will help reducing silly bugs such as passing the wrong parameter to a function or sending incomplete object to a method.

Everything becomes stricter, which can be annoying but in the long run you'll discover their usefulness.

Typescript is Javascript + types, so the code itself is Javascript and you have an additional syntax for declaring types. It's also recommended to add ESLint into the mix.

For example this JS code:

Would be come this in Typescript:

Or this in JS:

Becomes this in TS: