P
P
PRAIT2018-03-29 03:30:21
Java
PRAIT, 2018-03-29 03:30:21

Why do backend in different languages?

Good hour.
Tell me why they write backend in several languages? I understand that in large java and c++ projects this is a replacement for classic php, but is it possible to implement, for example, backend only in java or c++? Why write in two languages?
For example backend
MSN.com is written only in ASP.NET
YouTube.com is written in C, C++, Python, Java, Go
What is C++, JAVA and GO responsible for on YouTube?
I understand, the question is general, but still, at least in theory, explain.
Thank you!

Answer the question

In order to leave comments, you need to log in

5 answer(s)
I
InoMono, 2018-03-29
@InoMono

Let's take Dropbox for example.
It was originally written in Python - it's faster for prototyping.
Then it was converted to Go - for predictability and speed. But why completely redo it? Many pieces in Python are still there today. And they work.
And the smallest piece was redone in Rust - to speed up the bottleneck.
Here you have 3 languages ​​working simultaneously in Dropbox on the back.
Or there is one or another specialist who knows this or that language better at the moment. He was instructed - he did what he knows best, in order to do it faster and better.
Or that was the nature of the problem. An example with the Rust/Go combo is shown above. Somewhere one language may be better, somewhere else.
And if we remember that the project is not only written, but also ready-made components are applied, then C / C ++ are automatically added to almost any project, those that are in the database, for example, etc., etc. SQL is also a backend language. And so on and so forth.
You exaggerate the importance of language. It's just a programmer's tool. Same as the keyboard. An experienced programmer learns at least a dozen languages ​​over the years, and some even much more. There is nothing of the kind in this.

S
Stalker_RED, 2018-03-29
@Stalker_RED

They write, probably not from scratch, but modify some existing solution.
Yandex once said that they first write in something faster, simpler, such as python or even pearl, and when (if) the module grows to a certain threshold, they rewrite it to something more productive.
Well, different development teams can be more proficient in a particular language.
The tongue is not an idol for worship, but a tool. You can build a house with only one ax, but usually builders use dozens of tools, because they are faster and more convenient.

S
Stanislav Makarov, 2018-03-29
@Nipheris

Tell me why they write backend in several languages?

For some reason, no one said the main argument - in large projects, the concept of a backend is very arbitrary . In large projects, there is no longer one web application that is written in one language and runs on one or two servers. In large projects, the backend is already a set of services, often heterogeneous, sometimes not even communicating with each other, but working directly with the client (google microservice architecture). An example from our company:
- a django web application that renders html content - here is user authorization, storage of user settings and data;
- chart data service - written in Erlang for extreme stability and predictability, and also because of lightweight streams (BEAM has a good preemptive scheduler);
- financial calculation service indicators - written in Java , gives data through an Erlang service;
- exchange scanning service - written in Go (we write many new services on it).
- and a few other smaller services.
Each of these services is not even individual people, these are entire teams with their own history, with their own requirements for reliability and performance, and with their own culture in the end. The services are very large, even if something does not suit you and you want to rewrite on another platform (for example, from Erlang to Go), no one will do it just because you want to, it's a lot of money and a lot of man-years.

P
pfg21, 2018-03-29
@pfg21

the same contact was written in php.
when the problem of slowness of php arose, a kphp tool was written to translate php into C ++ with subsequent compilation.
The speed of work of sweat reports of admins of the contact has increased two (!!) times, for a highly loaded site this is a lot, including in terms of money.
Facebook also did a similar thing. it's about puff.
in general, each tool is convenient in the use case for which it was originally conceived.
some language simplifies / speeds up writing working code in it, takes on a bunch of subtle nuances.
some provide the functionality of high-quality code development, but require a lot of picking and a lot of knowledge.

A
Adamos, 2018-03-29
@Adamos

C++, Java, Go, PHP, Python.
These are popular languages ​​on the web, built on the principle "first the most efficient, but the most difficult to develop and maintain code, in the end - the easiest to write and edit, but the least efficient."
There is no point in writing the entire project in C ++ - the costs will be wild, and you will simply be overtaken by competitors who have concocted an analog that works a little worse from shit and sticks.
There is nothing wrong with a Python project - as long as it does not go under load, and rewriting part of the service in C ++ turns out to be cheaper than buying new servers.
This is how language mixing comes about. Fortunately, the principles of effective communication of individual services with each other have long been known, and what the service has "under the hood" does not play a role in the overall architecture at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question