DEV Community

Kevin Woblick
Kevin Woblick

Posted on

Which backend programming language should I choose?

PHP and Javascript are my current tools as a web developer. I made some first steps with Python and. Ruby, but did not use it for a real project yet.
There is nothing wrong about PHP or JS, but I would like to learn a new programming language primarily focused on the backend. The problem is that I am not entirely sure which language to pick. That's why I am asking you for advice.

The language I would like to learn should mostly be used to craft backends for all sorts of websites and services: from "simple websites" with contact forms and so on, up to large SaaS products with a broad range of capabilities. It should be easy to start with but powerful enough to handle critical workloads. Ideally, it has mature frameworks which provide a solid base for things like user auth, ORM and database handling.
Also,it should be future proof, meaning no declining but raising usage.

The languages which seem most appropriate are

  • Python
  • Ruby
  • Go
  • Kotlin/Java.

The languages in detail

The following list contains some assumptions about the languages. I hope that some could verify or correct them if wrong. :)

Python is one of the most popular languages and is known as a universal language for programming in all sorts of fields, and became quite popular in the AI sector. It has popular frameworks for the web environment. A large con is that it's dynamically typed.

Ruby is used by many top web services such as Github or Stripe. From what I heard a lot of people swear on Ruby. I already worked with Rails a bit and it really is a great tool.
On the other hand I read some comments that it's kind of a dying language because it never had a large market share and now others take over.

Go is kind of the newcomer on the block. I heard a lot of good things about it because it was created to be used for the web, has a strict type system and should be easier to learn. Con seems to be the rather small usege at the moment. I did not find many job offers for it.

Last but not least, Java, or the more modern Kotlin. Java always was an "enterprise language" for me and feels rather slow and bulky, although it's used in many high-class systems.
I am not sure about Kotlin. It looks modern and like a nice evolution of Java, but I did not find many job postings for it.


What do you think about all these modern languages? Which one should one pick if starting fresh into the web programming business and what would be the most important selling point?

Or do you have other suggestions in mind?

Top comments (35)

Collapse
 
pradosh987 profile image
Pradosh Gaonkar

Typescript is as a language great one, you should consider it.,

My choice of language is Ruby and Typescript. Java is great but it's development is quite slow, Scala is awesome too. I have heard good things about Golang, but in my perspective go has ignored all new innovations in languages designs that has taken place in last few decades just to make it simple.

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

Starting fresh? Go is almost certainly your best bet. It's not quite as marketable right now as some of the others, but it's also quite simply the best option out there. In particular:

  • It actually makes good on Java's old 'write once run anywhere' mantra, to the point that you can cross build for any supported platform from any supported platform. Got an ARM-based Linux server for deployment, but only have macOS for development? No problem, Go will spit out binaries for whatever platform it supports that you ask it to. Originally developed for FreeBSD running on a POWER9 system but need to switch to Windows running on x86? No problem, just update GOOS and GOARCH in your build system and almost everything is taken care of automatically.
  • The programming paradigm is designed for backend work. It's got basic networking, concurrency, and parallelization support built in in a way that makes all of it dead simple to use.
  • Deployment is insanely easy. Unless you're using odd configurations, go build will spit out an entirely self-contained static binary for whatever platform you're building for. Just copy that in, make sure all your static assets are in the right place, and start it.

You're right that there aren't as many job offers for Go developers, but a significant part of that is the fact that there's almost no legacy code written in Go (unlike every other language you listed except Kotlin).

Collapse
 
yashraj021 profile image
Yash

What about JavaScript? Express.js I mean.

Collapse
 
kovah profile image
Kevin Woblick

That's some great details about Go. Will definitely take a closer look into it.

Collapse
 
rhymes profile image
rhymes

Which one should one pick if starting fresh into the web programming business

I think if you want to develop web apps you should aim for Python or Ruby. Go is great but I think the developer experience of tools like FastAPI/Flask/Django (for Python) and Rails for Ruby is better than Go's frameworks.

