Why Javascript is called lightweight

Why Javascript is called lightweight

As per MDN definition,

JavaScript is a lightweight, interpreted, or Just In Time compiled programming language.

Javascript is famous among developers for many of its advantages, features. So this series is to list out and explain each feature of this programming language. So we will start with one of main feature of Javascript of it being a lightweight programming language.

So what does it mean?

Lightweight programming languages are those which are designed

  • to consume minimal memory resources when its code or an application is running.
  • to ease the implementation across platforms such as web, mobile, desktop etc.,
  • to have a minimalist, simple syntax, semantics to help in learning quickly.

So, how does Javascript fits into this bill?

Javascript is a single threaded language & following asynchronous execution of the code. It makes applications to consume less resources than other language implementations. It runs on browsers without any dependency, which can demonstrate how efficient the language is. With each new standard of ECMAScript(a Javascript standard meant to ensure the interoperability of web pages across browsers), new features are baked into the language so the users need not write any new code making it leaner on the resources.

Javascript, no matter which it runs on does not need any modifications in the code. The same application can be executed on browsers, mobile platforms, desktop & many systems. This makes Javascript the first choice to build any application for developers across the world.

Javascript has minimal set of language constructs, which can be leveraged to handle any requirement for a given application. It uses dynamic typing where the types of variable are assigned at runtime based on its value. Everything is an object in javascript, so with every variable declared lot of built in options & operations are made available to consume. With so many things taken care under the hood, the developer needs minimal effort on learning the language & can focus more on building the application.

Hope it helped you understand why Javascript is lightweight. Please share your thought.

Follow me for more interesting post on Javascript & web development. Also, please give a follow on twitter.