HOW TO USE JAVASCRIPT FOR MULTI PLATFORM DEVELOPMENT

In this post, we are going to talk about the use of javascript for development in all existing platforms.JavaScript is the first class programming language for the web. The popularity of javascript is growing day by day due to the rapid growth of Internet-based technologies.JS is known to be a de facto client-side development language for a long time, but its identity as a client-side only is changing with the development of frameworks like node which made it accessible for development for all other platforms. It has the most vibrant community and having continuous growth with new and exciting libraries coming every day. It has Millions of packages available for developers to reuse by reducing the time in development. After the development and popularity of angular, Javascript has reached to the brand-new level. It reshaped the way how web applications are made and new js libraries started to appear like a bubble. Other frameworks like Vue and React added the extra miles to it. Now the Jquery which ruled the frontend world for many years seems like a virtually dead thing. Frontend development shifted from unmanaged jquery based apps to managed framework based apps making development easier faster and more manageable.

This post is all about how you can use js to become a multi-stack developer, not just a web developer. Multi-stack developer in this post means that you should be able to make an application for all of the platforms out there like android, ios, windows, mac, Linux, embedded devices, gaming consoles, and virtually anything. We are going to summarize this post saying JS is the language to rule them all. There has never been any language which is so versatile and powerful like js which could be used to build any kind of application you want with knowledge of the single programming language.

The possible use case of JS

Till now JS is widely popular as a front end development language. Plain JS, with Jquery is the most used library in the javascript world until the past few years. After the development of Angular, Vue and React, the way how someone builds a javascript related app is completely changed. Tons of features which must have been implemented to the server side has been shifted to front end making it easy and quick. It helped reducing server load as well as exploiting the growing power of client sides computers making the computation distributed and limiting servers resources for the more important task. It also helped to make applications more responsive without having to do multiple reload-refresh cycles with lots of asynchronous operations and AJAX based content loading. With the development and rise of node js, everything is changed.

The node as a rich ecosystem provided an easy way for the developers to reuse the code as packages and it enabled developers to use javascript for making applications not just for web browsers but for desktops too. With the development of several frameworks like Apache Cordova,native-script and react native JS became the common language to develop the cross-platform mobile apps.

Game Development frameworks like unity, cocos2d it made the game developers reuse existing JS skills and code sets to deploy their games across all of the gaming platforms. Libraries like Johnny, five js enabled developers to target their app to the IOT based applications making the JS a great language to rule all platforms and ecosystems.

We can use JS in all of the following platforms,
1. Native Mobile App Development
2. Desktop Application Development
3. Web Frontend Development
4. Web Backend Development
4. Embedded System and IoT applications development
5. Game development

Here we will discuss in detail about the usage of javascript in all different platforms and how can you do that.

1. Web Frontend development

Front end development typically involves writing code for browsers which runs in client computers.Front end development handles all kinds of user interaction to the website making it dynamic and responsive. Although the purpose of front end development remained the same, tools techniques and the way how we create a front end application has been totally changed. Front end development has now become more managed, quick and effective. We can now implement dozens of features in client side without needing to implement that in server sides such as routing, templating etc. using server just for limited tasks such as data manipulation and storage.

We can even build a feature-rich application just using REST API’s, without dealing with much more complexity of backend development. Developing web applications with great interactivity is completely possible with well-managed code. It could be proved by the growing popularity of frameworks such as Vue, Angular and react and their adaptation by .different industries in their enterprise products. At past, jquery helped to streamline the development of interactive applications by providing a quick and easy way to manipulate DOM. But managing large application was still the big challenge back then. Adding more and more separated code base have made the making of large applications really harder. Every problem obviously has the solution, so JS developers found the way to solve that with dedicated frontend frameworks providing data binding, component-based design and routing in its inherent design. This being said, although the JS has been the de-facto language for front end development since its beginning, the way how we use the JS has completely been changed in the past few years.

Now it has become far better than its predecessors.JS is the defacto language of frontend development it will rule this world for a long time from now on because of its wide popularity and compatibility. My preferred choice in front end development is Vue JS which is the greatest framework with the easy and quick learning curve. It’s so easy to migrate your existing web applications to vuejs with far less code and ease of use. It also has a large number of UI and component library such as electron ,bootstrap-vue, vuetify making responsive and modern web applications a lot easier.

2. Web Backend Development

Backend development typically involves writing applications targeted to the server side. Backend development involves implementing functionalities such as authentication, routing, content management, data storage, and retrieval etc.JS is typically a new language in backend development. Only after the development of node and the powerful node frameworks such as express and adonis js, it has become a viable choice for backend development. Node is popular for its speed and performance and inherent asynchronous computation technique, which makes writing real-time based applications like a breeze. Express is the most popular library in JS backend development which makes making REST API’s and routing very very easy and fast. Although node js based backend development is newer compared to other frameworks based on C# and PHP, JS community has created so many the tools and libraries making it a real competitor to the existing frameworks.

One great thing nodejs based backend development is that it is now completely possible to use JS for both backend and frontend of your application making it full stack development tool.
If someone has a skill of JS then he/she could obviously utilize that knowledge for making a complete application just utilizing JS ecosystem.JS based package manager named NPM has millions of packages streamlining your development process making it easy by enabling the reuse of hundreds of existing packages and libraries. It could be said that almost everything you need to implement has been written by someone and has libraries ready to serve you. Tools like yarn and NPM make it too much easier to include external packages in your existing project and build your project. Overall JS is a great tool for backend web development in 2019. My preferred tools are express and adonis js which provides a full experience of Laravel/ROR based ecosystem in js based development.
Some popular backend frameworks in js are Adonis, Express, SailsJS etc.