What are you trying to achieve?

Collapse
 
kovah profile image
Kevin Woblick

Thanks for your first impressions. I updated my post with more information about my intentions.

Collapse
 
rhymes profile image
rhymes

Thanks Kevin!

The language I would like to learn should mostly be used to craft backends for all sorts of websites and services: from "simple websites" with contact forms and so on, up to large SaaS products with a broad range of capabilities. It should be easy to start with but powerful enough to handle critical workloads. Ideally, it has mature frameworks which provide a solid base for things like user auth, ORM and database handling. Also,it should be future proof, meaning no declining but raising usage.

I still think my initial recommendation is somewhat valid. You designated Ruby as a dying language and though it's not strictly true, it is true that its adoption is not at the "top of the charts".

Rails is still a solid choice that many companies still make from scratch in the last few years. You wouldn't be wrong picking that: Shopify is probably the poster child of large scale Rails deployment and they have written extensively about how to scale a Rails app.

Python has many examples of large scale web apps deployments (Pinterest, Quora, Instagram's website, The Washington Post). That happens because in web apps, in most but not all cases, the language "speed" is not the bottleneck as most operations are I/O bound and you can deal with those however you choose: single or multi-threaded, async, parallel processing and so on.

Even in the case of numeric computing (so being CPU bound), you can skirt the limitations of languages like Python using tools like NumPy/SciPy/PyTorch as Python can easily call low level code written in other languages.

I personally think investing in Python, starting from scratch, is a tiny bit more flexible of a choice than picking Ruby (whose alternatives for numeric computing and ML have vastly smaller communities). It still doesn't mean that picking Ruby and Rails is a bad choice, the size of the Rails community and projects like Ruby 3x3 are a testament that "Ruby is dead" is a false claim. We use Ruby everyday at DEV and I can assure you it's actively developed :-D

Setting Python and Ruby aside, as I mentioned in the previous comment, I do like Go very much but its "raw numbers" are a bit of an arbitrary reason for picking it. They can't be the only metric: the developer experience, maturity of tools, flexibility of language and many other things have to factor in. Go's "web applications" community is not that big, most people use it to build APIs or microservices in my opinion but I wouldn't write a traditional web app in it. It'd be way faster to build it with richer dynamic languages like Python/Ruby. Go's huge advantage is the single binary deployment, which is nothing new in the history of computing but it's a welcome "come back" as we've all gotten used to scripts that have deploy thousands of files before you see your updates in production :-D

Maybe you can pick a tutorial for FastAPI or Flask (Python) and Beego or Buffalo (Go) and go through it and see what your feeling is.

Just know there's no inherent wrong choice here :-)

ps. I didn't mention Java or Kotlin because I know absolutely nothing about them, or at least nothing that's not probably obsolete knowledge :D

Thread Thread
 
kovah profile image
Kevin Woblick

Thank you very much for this detailed writeup. Will definitely keep those points in mind, and going through actual tutorials might be the best idea to get a first feeling for the options.

Collapse
 
gilesc9 profile image
Giles • Edited

If you're looking at Java I would definitely look at .Net Core and C#. I use it at my work place and we build SaaS platforms and Web applications using either MVC or Angular for front end. You can get various powerful ORMs such as Entity Framework which allows for code first database development. And it can be deployed anywhere. As for Auth you can take a look at Identity Server 4, which has been written in C#.

Collapse
 
patroza profile image
Patrick Roza • Edited

The perceived speed of all those frameworks in the various languages is imo just a dream, a balloon that will eventually pop.
Sure they may seem to get you up and running quick, but you also inherit all the baggage, lock you into a certain way of thinking, and eventually lead you to run into the limitations. The plugins will rot over time, major framework updates will cause major upgrade pains, often leaving you stuck on the old versions for far too long, and everything that made you fast at the beginning now slows you down.

I do however think they're fine for prototyping some stuff quickly, to find out what you want and need, in the exploratory phase.

Don't get locked into framework prison. Like Uncle Bob advocates in Clean Architecture, such delivery mechanism frameworks just become some detail at the edge of your app.
Don't learn frameworks, but learn patterns, and know when to apply them.

I would suggest to roll your own framework or set of tools, based on low-level libraries, instead of high-level frameworks. It will pay off, in my experience.

Build something with Scala's ZIO, or Typescript's @matechs/effect, or Kotlin's Arrow-fx, for example. Would be my suggestion. But if you don't want to go the functional direction, the same rules apply; gather the libraries and tools that you need, try to steer clear of frameworks.

Collapse
 
daviddecervi profile image
Dave Cervi

Kotlin is awesome! I have been using it for a couple of years now in production and is just a joy to use.

It also does not have some of the craziness of Scala that is best left for academia IMO. Just think of it as what Java would look like if it were written today (null safety built into the language, no checked exceptions, local type inference, immutable data classes, etc.)

Kotlin's interoperability with Java is also excellent, and therefore you can easily call out to third-party libraries that are written in Java.

Collapse
 
elmuerte profile image
Michiel Hendriks • Edited

Java is somewhat bulky, but it's not slow. Java was designed to be always on rather than on demand. Although with GraalVM Java is also playing the on-demand field.

Java is quite dominant in the Enterprise world.

But unless you are aiming to build a big to huge thing, I would probably not start with learning this as a new thing. I think it's better to pick Ruby or Python.

I'm not saying that Java is not suited for smaller web applications. But if it's something new you want to learn it might be better to pick Ruby. And once your new thing is done, build it again in Java. 😛

Collapse
 
tomsfernandez profile image
Tomas Fernandez • Edited

All of those languages have their pros and cons:

  • Python and Ruby are both dynamic while Go and Kotlin are statically typed. For me statically typed always wins against not-static but in your case coming from Javascript you'll be more familiar without types.
  • Ruby is a really easy language to grasp and use. If you are looking for development speed then Rails is your goto. The bad side is that ruby has no support for async operations.
  • Kotlin has all the support of the Java ecosystem behind it. You can use all their libraries and already have great frameworks for backend stuff.
  • Go is the new kid on the block. It's cool to use if you are looking for something fast but it's the most basic of the 4 languages in terms of syntax and you have to get used to pointers.

If you are looking for speed go with Rails or python with Django. If you are looking to learn you could take a look at Kotlin and use types along the way.

Collapse
 
kovah profile image
Kevin Woblick

Thanks for your insights! It is really hard to decide.

Collapse
 
roelofjanelsinga profile image
Roelof Jan Elsinga

All good choices I'd say. I'm a Laravel developer and managed to pick up Go in about 2 weeks. In 2 weeks I migrated a slow PHP script to Golang and put it in production, where it now performs amazing. It's really fast and the memory usage is so low that I often don't see it in the memory management tools. Seeing as you come from PHP as well, it might be a great option for you as well. It can do what PHP does, but faster. It also has a lot of other usagew, because you can compile it to a binary and drop your self containing program anywhere (with the right architecture) and run it. It's something that has helped me and might also help you.

Collapse
 
felagund18 profile image
Ab

Same story :), Using go, some benefits such as no data type related bugs, performant binary, readability for other developers...

