K
K
kedrovdanil2019-11-20 08:19:45
Programming languages
kedrovdanil, 2019-11-20 08:19:45

Which back-end programming language is more productive?

Hello fellow Toasters. All the time while I study programming, one question torments me. I plan to write a semblance of a social network, not even a social network anymore. network, but the project is under high load. And with room for growth.
The problem is that I can't choose the programming language for the back-end. The main criterion for selection seems to me its performance. For me, and for all of us, it is always important that the site opens quickly. I understand that if the hands grow from the right place, then everything will be fine in any PL, however, VKontakte corresponded from PHP to C as far as I know.
Here is the stack I currently own: HTML, CSS, JavaScript, PHP, MySQL.
But it seems to me that writing something large in PHP today is "zashkvar", and it's not even about fashion, but about performance. In which language will the page load speed be faster?
As a result, the question is, is it worth learning any other PLs or writing in PHP (and then rewriting in case of growth)? And if you write in PHP, which framework should you choose?
From PHP frameworks I consider: Laravel, Symfony 4, Phalcon.
From the solutions for the back, I look aside: Node.js, Go (Golang), Python, Java.
Also there is a question on usage of a DB. Which is more productive and easier to scale?
PS I would like to hear the opinion of people who have been programming for more than 2 years and in different languages.

Answer the question

In order to leave comments, you need to log in

18 answer(s)
D
DevMan, 2019-11-20
@kedrovdanil

Are you a fan of comparing warm with soft?

It seems to me that writing something large in PHP today is "zashkvar", and it's not even about fashion, but about performance.
among the interpreted languages, puff, surprise-surprise, speed is on top.
and now either put on your underpants, or take off the cross, decide what you need: speed of execution or speed of development.
By the way, let me tell you a secret: many projects use several languages.

F
FanatPHP, 2019-11-20
@FanatPHP

Yes Yes.
Wikipedia, facebook, pornhub - all these sites lag terribly and generally lie without rising.
And our couch specialist in social networks, who can’t even write a guest book without getting confused in two lines, broadcasts about bugs and performance problems.
Nothing in the world changes, Mozart also had to answer similar questions.

N
Northern Lights, 2019-11-20
@php666

It's funny to see how experienced guys explain to a young schoolboy Zuckerberg about technology, although the most correct decision should be given advice not to write any social networks, because he will not write it, and he will only dream of "high loads".

R
Robur, 2019-11-20
@Robur

Decide on loads.
At least RPM.
I don’t know if VKontakte was rewritten in C, but you can look at it differently - up to a certain point, php was enough for them. And you've had enough up to this point.
Do you already know exactly when you will reach the same point and you will no longer have enough of it?
If you're more of an academic interest - "I don't know how much it matters, but it's just nice to know that it's 0.00001ms faster on average" then grab GO - it's trendy and rumored to be fast. how it will be in fact - it really doesn’t matter to you, you are unlikely to see this difference.

A
Antonio Solo, 2019-11-20
@solotony

PHP's problem, like any other interpreted language, is the time it takes to compile and initialize, which is done on every request.
and Frameworks, by virtue of their monstrosity, slow down, God forbid.
if you plan to "write a social network" then write it on what you know and what you are confidently working with. and when you really face the brakes - then think.
you should never forget the precepts of the grandfather of the whip: premature optimization is the root of all evil
although if you really plan to work in the field of "highload" - perhaps you should initially choose a compiled language - go, java.
p.s. i switched to python/django myself

S
Saboteur, 2019-11-21
@saboteur_kiev

VKontakte corresponded from PHP to C as far as I know.

Who is stopping you from going the same way?
When your project starts to slow down, buy a more powerful server.
When the server is not enough more powerful - rewrite. More precisely, hire specialists who will rewrite.
Now don't beat yourself up. Premature optimization is harmful.

#
#, 2019-11-20
@mindtester

skimmed through (like already 15 answers))
I can’t resist - I’ll finish it! )))
in general, it’s often more expensive to develop a reliable product faster ))) or even always)) at least the words development speed + reliability (or ease of maintenance , or readability , everything is very close) in the real world is always more important)) - hell for large products (highlighted .. otherwise it seems that one wrong reading has already taken place)) - steepness, but for some reason not in favor (should be) - well, it will crawl for now ...))) - veteran .. but .. - everything sucrose visit us
kotlin.. but judging by the reviews on Habré, seriously, it's still damp
C#- it's .net Coredeveloping rapidly. and according to my observations, the demand for https://hh.ru is growing at the same pace ..
but in general, people at the poles even write, even in asma, you can even get a heavenly performance .. in theory .. but it takes a long time to write ..
someone he even experiments on the prologue (sorry, I didn’t find the link in a couple of minutes, but it flew by on Habré recently))
.. something like this
ps if there is a worthwhile product, there will be an investor. if the growth rate of demand and the quality of the investor are satisfied, the performance is decided by pouring into the hardware (our own or the clouds, it doesn’t matter)
.. something like this))
если вы перфекционист, и наделены реальным упорством - выбирайте Erlang. без шуток. но это не простой выбор.
если согласитесь с идеей, что не самый лучший, однако один из лучших перфомансов, в сочетании с крутейшей информационной поддержкой, и реально лучшим в мире инструментарием (Visual Studio) выбирайте C# .net Core
довесок о hiload с участием .net - https://habr.com/ru/company/targetix/blog/261745/