3. Mobile development

 

Cross-platform development remained a difficult task until the past few years. Writing applications which run on all platforms such as ios and android with single code base have been a very difficult challenge because of huge UI and platform differences among them. This has been solved – previously by utilizing the web view component of each platform and using HTML, CSS, and js to make web-based hybrid apps running inside a sandbox of web component. Although this has made cross-platform development a lot easier it still posed lots of problems such as lack of access to native API’s and device functionality, lack if native looks and feel, and tons of other limitations.
This lead to the rise of native app development, enabling developers to write cross-platform apps with access to devices core functionality and native API’s providing the same look and feel as of its target platform. This made the cross-platform development a viable choice even for companies reducing time and effort to develop applications targeted for each ecosystem separately. In the case of javascript, it is not until the development of frameworks like react native, native-script,weex etc. which made it a real choice for mobile development. Now you can create amazing applications with native API and device access just with javascript. Some popular mobile development framework in js are ionic, React Native, Native script,PhoneGap etc.

4. Desktop application development

Desktop

Desktop development typically involves creating an application for desktop OS such as windows and mac with offline running capability. Unlike web applications. desktop applications could be high performance and access the resources and functionalities provided by OS directly.Java and .NET dominated the desktop application development market for a long time – really really long time. Back past few years, these were the only viable alternative to make an enterprise-grade desktop application.
But its completely changed now because of the possibility of writing high-quality desktop applications with javascript. Although the trend of desktop based application is slowly decreasing in favor of web development its still the choice for many high-performance enterprise applications.
With node js, development of the desktop application is completely possible as it provides the runtime to run node based application on top of the operating system. Some frameworks such as electron js utilize it for building completely native desktop application providing all access the existing JS libraries and native OS functionalities. With these frameworks, you can not just target one platform but multiple desktop OS such as Linux mac and windows with an absolutely similar code base. It also proves API for accessing core desktop functionalities such as file system and system API’s making desktop development with js a good alternative. Desktop application development with JS offers different advantages as compared to others such as rapid development, cross-platform deployment, the rich ecosystem of libraries, rapid build and deployment etc.
Some popular desktop application development frameworks are Electron JS,NW js,Meteor,proton native etc.

5. Embedded System and IOT related Development

iot, internet of things, network
IOT

IOT development involves making an application for the internet of things and embedded systems such as automated devices, smart home appliances, and robots. The day when everything with electrically powered will be connected is not so far away. As most of the IoT devices have limited processing power, development of applications for such device is not so easy compared to other platforms.IOT has gained huge popularity in recent years because of its wide adaptation as well as its huge applications. Development of IOT and embedded system typically involved writing codes in very low-level languages such as C and assembly.
Now with advancement in ULSI and some popular chips like raspberry PI it is possible to get high-performance ecosystem on IoT related devices at low cost and energy usage.
Raspberry PI could even run a Linux based distro on its card sized chip making it a great choice for making embedded systems. Javascript has not been so popular choice for making IoT related application till now. Still, it is not but this doesn’t mean that you can’t use it for development of IOT based applications. There are Tons of awesome framework dedicated to IOT devices. Some frameworks like johnny five, Cylon JS, NodeRed, JerryScript, IOTJS, Node-Red etc are making it development with js a great experience. Do not forget to try nodejs based development for next IOT project or your next robot.

6. Game development

Game development is significantly different from all above because of its inherent nature.Games are typically made for purpose of entertainment.
The game typically requires significantly faster devices with huge processing capabilities. Because of that game development also involves writing high-performance applications in high-performance language.
C++ has been the so popular choice for many years for game development because of its performance and object-oriented capability.
But because of its high complexity, Hard learning curve, and small community its been changing – especially for an indie as well as small game development.
JS has already replaced Actionscript with flash for web-based game development because of html5 and its many new functionalities with the added benefit of not needing any 3rd party plugins. Engines such as WebGL made the development of 3D and highly complex games accessible even in web browsers without having to lose significant performance.JS also made game development easier and faster with many frameworks such as phaser and unity.
One major benefit of JS based web development is that we could target all platforms out there with almost the same code base. If you have good skills in JS you could make any kinds of game you wish targeting platform of your choice with ease. There are tons of game development framework in JS and you could choose any of them based on your skills and need.
You could easily deploy games to the desired ecosystem and testing game is also far easier because you could run js based games in your browser without needing to have dedicated devices. There are tons of libraries specially targeted for game development helping developers to boost performance and reduce development time. Overall we can conclude that JS is a great language even for game development. Some widely popular game development frameworks in js are Unity, Phaser, Babylon, Pixi, play canvas, kiwi etc.

We have covered almost all possible use cases use of javascript in almost all kinds of application development. It clearly means that you can use your existing js knowledge for the development of all kinds of apps targeting all kinds of platforms and ecosystems. Having strong knowledge of JS enables you to be the multi-stack developer who could create anything he likes targeting his choice of platform. With this article, we can conclude that the JS is the language to “RULE THEM ALL”.

Thanks for reading this article. Do not forget to share your thoughts regarding it. Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *