It’s not so much that it’s simpler: C is a much simpler language than anything else mentioned, it’s just that you have to do almost everything yourself. Its very low-level, you have to explain to the computer exactly what you want it to do, and in practice that gives you a million and one ways to mess things up.
Like if you wanted a simple HTTP server, in C you’re likely going to have know about how to implement the low-level parts of it, about how networking and HTTP protocols etc work, and you’re going to need to build all that yourself. In Python, you can just import and use the http.server
module that comes as part of the standard library, just a few lines of code. Higher-level languages are much easier to work with at the cost of not being able to easily manipulate low-level stuff (in particular memory) [this is a simplification, but it’s basically true].
For what you want (simple HTTP APIs), don’t use a low-level language unless you want to learn all the low-level moving parts; that process would be incredibly instructive, but will take you 1000× as long to produce anything usable, and even that thing will not really be something you can use in the real world, it’ll be a toy.
If you want to make games, native GUI stuff, high-performance data processing stuff, C++ is a very good thing to learn. If your aim is to write web applications, it’s not so useful.
To focus on the original question:
What back-end language could I use for doing a lot of back-end work and making an API?
IMO, you need to ask yourself:
- Is it easy to learn and to use?
- Is the time between ‘start coding’ and ‘thing you wanted to code showing up on the screen’ quite short?
- Does it have good learning resources?
- Does it have a large community of users?
- Does it have a good standard library (i.e. out of the box, can you do most things)?
- Does it have good and well-supported libraries/frameworks for what you want to do?
- Does it teach you something new?
JS is ok on most points bar 5: it is diabolically bad in this respect, given it basically has no standard library (nb Node has an ok-ish library). Also, arguably bad on 1 as well, as it tends to do weird things (though ES6 fixes a lot). Personally, I don’t like it at all for backend stuff, but lots of people do.
Python is generally pretty good on all points except probably 7. It is like a hammer. It isn’t necessarily going to teach you anything deep but it’s pretty easy to hammer almost anything you want into shape. I want a web server, bang bang bang. I want to process all the files in this directory, bang bang bang. I’m sick of going through these spreadsheets by hand, bang bang bang. I want to do some maths, bang bang bang. Flask is a good lightweight web framework for Getting Shit Done.
Ruby is in many ways similar to Python but without the take-up in academia (so no fancy maths/science/machine learning/etc frameworks), and I would go Python given the choice; note Ruby seems to be dying off somewhat. Ruby on Rails is a good framework for getting fully-featured web apps out the door quickly.
Java is very good on all points except probably 2. You need an IDE for it. Other very well-regarded languages (Kotlin and Clojure in particular) also run on the JVM (the thing that runs Java on yr computer) and you can use them alongside Java no problem, mix and match in one application. Small but crazy frustrating niggle: the JVM is famously very slow to start up.
C# is very good on all points bar probably 6: the ecosystem is obviously geared toward dotNet applications (the language is for building applications), and type of libraries available reflects this (this is definitely not an issue in your case). Also commonly used for game scripting (see Unity in particular). Like Java, need an IDE for it (Visual Studio is pretty great though). Also like Java, the thing that runs C# on your computer, the CLR, has several other high quality languages that interop seamlessly with C# (most importantly F#, which is a brilliant language).
Go is I guess good on all points, particularly 1 and 5. Less usage in the wild as it’s newish.
PHP has the benefit of everything being in one place: you can literally have a single file + a database with everything in it for a fully functional CRUD app. Whether this is a good idea, well… Having all your code in the same place is genuinely a great thing though (like an HTML form, and the logic to do stuff with it, to submit and deal with the response). It did have a deserved reputation for being a massive unholy mess, though it seems to be a bit better now. Similar to JS in that it’s very easy to get started and get something out. Also similar in that it wasn’t really designed to do the million and one things people try to do with it.
C kinda falls down on a load of those points; it’s simple but needs a fair amount of experience to use well, it can be a pig to get stuff compiling, many users, but they’re often skilled users and in disparate communities if at all etc etc. Maybe bad analogy: is a bit like learning Latin.
C++ can do everything C can do plus you get a load more stuff on top that: it has a huge surface area. The caveats for C still kinda apply, but much less strongly. It’s used all over the place, but w/r/t backend web stuff, generally only for parts of applications that need very high performance (ie parts of data processing pipelines). If you want to build web APIs it is not really the language for that.
Regarding point 7 (does it teach you something new), just pick one language and build stuff, it’s much of a muchness at this point.
I would also unequivocally recommend the Coursera Programming Languages series; not for building an API, just to understand different programming methods and paradigms, they are very, very good: