Need advice about which tool to choose?Ask the StackShare community!

NativeScript

538
1.1K
+ 1
516
TypeScript

99.1K
69.7K
+ 1
499
Add tool

NativeScript vs TypeScript: What are the differences?

Introduction

In this article, we will compare NativeScript and TypeScript, two popular technologies used in web development. We will highlight the key differences between these two technologies to help you better understand their uses and benefits.

  1. Compilation Process: One major difference between NativeScript and TypeScript is their compilation process. NativeScript uses a just-in-time (JIT) compilation process, which means that the code is compiled at runtime during the execution of the application. On the other hand, TypeScript uses an ahead-of-time (AOT) compilation process, where the code is compiled ahead of time before the application is executed. This difference in compilation processes affects the performance and startup time of the application.

  2. Target Platforms: NativeScript is primarily used for developing cross-platform mobile applications. It allows developers to write code once and deploy it on multiple platforms, such as iOS and Android. On the other hand, TypeScript is a superset of JavaScript and is mainly used for developing web applications. It is not limited to any specific platform and can be executed on any JavaScript runtime environment.

  3. Language Features: TypeScript is a language that adds static typing to JavaScript, providing developers with features such as static type checking, interfaces, and classes. It adds a level of robustness and maintainability to JavaScript code. NativeScript, on the other hand, is a framework that allows developers to build native mobile applications using JavaScript or TypeScript. While NativeScript also supports type checking and classes, it provides additional features specific to mobile application development, such as access to native APIs and UI components.

  4. Development Workflow: NativeScript allows developers to use their existing web development skills, such as HTML, CSS, and JavaScript, to build mobile applications. It provides a familiar development workflow for web developers who want to transition to mobile development. TypeScript, on the other hand, requires developers to learn a new language with additional syntax and concepts. It may have a steeper learning curve for developers who are not familiar with static typing.

  5. Community and Ecosystem: NativeScript has a growing community of developers who actively contribute to its ecosystem by developing plugins, themes, and other resources. It has a rich ecosystem with a wide range of third-party libraries and tools that can be used to extend the functionality of NativeScript applications. TypeScript also has a strong community and a rich ecosystem, with a large number of libraries and tools available for web development.

  6. Debugging and Testing: Debugging and testing in NativeScript can be done using familiar web development tools, such as Chrome DevTools. Developers can inspect and debug their NativeScript applications using the Chrome DevTools interface. TypeScript, being a superset of JavaScript, can be debugged using standard JavaScript debugging tools. It also has robust testing frameworks available for writing and running tests.

In Summary, NativeScript and TypeScript have key differences in their compilation process, target platforms, language features, development workflow, community and ecosystem, as well as debugging and testing capabilities. These differences make them suitable for different use cases, with NativeScript being specifically designed for mobile application development and TypeScript being more focused on web application development.

Advice on NativeScript and TypeScript
Needs advice
on
TypeScriptTypeScript
and
Flow (JS)Flow (JS)

From a StackShare community member: "We are looking to rewrite our outdated front-end with TypeScript. Right now we have a mix of CoffeeScript and vanilla JavaScript. I have read that adopting TypeScript can help enforce better code quality, and best practices. I also heard good things about Flow (JS). Which one would you recommend and why?"

See more
Replies (14)
Recommends
on
TypeScriptTypeScript

I use TypeScript because:

  • incredible developer tooling and community support
  • actively developed and supported by Microsoft (yes, I like Microsoft) ;)
  • easier to make sense of a TS codebase because the annotations provide so much more context than plain JS
  • refactors become easier (VSCode has superb support for TS)

I've switched back and forth between TS and Flow and decided a year ago to abandon Flow completely in favor of TS. I don't want to bash Flow, however, my main grievances are very poor tooling (editor integration leaves much to be desired), a slower release cycle, and subpar docs and community support.

See more
Recommends
on
TypeScriptTypeScript

I use TypeScript because it isn't just about validating the types I'm expecting to receive though that is a huge part of it too. Flow (JS) seems to be a type system only. TypeScript also allows you to use the latest features of JavaScript while also providing the type checking. To be fair to Flow (JS), I have not used it, but likely wouldn't have due to the additional features I get from TypeScript.

See more
David Koblas
VP Engineering at Not disclosed · | 9 upvotes · 161.1K views
Recommends
on
TypeScriptTypeScript
at

We originally (in 2017) started rewriting our platform from JavaScript to Flow (JS) but found the library support for Flow was lacking. After switching gears to TypeScript we've never looked back. At this point we're finding that frontend and backend libraries are supporting TypeScript out of the box and where the support is missing that the commuity is typically got a solution in hand.

See more
Forrest Norvell
engineering manager at self-employed · | 6 upvotes · 251.1K views
Recommends
on
TypeScriptTypeScript

I use TypeScript because the tooling is more mature (the decision to discontinue TSLint in favor of moving all its checks to ESLint is a thoughtful and mature decision), there's a ton of examples and tutorials for it, and it just generally seems to be where the industry is headed. Flow (JS) is a fine tool, but it just hasn't seen the uptake that TS has, and as a result is lacking a lot of the nicer small things, like thorough Visual Studio Code integration, offered by TS.

