React is a frontend library, which runs in the browser. Like any other frontend library (jQuery, etc.), it is happy to be served by any kind of backend.

You could be using Python/Flask, Ruby on Rails, Java/Spring, PHP, etc. It doesn’t really matter. If your backend is not JavaScript/node, then your frontend can’t be integrated as tightly with it. This is 100% OK. In fact, it’s great! You’ll never have to wonder what environment your JavaScript is running in – it all runs in the browser.

backend languageThere are lots of things to consider before everyone gets into back-end first time, but the most important thing is you need to love the language that you’re going to develop. Node.js is a fast language but that doesn’t mean Python isn’t or PHP isn’t.

Performance is up to you as well, in the end, know that. If you need something really fast then pick a language fits your needs. Depends on what it is you want to do, mostly.

Every Back-end languages have their own pros and cons. So choose one comes down to individual’s own preference and coding style.

Here are some languages you can go for depending on the type of application you are building.

  1. PHP

phpNo matter how many people hate PHP, it still is one the most used languages on the internet. Don’t listen to people who say PHP is a terrible language. It works and is tried and true. And if you are just beginning and want to get a project quickly up and running, Go for PHP!

Pros

  • Widely used for websites

PHP is the quasi-standard for backends for web applications and used by most of all websites. Many popular CMS are built with PHP, e.g. WordPress, Drupal, and Joomla.

  • A huge community of practice

Whatever challenge you face, you can Google it and find existing code that solves it. Well supported packages, objects, and methods exist for data manipulation, graphics generation, file handling and connecting with diverse APIs.

  • A lot of good frameworks for it

Like Laravel, Zend, Symfony…

  • Tight and easy integration with HTML

Unlike some languages, PHP is designed to work as part of an HTML file, and moving in and out of straight HTML and PHP is simple and seamless. If you’re familiar with HTML, adding simple PHP gives you access to creating dynamic pages and sessions very easy. You have easy and logical access to headers, session variables, cookies, GET and PUT information and files.

  • Thousands of tutorials and courses to get you started quickly

There are thousands of tutorials available and most online course providers offer PHP courses too. Learning the language will not fail because of missing reading.

Cons

  • Very slow compared to alternatives

Compared to alternatives like Exilir and Go-lang, which provide comparable functionality, even the latest versions of PHP are vastly slower than their competitors. The difference is so significant that it has the potential to bottleneck even modestly sized applications and lead to highly significant increases in hardware costs, even with the well-written code. PHP’s syntax is also highly permissive of non-optimized code which can further exacerbate this issue.

  • Ugly syntax

The naming of string and numerical functions are awkward, frequently inconsistent and impossible to memorize – you will always need a handy cheat sheet.

  1. Python

If you are planning to build an application that would produce tons of data and you may want to apply further AI Magic on it, go for Python. Best choice.

Pros

  • Easy to learn 

Python has simple to learn syntax which helps beginners to utilize this programming language and has support guide available.

  • Lots of tutorials

Python’s popularity and beginner friendliness have led to a wealth of tutorials and example code on the internet. This means that when beginners have questions, they’re very likely to be able to find an answer on their own just by searching. This is an advantage over some languages that are not as popular or covered as in-depth by its users

Cons

  • Slower than alternative languages

Compared to alternatives such as C++, C#, F#, Elixir/Erlang or Go, Python can be sluggish and is often not a good choice for applications where performance is a significant concern.

  • Not type-safe

For back-end system development, strong static type checking is extremely important. Without strong static type checking, errors that could have been detected at compile time won’t show up until runtime, which could have disastrous consequences.

  1. Go Language

Go language is the most in-demand new language of 2017. And because of its speed, a lot of companies dealing with heavy data and high information transaction have switched from python to Go. And if you wanna become a trendy developer, Choose Go!

Pros

  • High-level programming language

It makes it easy to learn and the learning curve is friendly for beginners.
One can learn the main concepts and ignore unimportant details.
While in low-level programming languages, like C, one should spend a lot of time on low-level details even when developing very basic (web) service.

  • Great runtime performance

GoLang is compiled language, so it is expected to run faster than interpreted language.
GoLang programs may run as fast as ones are written in Java.
It is just a matter of time when GoLang compiler will beat Java and will compete with C/C++.

  • Support of OOP and duck typing

Interface based polymorphism and structural compatibility of interfaces make it easy to extend the system/application, to reuse the code and to refactor.
Basically, it allows building less coupled architecture.

The OOP support is very simple compared to other OOP languages like Java/C++. It is relatively easy to understand and it almost does not have surprises. OOP in GoLang is a combination of two clear concepts: structs and interfaces. Structs can be just composed, while interfaces define behavior. It is not only very simple approach but actually very right implementation of polymorphism. In other languages, it will take a lot of time to a beginner not only to learn OOP support but also (what is even more important) to learn how to use it and when not to use it.
GoLang encourages to use OOP in more right way.

Having the minimal and clear concept of OOP, it also makes it very powerful tool of creating abstraction, sometimes it is even more powerful than in C++/Java.

  • Green threads and channels builtin

The system can easily support tens of thousands (user-space) threads, which can communicate and being synchronized using channels.
This makes it easy to design a system consuming multiple cores (and being scalable) or making asynchronous I/O.
Scalability and asynchronous processing are very important property of systems.

Simplicity of working with threads and channels is very important for beginners.

  • Large community

The community is large enough at this point that there are plenty of resources on the web for learning, asking questions, and interacting with many other Gophers.

Cons

  • No user defined generics

