Hey all. Can I get a thumbs up/thumbs down reacti...
# suitescript
j
Hey all. Can I get a thumbs up/thumbs down reaction for those of you using/not using TypeScript? Trying to get a gauge on how much people use it.
👎 10
👍 4
a
I'm super interested in this, when I was job hunting a few months ago I had some opportunities at places that exclusively use TypeScript, and those people were VERY happy with themselves about it, but I'm not really sure I see what the huge benefit is? (I didn't end up taking one of those jobs but I really wanna know what all the fuss is about 🙂 )
s
trouble with this is it's only polling people that happen to see this message on this day 🙂 As for TypeScript, if I weren't using TS I wouldn't be doing SuiteScript at all.
a
do you have blog post or something you can refer me to that makes the case FOR typescript for netsuite?
or... you could write one yourself 😄
s
other than all the other reasons to use TS already discoverable on the internet, another reason specific to NS is the fact that we must deploy our code to test it
therefore, any errors/issues that TS discovers before you go through the trouble to deploy and step through code, is time saved.
there are MANY questions asked right here on this channel that would be caught by the TS compiler.
a
hmm I don't feel like many of my errors would be fixed with strict typing, but maybe I'm just wrong. can you point me to some good resources for how to get started using TS in NS? I think I'll just have to play around with it some and see for myself.
s
it's not much, but you could take a peek at the @hitc/netsuite-types project
👍 2
in npm
I can't speak for others, but I do think a good number of active users on this forum use TS for SuiteScripting.
d
agreed https://github.com/headintheclouddev/typings-suitescript-2.0 is a good middle ground to get started. I didn't have the opportunity to use full-blown TS when I was working with NetSuite (although likely would have otherwise) but did use that library for at least some type checking alongside JS suitescript
j
While TS is obviously advantageous for many reasons, only one of our current devs knows it (not me) so we would all have to learn, and it would be a barrier-to-entry (potentially) for hiring new people
w
You don't need to know that much really. Of course there are levels to it, but just typing out stuff isn't that much of a difference to JS
s
True, TS insn't a new language, it's a superset of JS
in other words, JS is TS. In many cases you can just change your file extension from .js to .ts then incrementally introduce TS concepts over time. I don't have a lot of experience doing that myself but even typechecking plain JS as @dbarnett mentions is becoming a thing. I have been authoring scripts in TS for about a decade and it's helped preserve my sanity.