See more
Recommends
on
TypeScriptTypeScript

We currently use TypeScript at work. Previously we used Flow (JS) but it was sometimes really difficult to make the types work the way you want. Especially non-trivial types were problematic. And the IDE support wasn't good, Flow took too much resources and sometimes remain stuck and do not show errors (I use Visual Studio Code). With TypeScript we almost do not have these problems. IDE support is superb, working with types is much easier and typing system seems more mature and powerful. There are some downsides (like partion inheritance etc.), but TS team is still pushing it forward. So for me TypeScript is clear winner.

See more
Tim Abbott
Recommends
on
UnderscoreUnderscore
at

We use Underscore because it's a reasonable library for providing all the reasonable helper functions missing from JavaScript ES5 (or that perform poorly if you use the default ES5 version).

Since we're migrating the codebase to TypeScript , we'll likely end up removing most usage of it and ultimately no longer needing it, but we've been very happy with the library.

See more
Recommends
on
TypeScriptTypeScript

I use TypeScript for Web Applications and for both frontend and backend because it has a lot of tooling around it and they really got the types and type safety right. Flow (JS) on the other hand lacks tooling and most of the times I scramble to find the right way of building my contracts in which TypeScript is very intuitive and natural. Additionally TypeScript is very similar to Java so your backend engineers and full stack engineers can work with it without much of context switch.

The only time I think Flow shines is (based on probably my outdated knowledge) Flow is/was the only option if you want/wanted to build a React Native application mainly because React Native transpiler at the time I was working with it would only work with flow.

See more
Recommends
on
TypeScriptTypeScript

I use TypeScript because it's adoption by many developers, it's supported by many companies, and it's growth. AngularJS, React, @ASP.NET Core. I started using it in .NET Core, then for a job. Later I added more Angular experience and wrote more React software. It makes your code easier to understand and read... which means it makes other people's code easier to understand and read.

See more
Frédéric MARAND
Core Developer at OSInet · | 2 upvotes · 133.4K views
Recommends
on
TypeScriptTypeScript

I use TypeScript because I tried both on a Meteor project, and found the quantity of errors it enabled us to catch and the simplification of code it allowed was higher than Flow (JS).

See more
Recommends
on
TypeScriptTypeScript

I use TypeScript because it's the most mature/issue-free Javascript type-checker available, as far as I've seen.

See more
Recommends
on
TypeScriptTypeScript

If you will start a project from scratch I recommend to use TypeScript. But, If you work with legacy projects written in JavaScript I recommend Flow (JS). Both tools have the same objective: reduce the bad code (which create illegible code, generate bugs e problems to maintenance). Flex helps you to avoid fall in bad codes, but TypeScript prevent you to c you to create bad codes. I believe cause this some JavaScript fans don't like TS, because TS block you to write some types o code. This is the fundamental difference between TS and Flow: Flow avoid problems, but no force. TS force you to prevent problems.

See more
Recommends
on
TypeScriptTypeScript

I use TypeScript because of broad support, on tools, repos, community ... the only reason to consider flow is if you're a facebook employee

See more
Rafael Avaria
Ingeniero civil en electrónica · | 1 upvotes · 119.9K views
Recommends
on
TypeScriptTypeScript

I use TypeScript because i love to program in Angular and used in node as well

See more
Damian Esteban
CTO @ betterPT at BetterPT · | 1 upvotes · 121.1K views
Recommends
on
TypeScriptTypeScript
at

I recommend TypeScript. When used correctly, TypeScript can enable your application to be scalable, easy to refactor, safe, and stable. One of the biggest draws of working with any typed language is that it forces you to think about your functions' inputs and outputs. This is invaluable as it can lead to more declarative, functional style code that ultimately can be easier to reason about.

TypeScript is however not a silver bullet. Just like anything new it takes time to fully understand the concepts of types, interfaces, abstract classes, and enums. In my experience engineers who excel when using TypeScript are those who have experience working with a statically typed language.

See more
Decisions about NativeScript and TypeScript
Vladyslav Holubiev
Sr. Directory of Technology at Shelf · | 3 upvotes · 137.3K views

As our codebase grew in size, we were looking for ways to improve code quality. We chose TypeScript over Flow due to its rapid industry adoption and overall tools support.

We noticed how different open-source projects were migrating from Flow to TypeScript. Most notably, it was Jest, even though Jest and Flow were both developed by Facebook. See this HN thread if you want to dive into an interesting discussion around this move.

Additionally, at the beginning of 2019, both Babel and ESLint enabled seamless TypeScript support, which allowed easy migration path in a backward-compatible way.

See more
Oleksandr Fedotov
Senior Software Engineer at joyn · | 4 upvotes · 118.6K views

