How do I learn about new languages? — part1

Ganbaru Fumina
5 min readFeb 5, 2022
https://icons8.com/

Intro

I am a hard learner of web development, and I understand I have to keep learning about a lot of new languages since new technologies are moving fast all the time.

Although I know it, I always stack on that at the moment when I try to learn something, like “What should I start from anyway?”

So this time, I’m introducing how I learn new things through my actual learning about TypeScript which is known for being useful for team collaboration.

This article is for people who are beginners at programming and think the way that ‘I’m the only one who can do nothing’ since don’t have confidence. To be honest, I am the one like that, but I try to get confidence so that keep learning my way. I would say, what know about myself always would be the tips over through the tunnel.

With that preamble out of the way, let’s get right to studying together!

Step1: Understanding the philosophy

As you learn, have you ever frozen your brain with “WHY”? I do a lot and I realize I need to understand the core idea first, otherwise, I can’t step over it.

So now let me try to look at TypeScript from the history and the reason of birth.

To begin with, what is about TypeScript?

Long story short, the answer is TypeScript is an expanded function of Javascript. This means TypeScript is basically used the same syntax as JavaScript, so it doesn’t take that much cost to learn TypeScript for the people who know JavaScript.
A major motivation for TypeScript was to make it easier to develop large applications. To deeply understand it, I’m gonna look at the necessity from history.

  • The 1990s: The birth of JavaScript
    At this time, JavaScript is just a supplemental tool for HTML, and the usage is implementing casual animation and using it to validate the form.
  • The early-2000s: The advent of ES4
    In light of the need for JavaScript, JavaScript was formulated under the name ECMAScript, and each vendor implemented JavaScript based on that specification.
    ES4 is a new language specification. and this moment it was debated for ES4 like below,
    — Module
    — Class
    — Static Type
    — Nullable Type
    — Union Type
    — Generics
    but this discussion is canceled in 2008 since Microsoft’s conservative stance pitted against Netscape’s desire to make innovative changes.
  • The mid-2000s: The Impact of Google Maps
    In 2005, Google published the ground-breaking google map which can use without screen transitions, even though many map sites in this age should reload the map when making it move or pinch in/out.
    The core technology for it is AJAX which stands for “Asynchronous JavaScript and XML”. It’s a technology that uses HTTP response by XMLHttpRequest Object, gets the data as XML from the server without reloading pages, and re-wight a part of HTML.
    That shows people even JavaScript can make a respectable web application.
  • The 2010s: AltJS in disarray
    In 2009, CoffeeScript was published as known as simple grammar like Ruby which uses class syntax, but at the same time, it’s slightly different from the grammar of JavaScript. People in this movement think the way is “If JavaScript self is not gonna be better, why don’t we make the new languages can compile to JavaScript?”, and this core idea was the main coding execute to another language, and compile it to JavaScript later. People love it, and these kinds of language were called “AltJS”.
  • 2012: The birth of TypeScript
    Finally, the long-awaited TypeScript was born in a form that captures all of these trends of the times. In contrast to CoffeeScript, which had been the mainstream until the time, TypeScript, which only extended the JavaScript syntax, grew in popularity as it was less expensive to learn and could be implemented quickly even in large-scale development. The core ideas of TypeScript is below,
    — Superset (for JavaScript)
    — Module (can divide code and organize it)
    — Type (can CodeJump, code completion, check the source code before running it)

After publishing TypeScript, JavaScript also keeps maintaining itself, and as you know, we have ES6 now. However, JavaScript still has no ‘Types” which is the most identifying feature of TypeScript. That’s why people prefer to use TypeScript for large-scale development.

And now, I think I’m not the only one who has a question like, “Why TypeScript is needed then?”. In this section, I’m gonna show 4 main reasons should use TypeScript below.

  1. Static check as “Type” (a simpler and safer way to increase maintainability)
    Usually, Javascript checks the type at running the program, which means, we can’t realize whether there’s any error or not until run it.TypeScript can detect any error or type inconsistency before running.
    This means that all defects caused by simple mistakes can be detected in advance by static type inspection and decrease that defective products will be released.
  2. Can start using it if you have knowledge of JavaScript
    TypeScript is the superset of JavaScript and TypeScript is added some new specific functions or benefits to JavaScript, so that the compiler of TypeScript can understand the code of JavaScript. That’s why developers can start learning TypeScript if have JavaScript knowledge. That is a really good benefit for the team to develop a league-scale development since the cost of installation is gonna be small.
  3. Can use even the environment of JavaScript is old
    TypeScript can choose the way to compile to which version of Javascript. It’s not the only reason, but TypeScript is also ECMAScript compliant, so that can use a new function that ECMAScript has accepted.
  4. A well-developed ecosystem
    TypeScript is one of the most well-known AltJS in the world, so there are IDEs that support TypeScript such as VSCode and JetBrains IntelliJ IDEA, and many frameworks and packages also support TypeScript.
    TypeScript is a technology called a “transpiler” as known as CoffeeScript, Dart, and Babel. (Babel is transporting the newest usage of JavaScript to can use in the old environment.)
    These are some keyword of the ecosystem around TypeScript below,
    — module handler: webpack, parcel
    — task runner: gulp, grunt
    — package manager: npm, yarn
    — code formater: Prettier, ESLint

Step2: Practice and Usecase

Now that we understand the whole picture of TypeScript to some extent, I would like to move on to practical use.
When considering the learning curve, I mentioned earlier that it is important to understand the concepts first, but at the same time, it is dangerous to “feel like I understand”, and we may move on to the next learning without realizing it. This means that when we stumble upon something later, we will not be able to easily find where to look back, and we may end up increasing our learning costs.

In this section, I use the youtube video to learn how to code TypeScript and make a simple web application.

To continue to How do I learn about new languages? — part2

--

--