Collapse
 
yawaramin profile image
Yawar Amin

Based on your criteria, Elixir and Phoenix Framework seem like the best fit. Elixir is a language perfectly designed for modern web development–clean syntax, easy to pick up the basics, and runs on a powerful platform that's been around since the '80s. This platform today runs apps like Whatsapp, Discord, Bleacher Report, and many others. Phoenix Framework is a fresh spin on the familiar MVC pattern and has a database access layer called Ecto.

I know I'm not exactly recommending a mainstream tech but if you try it, you'll see why it's so highly regarded.

Collapse
 
ilvalerione profile image
Valerio • Edited

PHP forever.

  • Great performance,
  • An easy to use environment,
  • The largest skilled community around the world
  • The biggest ecosystem out there
  • An incredible support by cloud providers
  • A brilliant future with PHP 8
Collapse
 
freedom profile image
Freedom • Edited

Somewhat agree, but it doesn’t really answer the question?

If you could reduce technical debts for a great performance which libraries or frameworks would you choose or choose to roll your own if you are competent enough?

Other languages are easier to set up is when you don't need different web servers and can run on it own,

I would say Javascript has the largest skilled community.

Javascript would be the biggest ecosystem.

Some cloud providers has poor customer experience and you know why.

PHP 8 is an incremental improvement over PHP 7.

