loading...

Discussion on: Don't Give Up On Learning JavaScript After Three Weeks

Collapse
blindfish3 profile image
Ben Calder

Typescript is an easier entry point??? What?!

I'm sorry but I have to strongly disagree. Sure, type-checking can help catch some common bugs that trip up beginners; but you have to bear in mind all the additional complexity Typescript introduces:

  • additional setup and tooling required
  • required understanding of types and type definition
  • inferred types are not always appropriate and sometimes need to be overridden
  • compilation introduces an extra step the beginner needs to understand
  • compile time errors mean beginners don't see any result in the browser until they have understood and fixed the error: a potential source of massive frustration

Anyone interested in learning plain JavaScript can get started with minimal effort. Hit F12 in your browser and you can try out JS in the console with literally zero set-up. Make a mistake and you'll see the results of that mistake (be that 1 + "1" = "11" or a console error) instead of having to understand a type-checking error.

But TBH for those really struggling to gain an understanding of programming basics I'd suggest something like Scratch (scratch.mit.edu); since that avoids one very common source of frustration for beginners: the fact that a simple typo or misplaced character can cause your code to break...

Thread Thread
zacharythomasstone profile image
Zachary Stone

Haha true. But I found having type checking to be extremely helpful. And you can easily look up how to set it up. Most, if not all, text editors support it. (Or you can download a package to support it, VS Code detects it and says "want to download the package for TS?"Then you just click yes.

Types and type definitions in my option is easier point of entry to understand than car, let, and const.

I agree on the inferred types.

I agree on the compilation, but again.. with text editors you can set this up easily with a guide.

And yes, no results can mean a headache but on the flip side.. seeing results and not looking for errors begginers can think they didn't something correct when they did not at all.

Truth is, I feel like Typescript is an easier entry point because I learned C# first. I mentioned that in a nother comment and should of explained that in my comment you replied to.

I do recommend if you have little to no experience to try out an easier programming language, especially if nothing in JS is sticking.