Y
Yo JLa, 2019-11-28
@blanger

To meet your ambitious performance requirements, take a look at the comparison of benchmarks of some project written in different languages ​​with different libraries, from the site
https://www.techempower.com/benchmarks/
The obvious leader for a long time RUST JS with one of the web frameworks .
A PL that not only produces binary executable code, has a small runtime without GC, but most importantly, at the language level, it guarantees the safety of the code (of course, with "even" hands). It also has a sugar functionality recently added to the PL for writing asynchronous code (async/await). It is strongly typed, there is no inheritance, but there is a composition and a system of traits. The main thing is that thanks to the properties of the compiler (borrow checker), it already knows how to “beat hands” during compilation for not safe code in a multithreaded environment.
Of course, high performance depends on many factors - architecture, distribution, database, caching of static content, and many other things listed in the answers.
rust is a hard language to get into, so get ready to take longer than any other language to master at the c++ level. But he's worth it.

X
xmoonlight, 2019-11-20
@xmoonlight

Any where you stop using frameworks and build the architecture yourself.
Your own module (which, as an example, is Phalcon) for a web server is the most productive option (if the other is with "direct hands", of course).
In short, about performance:
I read - a pre-render of HTML pages (or their information blocks, for example, separately the entire publication and add inside - user rating) on ​​the server to static and caching on the client side.
writing - AJAX-POST
rendering (gluing data and simple text processing) - PHP
processing (including mass page pre-rendering!) - microservices
About the database - here

M
mt. NATS, 2019-11-20
@Dimastik86

https://www.youtube.com/watch?v=Jcw9tRmJwWI

K
Kirill Gorelov, 2019-11-20
@Kirill-Gorelov

It is immediately clear that there is little experience in development in principle, at least it seems so.
First of all, php is far from sloppy. Php is a great language. Whoever says that it sucks just doesn’t know how to “cook” it and starts saying all sorts of terrible things in his direction. And they look at java developers and say, here is the java language "fire". Yes, no shit like that, you can also write all sorts of terrible things on it.
Secondly, the framework, also any, that is supported and updated constantly. You won't go wrong either. And even more so, laravel or symfony will definitely cope with your task, if we talk about php.
And lastly, your first version of the project will cope even with the load even php 5.3. because you still need to grow up to high loads and come to this. And it's a long way. And when you come to this, you will already know and be able to do a lot, and you yourself will figure out which of the languages ​​will suit you.
Therefore, write on what you can. Any language in 2019 can do everything it needs. You won't be mistaken.

S
spaceatmoon, 2019-11-20
@spaceatmoon

So PHP is C. It's just that the architecture of the language does not involve compilation, but interpretation of code on the fly. Look, the Phalcon framework is written entirely in C. For social networks, there is little point in productive languages, because there are simple steps. You will sag more stupidly in the number of connections and the ability to run a bunch of processes, and they each want their place in the RAM and processor. Twitter when it was released, all its actions were done through queues.

S
Sanes, 2019-11-20
@Sanes

From time to time I come across Java as a user. Works very fast.

P
Pifarh, 2019-11-20
@Pifarh

I don’t write myself, but my friends write in PHP with laravel. The speed of development and work at a high level.

S
SEOD, 2019-11-20
@SEOVirus

But it seems to me that writing something large in PHP today is "stupid"

I don’t know for whom it’s zashkvar, but PHP is today one of the most productive and most simple and accessible languages. You can take something fancy like Python and get a few times slower speed. But you will be fashionable and your colleagues will not make fun of you :)
True, competitors will make fun of you. Well, does it really matter, fashion is above all and what others will think! :)

M
Michail Wowtschuk, 2019-11-21
@wowtschuk

Asm, C, C++, Go

S
stilic, 2019-11-21
@stilic

The performance of a network service depends on the DBMS, more precisely on your ability to use it
AND on the network, which does not depend on you in any way.
Large networks like Facebook, VK are written on quite a "slow" PHP backend. The brakes are not because of him.
And because of the network and DBMS.
Ask yourself the question:
Why are all the fools choosing not the most productive and not the most scalable technology?
After all, in theory, only she should remain in the world, so the most-most super-duper? And all other unworthy people would have to die out?
Or do you think that it never occurred to anyone before you that you need to take that very cool one?
Think about why "not the coolest" ones still exist.

M
Mikhail Potanin, 2019-11-30
@potan

If performance is so critical, then the right choice is Rust. Along with performance comes reliability.
But for large web projects, scalability is more important, when throughput growth is provided by adding machines to the cluster. It doesn't really matter what language.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question