-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript vs Pure Javascript #15
Comments
+1 for Typescript mainly for the experience as a developer of the future implementation, completion and static check are a must have for me. If the con is compatibility with older versions, i believe having specific bundle (with shim for promise for exemple) for older versions is the easiest way. |
+1 for JavaScript with corresponding TypeScript definition files. This would provide all the benefits of both JavaScript and TypeScript, without all the disadvantages of going completely with TypeScript. Static checks are supported with this model for example. There are many downsides to using TypeScript as described in #3 (comment). If we decide to go with TypeScript, we need to have a discussion about how to make sure it doesn't impact the developer experience (slow builds preventing TDD, etc) and how to properly handle different code paths per version of Node/ECMAScript. One alternative potentially would be to remove any transpilation feature and shims and handle these concerns outside of TypeScript. Then TypeScript would be used almost exclusively for type safety, which would provide an experience similar to my above proposition. |
FWIW we're considering using type hints in the python API package but not the SDK. It's an apples-to-oranges comparison since type hints are a language feature and don't e.g. require transpiling code, but gives us the same benefit of a well-defined API and optional static checks for the implementation. |
One thing also is that it's easy to move from JavaScript to TypeScript if necessary (especially if the definition files are already done) but the opposite is not true, especially with many transpilation features enabled, so it would be safer to start with JavaScript. |
+1 for Typescript. With TypeScript,
|
You cannot for a library that is used by a majority of JavaScript users. Tests are still needed for most types (false sense of safety).
A lot of JavaScript patterns and best practices deviate from OOP and tend to be more on the functional side. They are usually very difficult to type properly.
I would argue that it makes the code a hell of a lot verbose, but I agree that the intent is clearer and that IDEs can usually refactor pretty much anything.
I've never seen a single project where productivity was actually increased by TypeScript unless they were not unit testing, or relying on types to guide junior developers. In fact, it tends to be the opposite. Also, every TypeScript developer knows JavaScript but the opposite is not true, so JavaScript makes it easier to collaborate (arguable since we still need to have definition files).
VSCode (and probably others) is able to use TypeScript definition files even for JavaScript).
Mine isn't, but this is subjective, similar to any debate between programming languages in general. I don't like Java, but most of the world likes Java (statistically). (Sorry if I'm very vocal in this thread, but I know I'll be playing devil's advocate here 😄) |
These are some interesting and valid points, let's continue this discussion in SIG meeting. @vmarchaud @rochdev @bg451 @hekike @danielkhan @justindsmith Can you please update availability here or gitter channel. |
+1 for Typescript I agree with @rochdev there are many pure javascript hacks/flexibility however while this works great for small optimizable packages, I don't think its the same for large project like this one. since we are holding many cross dependent packages in one repository I think it is helpful for developers to have common strong data type. |
First @rochdev I appreciate your concerns on using TypeScript, and we should definitely consider both sides for key design decisions like this. I agree that for TS to work smoothly for us we will need the tooling to make incremental TDD and local dev easy. TypeScript 3.4 recently added a feature for Faster subsequent builds with the --incremental flag and I think we should use that to try to reduce the pain of compile type. I will likely miss the SIG since I'm on vacation June 10-19, so I'd like to give my +1 for TypeScript here (I'm late to the convo because I forgot to turn on notifications for the repo). My reasons for preferring TS:
Some additional considerations:
|
It was agreed at today's meeting that TypeScript will be the language for this project. However, there are a few key things to keep in mind to make sure that we are able to provide the best developer experience and minimize issues between supported versions while using TypeScript. I will open an issue to discuss TypeScript guidelines to be added to the project once the initial skeleton is merged. |
@bogdandrutu and @SergeyKanzhelev any thoughts ? |
TS would be OK with us. It will give the best return on the bucks. And later we can cover whatever edge scenarios needed. |
Closing this, agreed to use TypeScript for the project. |
Originates from #3 (comment)
The text was updated successfully, but these errors were encountered: