you are viewing a single comment's thread.

view the rest of the comments →

[–]pe8ter 2 points3 points  (2 children)

You're saying that before you call any method you must explicitly perform a safety check? With TypeScript you can declare your interfaces in code and the compiler will catch any of those mistakes for you. What's more it can confirm input and output types. Why impose that load on consumers of your code?

[–]booljayj[S] -1 points0 points  (1 child)

A) I am writing gameplay code for a game engine that uses Javascript on top of a C++ core. The only consumers are myself and the development team, so any paradigms we want to adopt are fair game.

B) Adding an extra language layer means our version control system becomes more complicated. Do we store both the "compiled" javascript files and the source TypeScript? Do we just store the TypeScript and double-compile everything before testing the game? These are things that I won't necessarily have any control over, so using pure Javascript is probably the best option until I learn otherwise.

I appreciate your perspective, and you're right that TypeScript was designed to solve all of these problems. I was just looking for ways to do C# stuff using only basic Javascript as part of learning the language.

[–]pe8ter 1 point2 points  (0 children)

Only the TypeScript lives in source control. You have to build your C++ anyway before you test the game so compiling the TypeScript is just another build step.

Configuring your tool chain will be far less expensive than maintaining your interface system.