5
$\begingroup$

At my school the students learn some very basic javascript, and a while ago it was decided to expand on that (by teaching nodejs).

by "basic", I mean that we only teach html manipulation through JS.

We have two options for going about it:

  1. Just teach javascript (es6 modules included)
  2. introduce TypeScript and all that comes with it.

This decision is important because of the students familiarity with java. TypeScript offers more similarity to Java (what with it having, em, types, and all), but it is more complicated to teach than just sticking to javascript.

This decision is influenced greatly by the fact that the students are familiar with Java, which means it has to be a big factor in the choice we make.

Naturally, no method is "better" than another, but some methods would teach the students valuable skills.

So, which skills (and how significant are those skills) would the students learn, should we teach with typescript, instead of just javascript?

$\endgroup$
1
  • 3
    $\begingroup$ I wonder whether your primary mission is to create scholars or professionals. Are you mostly getting students ready for university or for jobs in industry? I think those sorts of overall goals should have a strong influence on what you do. $\endgroup$
    – Buffy
    Commented Sep 27, 2017 at 14:14

2 Answers 2

3
$\begingroup$

You mention that you are already using ES6, which suggests that package management and complication are not really barrier, though I would expect that many reading this problem are not setup to ensure node and npm are installed and/or may have access to git/ssh protocols for fetching dependencies or projects. So, the first thing I'd point out is that for some readers, compiling TypeScript could be a barrier that reduces is teaching value.

The second and more relevant point is that JavaScript is dynamically typed language. There is value in tools like Flow and TypeScript, especially in production systems, but there is also a great amount of value learning how to program in a dynamic type system. If you're already teaching Java, there are few better choices to teach strategies, advantages and disadvantages to dynamically typed systems. Some students will prefer that type of programming over strictly typed languages.

$\endgroup$
2
$\begingroup$

To be fair, TypeScript is promoted by Microsoft. That means, it has excellent intellisense support along with type checking and all the other standard stuff (regularly updated with bug fixes, premium support, dedicated team and of course the huge marketing muscle of a huge tech giant) we can expect.

However, the thing is, Javascript is simply far more popular. There are more resources and stack overflow itself has like thousands of questions on that. Almost every web app and web site I can think of uses JavaScript at some level. I cannot say the same for TypeScript. If anything, I have not seen it being used either academically or at workplaces.

I would say, if you are already onboard with JavaScript, stick with it and avoid TypeScript. Further, if you really want to add something on top of JavaScript, I would suggest you use jQuery (which is used almost as widely as Javascript) and is actually useful to build stuff.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.