Collapse
 
woddell profile image
Chris Weir

I think it really depends on where you'd like to be in a few year's time. If you're looking to be working for a company where you live then I'd look at what languages they're currently using. From your bio it appears you're currently working just now, are they using any of the languages you've mentioned?

For me, I'm in a similar situation to you, I'm a PHP/JavaScript developer and I'm looking for a new language to learn for building some complex backend systems. Out of Go and Python, I picked Python. The reason for my choice was that we have a few database and lambda scripts already written in Python. If I lose my job, Python jobs are in abundance where I live and there's far more material (Tutorials, Libraries, etc) for Python right now compared to Go, so picking it up and learning through examples isn't going to be difficult.

That's not too say there's anything wrong with Go. I hope that Go will have matured a lot in a few years as I really like the language. But for my career goals, Python seemed to be the best fit.

Collapse
 
rafaelgdp profile image
Rafael Pontes

Holy guacamole. I came here looking for answers and I left with more questions... I still have no clue which language I should focus on right now. Every single comment points in a different direction. It seems like we're all lost in this framework hell. I know people talk about learning design patterns and stuff, but eventually, you have to IMPLEMENT them in some language. And let's be honest, it takes some time to get FLUENT in a language. Even though it's easier to migrate between languages with experience, you still have to choose one to have rock solid confidence.

Collapse
 
foresthoffman profile image
Forest Hoffman

Generally speaking there are many programming languages that can fit your use case, depending on what that is.

If you're trying to figure out which language to use because you're trying to build something, it depends on the medium you're building on. e.g. in-house, web, cloud, or a specific platform.

If you're trying to figure out which language to use because you're trying to learn a language, pick the first one that sounds interesting.

Being fluent with a language will only come with practice. You have to start somewhere, and if you're unsure, agonizing over which language you might most enjoy mastering will not get you anywhere.

At the end of the day, any one programming language is a tool in your toolbox. Every tool has it's job, and when your only tool is a hammer, every problem looks like a nail.

So, the first question to answer is: what do you need to do? Not what you want to do. What is the absolute bare minimum that you need to accomplish?

Collapse
 
oguzhankurnuc profile image
Oğuzhan KURNUÇ

I can't see in your options but check out Rust too. You can write OS or basic web API by Rust and run cross platform. It's more difficult than PHP and JS but you can code almost anything you want using Rust.

My second advice is Go, It's is easier than Rust but not as strong as Rust.

Collapse
 
cathodion profile image
Dustin King

Something you like and can get jobs in. That's going to depend on your own tastes and the job market where you are.

Python is pretty good as a server-side web development language (along with Django - I like its ORM) and is great for developing the other parts of your system that aren't exactly web applications as well. If you need high performance, there are things like Numpy and Cython (but you likely won't need them for a website backend).

Static types for Python exist with things like MyPy (as well as with Cython), but in my opinion static typing is really a millstone around developers' necks most of the time.

On the other hand, the popularity of Python seems to be somewhat skewed by data science. The job market for Python web dev doesn't seem as good as it should be for the level of popularity Python supposedly has.