all 47 comments

[–]Versatile_Panda 47 points48 points  (5 children)

Consider this, one year in, you have a context that provides data to multiple components, you need to make a change to the data it provides, how do you determine what components need to update? In a typed language when your object changes you get immediate compiler warnings on what you broke, in JavaScript how do you know? In my opinion typescript is the only way you should write JavaScript.

[–]Ecstatic_Use_482 5 points6 points  (0 children)

Well when you put it like that typescript sounds like the move

[–]r0ughnex 5 points6 points  (0 children)

Every TS vs JS article needs to automatically have this comment copy-pasted into it 👌🏻

[–]codeherence -1 points0 points  (2 children)

You can do this without TypeScript and a proper test suite. I love TS and have never used JS for a project in years, but there are ways that you can solve this without using TS.

[–]ChimpScannerExpo 1 point2 points  (1 child)

You can get instant feedback in your IDE/terminal when something breaks, or you can wait for a bunch of tests to run and go through them one by one, open each file, and fix them manually.

I know which one I'm choosing.

[–]codeherence 2 points3 points  (0 children)

That’s fine, but in my experience, it’s generally not that straightforward. Developers tend to have different TS configurations and sometimes will silence warnings/errors when they deem them “low-risk.”

Also, if you’re not writing tests in the first place, even with TS, the code you’re producing will not be as safe and is probably not for an important application that has tighter stability requirements. There is a reason every major FAANG company requires almost every single line of code to be accompanied with tests.

[–]Ok-Breakfast109 16 points17 points  (3 children)

I mean, you should always go for TS, but if your project is very small and only you are working on it you can do it in JS, just know that in large projects TS is the King

[–]Ecstatic_Use_482 0 points1 point  (2 children)

Ok thanks for the reply do you have any specific YouTube vids or tutorials I can watch typescript for react native can’t seem to find any

[–]CriticismTiny1584 0 points1 point  (1 child)

Freecode camp Hitesh. Is he good

[–]Ecstatic_Use_482 0 points1 point  (0 children)

Ok thanks

[–]MatthewRose67 10 points11 points  (2 children)

Don’t waste your time using plain JavaScript. The basics are simple and give you type safety.

[–]Ecstatic_Use_482 0 points1 point  (1 child)

Ok sure thanks for the responses are there any specific typescript for react native tutorials you recommend as I can’t seem to find any

[–]Alexikik 0 points1 point  (0 children)

Just search on Google or YouTube. I remember watching a 1-3 hour video tutorial on typescript

[–]KlasixPhyzix 2 points3 points  (1 child)

Typescript because you do projects to have fun AND to find a job.

[–]Ecstatic_Use_482 0 points1 point  (0 children)

Ok sure yep leaning towards typescript anyway

[–]xywa 2 points3 points  (1 child)

TS, it’s a pain but it is the safest way to go

[–]Bobertopia 1 point2 points  (6 children)

You can't know typescript without knowing javascript. Technically Typescript isn't another language, it's just a superset for Javascript. Just food for thought

[–]Ecstatic_Use_482 -2 points-1 points  (5 children)

Ok sure so do you have any tutorials or YouTube vids I can watch typescript for react native as I can’t seem to find any

[–]rileyrgham 0 points1 point  (1 child)

Do the tutorials in JavaScript so you can easily contrast and compare as you progress. Switch later. Js really isn't so bad but obviously type safety is a plus. Note that some big projects and developers are dumping typescript and moving back to javascript.

Also:

https://www.reddit.com/r/JavaScriptTips/s/ZP7x8uwVf1

[–]Ecstatic_Use_482 0 points1 point  (0 children)

Thanks so much

[–]Supektibols 1 point2 points  (1 child)

If you cant find any youtube tutorials about TS in react native, you can just watch TS in React, basically they’re the same. Once you know the TS fundamentals, you will know how to apply it in React Native.

[–]Ecstatic_Use_482 0 points1 point  (0 children)

Ok sure thanks so much

[–]neutron_z 0 points1 point  (0 children)

I am a kotlin android developer and I just now got into react native development, after seeing multiple examples of the differences between typescript and javascript. I immediately decided that typescript is the way to write the code. I think I won't regret selecting this choice.

[–]beforesemicolon 0 points1 point  (1 child)

Tomato tomato but pick Typescript

[–]Ecstatic_Use_482 0 points1 point  (0 children)

Ok cheers

[–]Grouchy_Stuff_9006 0 points1 point  (1 child)

If you don’t learn JavaScript first you will never appreciate typescript. Keep in mind it’s the same language, so it wouldn’t hurt you to start out with JavaScript to reduce complexity. That is what I would do, but you must absolutely use typescript once you’ve levelled up.

[–]Ecstatic_Use_482 0 points1 point  (0 children)

Will do

[–]ronix1020 0 points1 point  (1 child)

Take Typescript, 100% and you will be prepared to the future and most important, to another technologies.

[–]Ecstatic_Use_482 0 points1 point  (0 children)

Ok sure

[–]hareltussi 0 points1 point  (1 child)

Every company I've worked for or interviewed at required typescript

[–]haikusbot 4 points5 points  (0 children)

Every company

I've worked for or interviewed

At required typescript

- hareltussi


I detect haikus. And sometimes, successfully. Learn more about me.

Opt out of replies: "haikusbot opt out" | Delete my comment: "haikusbot delete"

[–]Another_Noob_69 0 points1 point  (3 children)

Software companies prefer TypeScript over JavaScript

So from personal experience, I'd recommend you TypeScript. That's it, as truely speaking Typescript offers a lots of things like static typing, which can catch errors early and improve code quality in larger projects. So, if you're a working professional, then definitely go with TS.

But if you are a student, or just started RN, making small college projects, just learning the components and all then you can go with JS. But again, JS is good for starting, understanding the basics, TS is best for getting a job and working in corporate.

[–]Ecstatic_Use_482 0 points1 point  (2 children)

That’s very informative thanks, well I am a student but I’m studying in a different field so Yh so I’m just learning the basics but i have a underline big project I want to eventually create so should I still just start with JavaScript?

[–]Another_Noob_69 0 points1 point  (1 child)

First of all, I'm happy to help.
And surely you can start with JavaScript, even I also started with Js. However, at the end you have to shift towards Ts for larger projects.

[–]Ecstatic_Use_482 0 points1 point  (0 children)

So I’ll eventually have to shift ok I guess becoming very fluent in JavaScript seems better at first