Learning TypeScript

Started by
6 comments, last by 8Observer8 2 years, 3 months ago

Hello, everyone! I am getting focused on Javascript, React, CSS, and Typescript. My question is, “what type of process should I use to include typescript with my learning?” Thanks!

Advertisement

As you on GameDev forum you should write games using TypeScript for practice with it. You can use Canvas API (or pure WebGL) or graphics engines like: Phaser (2D only), Babylon.js, Three.js, PlayCanvas and so on. Babylon.js was written in TypeScript. Make small games like this 2D breakout game using pure JavaScript and Canvas API I prefer pure WebGL. My favorite book is WebGL Programming Guide. Matsuda & Lea Use the glMatrix library for linear algebra and Ammo.js (or Cannon.js, Planck.js) for Physics

How to draw a cube in TypeScript and WebGL:

You can use my example for loading 3D-objects from DAE format with Physics in Cannon.js in JavaScript:

Wow, outstanding, you have really progressed! As far as JavaScript is concerned, React really does seem to replace it. So, I am wondering if TypeScript Replaces or is replaced by React, too. What do you think?

Josheir said:

As far as JavaScript is concerned, React really does seem to replace it. So, I am wondering if TypeScript Replaces or is replaced by React, too. What do you think?

You are comparing apples and oranges. React is a framework for writing reactive UIs. JavaScript is a language that runs natively in a web browser. TypeScript is a type layer that has been added on top of JavaScript to avoid type errors but it's not a programming language in itself. Your question is basically the same as asking if C# is replaced by Unity. It doesn't make sense.

fleabay said:

That's like saying that C++ isn't a programming language because it just adds OOP (mainly) on top of C.

I'm just trying to correct OP's misunderstanding with the correct definitions. C++ is almost a superset of C whereas TypeScript is a superset of JavaScript. C++ compiles to machine code whereas TypeScript compiles (or transpiles as they say) to JavaScript. I think the second point really makes a difference.

That said, I have nothing against someone calling TypeScript a programming language.

I think it is wrong to say that TypeScript is not a programming language.

Wikipedia:

TypeScript is a programming language developed and maintained by Microsoft.

https://www.typescriptlang.org/

TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.

This is my template in TypeScript that shows how to write unit-tests with mocks and spies: https://github.com/8Observer8/person-service-mocha-sinon-ts​ I wrote a short instruction in the README.md file. You can use Test-driven development:

Test-driven development (TDD) is a software development process relying on software requirements being converted to test cases before software is fully developed, and tracking all software development by repeatedly testing the software against all test cases. This is as opposed to software being developed first and test cases created later.

This topic is closed to new replies.

Advertisement