/ Programming

5 top programming languages to learn server-side web development

This guide is the beginner's introduction to programming languages and frameworks that they can learn for server-side web development and part of a continuation of How to learn web development for a complete beginner. These server-side programming languages are the most popular and have large communities behind them, making them great for most people to learn. I will briefly introduce you to the different server-side technologies to help you decide on one to learn based on your needs and preferences.

It doesn't matter, seriously

Before moving any further, do note that whatever you choose to learn, it doesn't matter that much in the end. Learning a language is not the same as learning programming. Learning a programming language is a way to grasp the concept of programming. Anything you write in the beginning, you will most probably write in again, perhaps in another language.

That is a good thing as it means that you do not have to be overwhelmed by the number of languages there are. Just pick one for now and stick to it, then learn another. Almost about 95% of what you can do with a programming language, you can usually do it in another. So don't worry about it and have fun learning.

1. Node.js (JavaScript)

Node.js is the newest in the list (released in 2009) and the quickest growing today.  It provides the ability to run JavaScript code server-side. The great thing is that you do not have to learn a new language for back-end development. You can use JavaScript for front-end rendering and then reuse it later in the back-end, which is one of the key benefits to writing JavaScript.

One thing that Node.js does very well compare to most other languages is real-time applications as they developed it with that in mind. Therefore, if you are developing something that required to work in real-time such as chats or games, then this is an excellent place to start. As it is also newer than the other languages, it comes with some handy and modern features that are lacking in older programming languages that make development smoother, such as the default package manager NPM that comes with it.

const express = require('express');
const app = express();

app.get('/', (req, res) => {
    res.send('Hello world!');
});

Express is a popular web framework that you can use to help you develop Node.js web application. To get started, I recommend you explore the basics of setting up a Node.js then move on to learn Express.

Learning points: Good for real-time applications, one language for web front-end and server-side back-end.
Notable websites built on Node.js: PayPal, Uber, LinkedIn, Netflix.

2. PHP

PHP is by far the most used server-side scripting language. Just above 80% of websites are running on PHP. It was the first programming language designed specifically for the web, and that lead to its dominance in the Web 2.0 (blogging, content creation) era of the 2000s. Furthermore, Wordpress runs on it and powers 25% of the websites today, including most popular blogs and news websites. Therefore, if you are looking to create content-based web pages, there is no more proven method.

<!DOCTYPE html>
<html>
    <head>
        <title>Wei-Ming's blog</title>
    </head>
    <body>
        <h1>Welcome</h1>
        
        <?php
        $t = date("H");
        
        if ($t < 12) {
            echo '<p>Good morning!</p>';
        } else {
            echo '<p>Good day!</p>';
        }
        ?>
    </body>
</html>

Assuming you are familiar with HTML, PHP code is embedded into your code like above, where you can write the logic within the HTML code. The way your server generates the HTML depends on the logic that you program. That is a pretty neat feature that makes it easy for you to write.

Learning points: Very widely used, simple, and easy to learn.
Notable websites built on PHP: Facebook, Wikipedia, Wordpress.

3. Java

Java is another popular language that many major websites use. However, it is overkill for many small applications where you can achieve the same result with something simpler. Many large enterprise applications such as those in banking and insurance use it to communicate with other systems such as mainframes. It is powerful in terms of scalability. However, that is more of something to worry about down the line.

package me.twm.app;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.ui.ModelMap;

@Controller
@RequestMapping("/hello")
public class HelloController {
   @RequestMapping(method = RequestMethod.GET)public String printHello(ModelMap model) {
      model.addAttribute("message", "Hello World!");
      return "hello";
   }
}

Spring is one of the most popular frameworks for Java web applications and is usually considered essential in a Java web developer's toolbox. It is an excellent framework to start with once you have picked up on Java and its concepts. However, development with Java can be overengineering, and development time can take considerably longer than other languages. It's worthy of a mention as it is prevalent for large-scale applications, but you should consider other programming languages for smaller applications.

Good for: Enterprise, performance (compared to others on this list)
Notable websites built on Java: Google, Amazon, eBay.

4. Ruby

Ruby is mostly popular for small applications as it is suitable for rapid web development. Rails is the most popular framework to use with Ruby. It is a latecomer compared to some of the other languages and became popular more recently, starting 2010s. It is adopted by a lot of startups today that wish to build and go to market rapidly. However, for learners, I would suggest starting by learning a smaller framework to get a better feel of what goes into an application stack.

#!/usr/bin/env ruby
require 'sinatra'

get '/' do
  redirect to('/hello/World')
end

get '/hello/:name' do
  "Hello #{params[:name]}!"
end

I would recommend a framework like Sinatra for beginners. Ruby on Rails philosophy of convention over configuration makes it great for development and teams but not for learners as it does a lot of things under the hood. Sinatra requires more focus on details, but not too much. I generally advocate micro-frameworks to learners for that reason, and it will help you much more in the long run.

Good for: Developing applications fast (not fast applications)
Notable websites built on Ruby: Twitter (in the early days), GitHub, Groupon, Airbnb.

5. Python

Python is one of the best programming languages for beginners, not just for web development, but also to learn to program. It is a language that has clear and easy to read syntax that makes it easier to focus less on syntax and more on learning to program. It is also one of the most popular languages used for statistical analysis.

from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()

Flask is a popular micro-framework for Python to create web applications. It's a small framework that provides you with the necessary features to get started with developing your web application. Another popular framework is Django. However, I would also still recommend new learners to try out the smaller framework.

Learning points: Simple syntax and has a vast collection of AI/Analytics libraries.
Notable websites built on Python: Youtube, Instagram, Dropbox, Quora.

Conclusion

There you have it! These are the five most popular programming languages along with frameworks for web development that you can explore. As I mentioned before, your choice wouldn't matter at the start as you'll learn a lot about programming whichever you choose. All of them have proved to work with many popular websites built on them. Therefore, pick anyone that you like and might better suit your needs, and have fun learning!

Wei-Ming Thor

Wei-Ming Thor

I am a programmer based in Kuala Lumpur, Malaysia. I write guides on programming and running a software business.

Read More