Introduction to JavaScript - AkuCode

    JavaScript is one of the most popular programming languaes in the world, and now widely used also outside of the browser. The rise of Node.js in the last few years unlocked backend development, once the domain of Java, Ruby, Python, PHP, and more traditional server-side languages. Learn all about it !

    JavaScript is one of the most popular programming languages in the world. Created 20 years ago, it’s gona a very long way since its humble beginnings. Being first – and the only – scripting language that was supported natively by web browser, it simply stuck. In the beginnings, it was not nearly powerful as it is today, and it was mainly used for fancy animations and the marvel knows at the time as DHTML.

    With the growing need that the web platform demands, JavaScript had the responsibility to grow as well, to accommodate the needs of one of the most widely used ecosystem of the world. Many things were introduced in the platform, with browser APIs, but the language grew quite a lot as well. JavaScript is now widely used alo outside of the browser. The rise of Node.js in the last few years unlocked backend development, once the domain of Java,Ruby,Python and PHP and more traditional server-side language

    JavaScript is noew also the language powering databases and many more applications, and it’s even possible to develop embedded applications, mobile apps, TV sets apps and much more. What started as a tiny language inside the browser is now the most popular language in the world.

A basic definition of JavaScript

JavaScript is a programming language that is:

  • High level: it provides abstractions that allow you to ignore the details of the machine where it’s running on. It manages memory automatically with a garbage collector, so you can focus on the code instead of managing memory locations, and provides many constructs which allow you to deal with highly powerful variables and objects.
  • Dynamic: opposed to static programming languages, a dynamic language executes at runtime many of the things that a static language does at compile time. This has pros and cons, and it gives us powerful features like dynamic typing, late binding, reflection, functional programming, object runtime alteration, closures and much more.
  • Dynamically typed: a variable does not enforce a type. You can reassign any type to a variable, for example assigning an inteer to a variable that holds a string.
  • Weakly typed: as opposed to strong typing, weakly (or loosely) typed languages do not enforce the type of an object, allowing more flexibility but denying us type safety and type checking (something that TypeScript and Flow aim to improve)
  • Interpreted: it’s commonly knows as an interpreted language, which means that it does not need a compilation stage before a program can tun, as opposed to C, Java or Go for example. In practice, browsers do compile JavaScript before executing it, for performance reason, but this is transparent to you: there is no additional step involved.
  • Multi-paradigm: the language does not enforce any particular programming paradigm, unlike Java for example which force the use of object oriented programming, or C that force imperative programming. You can write JavaScript using an object-oriented paradigm, using prototypes and the new classes syntax. You can write JavaScript in functional programming style, with its first class function, or even in an imperative style (C-like).

In case you’re wondering, JavaScript has nothing to do with Java, it’s a poor name choice but we have to live with it.