oasp / oasp4js

OASP4JS deprecated repository
Apache License 2.0
9 stars 161 forks source link

AngularJS and TypeScript #80

Open maybeec opened 8 years ago

maybeec commented 8 years ago

We should strongly consider to already switch to TypeScript before the AngularJS 2.0 Release. Due to the DefinitelyTyped descriptions, it is possible to also type the AngularJS 1.5 framework. There is a quite nice article in the 11/15 JavaMagazin covering this issue in a nice sample description. I also know from my previous company, that it is possible also for large application to already work with AngularJS and TypeScript simultaneously.

tomaszwawrzyniakit commented 8 years ago

You mean gulp-typescript-angular ?

maybeec commented 8 years ago

I do not know, which technical build steps or dependencies have to be used. I just wanted to indicate that we should more focus on integrating TypeScript and the current AngularJS release and declare it as the standard way to go.

I already heard from @hohwille, that this is currently evaluated in a project. So if it pays of, we should strongly consider to also migrate the oasp4js-sample-application to TypeScript.

hohwille commented 8 years ago

I personally can already say that it pays off. JS is still hard to write and even harder to read. When you create large applications then controllers can get quite complex. Best practices and patterns for JS help but still many pitfalls remain and single var pattern is IMHO decreasing readability. Also you have to consider that developers are coding Java on the backend (or maybe .NET). Then the gap to JS is so extraordinary big. If you are using TypeScript you make your life a lot easier. EcmaScript 2015 is the way to go anyway. Every code that is written today not using these concepts is already legacy code. TypeScript only adds some sugar on top of that. @mmatczak did a great job to transform the oasp4js principles and the entire build towards TypeScript. I have seen the new code and immediately was convinced that we are going in the right direction.