/ Programming

5 top programming languages to learn server-side web development

This 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. The language is just for you to grasp the concept of programming. Anything you write in the beginning you will most probably write in again, probably in another language.

That is great news as 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 can be done in a language can usually be done in another. So just chill out and have fun!

1. Node.js (JavaScript)

Node.js is the newest in the list and the fastest growing today. Released in 2009, it is used to run JavaScript code on the server-side. The great thing is that you do not have to learn a new language for back-end development. The JavaScript that you use for front-end rendering can also be used in the back-end.

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

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.

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. The reason is that it was the first programming language that was designed for the web leading to its dominance in the Web 2.0 era of the 2000s. It is used for the Wordpress platform which powers 25% of websites today including most popular blogs and news sites. 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 the logic is written in the HTML code and how the HTML is generated by your server is based on the logic that you program. That is a pretty neat feature that makes it easy for you to write.

Notable websites built on PHP: Facebook, Wikipedia, Wordpress.

3. Java

Java is another popular language that is used in many major websites. However, it is overkill for many small applications that can be done with something much simpler. It is used in many large enterprise applications in banks and insurance companies that communicate with other systems such as mainframes. It is also very powerful in terms of scalability but 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 framework for Java web applications is usually considered an essential in a Java web developer's toolbox. It is a good 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 very popular for large-scale application but you should consider other languages for smaller applications.

Notable websites built on Java: Google, Amazon, eBay.

4. Ruby

Ruby is largely 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 rapidly build and go to market. However, for learners, I would recommend against it for a smaller framework.

#!/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 for 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.

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.

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 been proven to work with many popular websites built on them. Therefore, pick one you like and stick with it, 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