What’s real benefit of using TypeScript in app development?

I highly recommend React.js or Vue.js, a totally javascript-based system to work with cordova plugins (javascript & java), old and new javascript libraries.
I can’t wait to see this change. TypeScript isn’t really necessary for many of us. I find javascript to be more useful in the end. Check this article:

HTML5, CSS3, JavaScript should be core of apps. PhoneGap did it but it doesn’t ship with front end framework like Angular… and Cordova is outdated and buggy.

Oh @jamesharvey, Cordova is Phonegap.

2 Likes

Yes but PhoneGap comes with Adobe’s software.
I’m talking about the original Apache Cordova which doesn’t have that.

I’m questioning what’s real benefit of using TypeScript in app development?
Besides the fact that Angular ships with it, I think JavaScript still does it better.

That is easy to answer: Types.

2 Likes

I would recommend direct access to javascript libraries, cordova plugins just like we do on web development environment with javascript & html.
TypeScript is more concise than javascript but overall it slows down production.

Typescript includes Javascript. There is nothing blocking you from accessing any library or Cordova plugin directly. Just declare the variable they offer in the global namespace and go for it.

I’d rather recommend pure javasscript front end like Vue.js or React.js which will not require that procedure.
In the end, use of TypeScript isn’t necessary in app development.
Hopefully we will see React Ionic.

Typescript is coming to React. The big guys are already there.

2 Likes

Well I’ve seen some guys using React with TypeScript but I don’t see how it’s benefiting app developers who use old javascript libraries and cordova plugins. I think it makes it more difficult in the end. Nothing is better than getting direct access by following documentation of libraries, plugins.

There’s a way to use Vue.js on Ionic although it’s not official…

You might never need it. I don’t think you’re wrong for you. But I think your attitude is that of a person who has had recent successes. If you ever get to a point where you realize what a steaming pile of garbage Javascript actually is, Typescript will look like a lot less work. Maybe you’ll be lucky and never get there.

4 Likes

FACT: all of the greatest works are done in javascript. All fantastic libraries are in javascript.
It will take many many years to see .ts converted versions for easy & direct access without hassles.

TypeScript is more concise and less redundant for sure but I think maybe it’s a bit early to try it.
TypeScript is also a good learning tool for high level language like Java, and C#. It’s really close… to be honest if you can program in TypeScript, you can learn to program in Java quickly. Then you may no longer need help of plug-ins…

That doesn’t really seem like an argument against Typescript, but more of an argument that JavaScript has definitely been around longer and has many good libraries built for it but not “for Typescript” yet.

1 Like

Yes, and real talented guys still choose to build new libraries in javascript. They don’t care about angular or typescript.

If Ionic uses front end that is purely javascript-based like vue.js, react.js, I think it will make jobs easier …
Some old coldova plugins are all in javascript and they don’t offer assistance in converting everything into angular typescript.

I know react ionic is in development… it’s coming soon.

React.js and Vue.js are faster than Angular. Their VIrtual DOM is much faster than what angular is using.
That can perhaps solve slow speed problem of hybrid app. A lot of bloggers point out slower speed as a problem of hybrid app.Angular’s rendering speed is definitely not faster than that of React and Vue.
That’s one of the reasons I think it’s good to try react or vue on Capacitor. Maybe then app will be as fast as normal native apps written in Java & Objective-C.

Check this article:

This one also points out ‘Lower rendering speed’ as a problem of Angular. I think Ionic app is definitely less responsive to action than native app.

Lower render speed
The limited usage of shadow DOM and lack of virtual DOM result in lower performance. The view render/re-render speed is slower compared to the performance shown by other JavaScript frameworks on our chart.

Another article points out the same. Angular is categorized as one of the slow frameworks when compared to the others:

It could be that Angular is one of the factors which makes hybrid app slower…
So It’s good to give react a try… if Virtual DOM has much faster rendering speed, then that speed will apply to apps you will build based on it.

So overall, you’ll get easier access to old cordova plugins, javascript libraries and your app will become faster… this is not a bad idea at all.

This, and the order that Typescript brings to the relatively chaotic nature of JavaScript.

2 Likes

@jaydz

This, and the order that Typescript brings to the relatively chaotic nature of JavaScript.

That is the point. As a long C# Developer which converted to Web-Frontend Development I can say the structure of Typescript alone is the best Argument against JS.
Also Types are just something beautiful.

I think its time to say goodby to pure JS. Yes most of the market is JS, BUT it takes time to change. And as far as I know, many many Companys working now with NG and so on.

Also Typescript works with pure JS. And in fact you can run JS Plugins too in NG Projects with a little work.
So you DONT miss something out.

The only good Argument against TS and NG is the speed. But you know. I dont give a damn for these milliseconds of renderspeed and compiling. Sooooo i think Ionic should stay with NG and TS.

2 Likes

So, does your issue lie with Typescript or Angular?

Typescript isn’t Angular-specific, and Typescript is Javascript anyway so there’s no runtime performance difference.

I have used JavaScript for many years and like you questioned what benefit Typescript really brings to the table.
It was difficult to find code examples written in Typescript and therefore development was slower.

To me the main advantage of using Typescript is that we all use the same language - if it makes it easier to understand the code then that is a big plus.

1 Like

Then they’re not using typescript. Having a .ts on the end of your file don’t mean a fig on its own.

1 Like

I saw the light last week after retrospecting my bugs for the last half year of happy coding and concluded that many of that could have been avoided by simply adding an interface or even adhoc typing (typescript)

And with code completion in my ide, the ROI of typing a few extra words is making Warren Buffet jealous

I have quickly converted the existing code (e.g. [‘stuff’]) and cheered overjoyed of the additional bugs it showed

I do wish to see what is in store for us when cordova is ditched in favor of Capacitor. Or move over to react native

1 Like