Initially making a decision to use Flow vs Typescript we decided to go with flow as we wanted our code to run in a way we wrote it, because when using Flow types are simply removed from the code without modifying the code itself. Sadly, the type system of Flow was in some cases very hard to understand and declare the types correctly, especially in cases when the structure is very dynamic (e.g. object keys and values are created dynamically). Another reason was bad integration with IDE and frequent crashes which made DX very poor. Therefore, we made another evaluation of Typescript and decided to move towards it. As our code base was pretty big when we decided to migrate to TS we couldn't just stop and re-write everything, that's why we started writing new modules in Typescript as well as transforming old components. To make that possible we had to configure Webpack loader to support simultaneous bundling of Flow&JS and Typescript. After around 2 months of the transformation we have around 40% of code being written in Typescript and we are more than happy with integration TS has with IDE, as well as ease of declaring types for dynamic modules and functions.

See more
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of NativeScript
Pros of TypeScript
  • 75
    Access to the entire native api
  • 47
    Support for native ios and android libraries
  • 46
    Support for javascript libraries
  • 46
    Angular 2.0 support
  • 44
    Native ux and performance
  • 37
    Typescript support
  • 35
    Backed up by google and telerik
  • 29
    Css support
  • 27
    Cross-platform declarative ui and code
  • 25
    Fully open source under apache 2.0 license
  • 11
    Vuejs support
  • 9
    60fps performance
  • 6
    Powerful data visualization with native UI
  • 5
    VS Code integration
  • 5
    Angular, typescript and javascript support
  • 5
    No need for Mac to build iOS apps in Telerik Platform
  • 4
    Extended CLI support
  • 4
    Cloud builds as part of Telerik PLatform
  • 4
    Truly Object-Oriented with Typescript
  • 4
    On-device debugging
  • 4
    Extensibility
  • 3
    Access to entire native api
  • 3
    Live reload
  • 3
    Easiest of all other frameworks
  • 3
    Easy to learn
  • 3
    Backed by google
  • 3
    0 day support for new OS updates
  • 3
    Publishing modules to NPM
  • 2
    Vue.js support out of the box
  • 2
    VueJS support
  • 2
    Svelte support
  • 2
    Powerfull mobile services as part of Telerik Platform
  • 2
    Native ui with angular
  • 2
    Vue support
  • 1
    Playground
  • 1
    Hot Reload
  • 1
    HMR via webpack
  • 1
    Very small app size
  • 1
    Write once, use anywhere
  • 1
    Easy to use, support for almost all npm packages
  • 1
    Rich ecosystem
  • 1
    Compile to Apple/Google Stores via CloudCompiler
  • 1
    Has CSS ;-)
  • 1
    It works with Angular
  • 1
    Code reuse with your website
  • 0
    Dart
  • 173
    More intuitive and type safe javascript
  • 105
    Type safe
  • 79
    JavaScript superset
  • 48
    The best AltJS ever
  • 27
    Best AltJS for BackEnd
  • 15
    Powerful type system, including generics & JS features
  • 11
    Compile time errors
  • 11
    Nice and seamless hybrid of static and dynamic typing
  • 10
    Aligned with ES development for compatibility
  • 7
    Angular
  • 7
    Structural, rather than nominal, subtyping
  • 5
    Starts and ends with JavaScript
  • 1
    Garbage collection

Sign up to add or upvote prosMake informed product decisions

Cons of NativeScript
Cons of TypeScript
  • 5
    Lack of promotion
  • 1
    Slower Performance compared to competitors
  • 5
    Code may look heavy and confusing
  • 4
    Hype

Sign up to add or upvote consMake informed product decisions

What is NativeScript?

NativeScript enables developers to build native apps for iOS, Android and Windows Universal while sharing the application code across the platforms. When building the application UI, developers use our libraries, which abstract the differences between the native platforms.

What is TypeScript?

TypeScript is a language for application-scale JavaScript development. It's a typed superset of JavaScript that compiles to plain JavaScript.

Need advice about which tool to choose?Ask the StackShare community!

What companies use NativeScript?
What companies use TypeScript?
See which teams inside your own company are using NativeScript or TypeScript.
Sign up for StackShare EnterpriseLearn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with NativeScript?
What tools integrate with TypeScript?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

What are some alternatives to NativeScript and TypeScript?
React Native
React Native enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and React. The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere. Facebook uses React Native in multiple production apps and will continue investing in React Native.
Ionic
Free and open source, Ionic offers a library of mobile and desktop-optimized HTML, CSS and JS components for building highly interactive apps. Use with Angular, React, Vue, or plain JavaScript.
Xamarin
Xamarin’s Mono-based products enable .NET developers to use their existing code, libraries and tools (including Visual Studio*), as well as skills in .NET and the C# programming language, to create mobile applications for the industry’s most widely-used mobile devices, including Android-based smartphones and tablets, iPhone, iPad and iPod Touch.
React
Lots of people use React as the V in MVC. Since React makes no assumptions about the rest of your technology stack, it's easy to try it out on a small feature in an existing project.
Vue Native
Vue Native is a mobile framework to build truly native mobile app using Vue.js. Its is designed to connect React Native and Vue.js. Vue Native is a wrapper around React Native APIs, which allows you to use Vue.js and compose rich mobile User Interface.
See all alternatives