This means that you can utilize strong typing only as long as you do not need a generic container like for example list. Only ways to deal with it is either code duplication or using interface{} which means that you lose strong typing.

  • Default package manager doesnt allow versioning of libraries

This means that when using go get we will always fetch HEAD of remote repo. There are however 3rd party solutions for that problem like repository hacks and managers that tries to mimic lock file.

  • Default package manager doesnt allow multiple versions of the same package to be used at once

Default package manager fetches all packages to $GOPATH and uses them across all projects which mean that 2 projects cannot use different versions of the same package. However 3rd party solutions exist. This has been solved with the dep tool and semver.

  • Initial setup of working environment is nontrivial

We need to set up some environment variables ($GOPATH and adjust$PATH at least). However, in most cases, it is one-time setup.

  • Default package manager doesnt allow versioning of libraries

This means that when using go get we will always fetch HEAD of remote repo. There are however 3rd party solutions for that problem like repository hacks and managers that tries to mimic lock file.

  1. Node.js

If you are making something more for a portfolio or learning purposes, go for Node.js. It is really popular with some really good advantages and has tons of Job opportunities. And with a huge community on stack overflow, you would not feel stuck anytime.

You won’t take too long to learn in case you already have a good knowledge of Javascript – by learning this you won’t have to learn a new language.

NodeJSNode.js – Relatively new as compared to veterans like Rails, Spring, Django etc. But written in famous JavaScript. It is considered ideal Backend framework to work with your front end. It’s the fastest framework out there. It is versatile and interacts well with your front end. But it’s kinda incomplete without Expressjs and other tools. But its bright future is still to be witnessed. Want to become a full-stack developer? Node.js. Combining with all the tools, it’s lethal, sexy and powerful.

Pros

  • Easy to Learn

According to Node.js’s 2016 User Survey Javascript is one of the most popular programming languages for front-end development. Nearly every front-end developer is familiar with this universal language. Therefore, it is much easier for them to switch to using Node.js at the back-end. It requires less effort and less time to learn and work with, even for a junior Javascript programmer.

  • Freedom in Building Apps

While Ruby on Rails is a framework that imposes rules and guidelines of developing software in a particular way, Node.js gives you much more space and freedom in doing it your own way. Node.js is completely unopinionated, meaning you start building everything from scratch. It can execute basic tasks, but gives you only the bare minimum from a fresh install, making it less restricted.

  • Fullstack JS

Before Node.js, Javascript was only used for client-side development. It was necessary to use a different server-side programming language. In practice, you had to hire separate devs for backend and for frontend. With a growing popularity of Node.js fullstack JavaScript became a reality. Nowadays it is possible to write both front-end and back-end of web applications in Javascript, making app deployment much easier and more efficient.

  • Active Community

The Node.js developers’ community is a very active and vibrant group of developers who contribute to the constant improvement of Node.js. Thanks to the cooperation of JavaScript programmers and their input to the community you get access to a ton of ready solutions, codes in Github and many more possibilities. Even though it is still at a relatively early stage of development, the community is dynamically evolving and its members go the extra mile to provide others with best and reliable solutions.

  • Simultaneous Request Handling

Node.js provides the non-blocking IO system that lets you process numerous requests concurrently. The system makes simultaneous request handling much better than in other languages like Ruby or Python. Incoming requests are queued up and executed sequentially in a fast manner. In effect your app will take up much less system RAM, achieve high scalability levels and in a result will perform faster.

Cons

  • Unstable API

One of the biggest disadvantages of Node.js is that it lacks consistency. Node.js’ API changes frequently, and the changes are often backward-incompatible. When this happens, programmers are forced to make changes to the existing code base to make it compatible with the latest version of the Node.js API.

  • More Development Time

The fact that Node.js is unopinionated can also be seen as a drawback by some developers. Ruby on Rails provides you with a lot of directions from a fresh install and guides you into their way of doing things, but with Node.js you basically need to write everything from scratch. It might result in a decrease in productivity, slowing your work down. However, if you cooperate with an experienced team of programmers who have internally developed good processes for developing and maintaining code, you do not have to worry about efficiency.

  • Not Suitable for Heavy-Computing Apps

Node.js doesn’t support multi-threaded programming yet. It is able to serve way more complicated applications than Ruby, but it’s not suitable for performing long-running calculations. Heavy computations block the incoming requests, which can lead to a decrease in performance.While Node.js is perfect for complex apps, in the case of software which requires some heavy-computing it might perform less effectively.

  • Immaturity of Tools

Even though, the core Node.js is stable, many packages in the npm registry (pre-installed node package manager that organises the installation and management of third-party Node.js programs) are still of poor quality or have not been properly documented. As it is mostly an open source ecosystem, numerous tools have not been supervised and so they might lack the quality and fail at meeting coding standards. The npm’s structure makes it harder to spot reliable packages. Therefore, you might need more experienced developers who can find tools that can be trusted.

  • Wrap-up

Node.js is still an immature environment in many aspects and it is likely that many programmers won’t find it useful in their projects yet. However, there are many cases in which Node.js might prove to be much more efficient. Numerous companies have trusted Node.js in production of their applications and they’ve already experienced positive results. It is definitely worth following their example and trying to identify which of the problems you have can be solved with Node.js. Effects might outgrow your expectations.

References:

  1. Why to Use Node.js: Pros and Cons of Choosing Node.js for Back-end Development: https://buff.ly/2FzWeuN
  2. What is the best programming language to learn for backend developers?: https://buff.ly/2Gs2e6i