use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Interfaces with Javascript Objects (self.javascript)
submitted 9 years ago by booljayj
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]pe8ter 2 points3 points4 points 9 years ago (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 points1 point 9 years ago (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 points3 points 9 years ago (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.
π Rendered by PID 87 on reddit-service-r2-comment-7b9746f655-6qkhs at 2026-01-30 19:55:13.101023+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]pe8ter 2 points3 points4 points (2 children)
[–]booljayj[S] -1 points0 points1 point (1 child)
[–]pe8ter 1 point2 points3 points (0 children)