P
P
P7472020-03-20 01:17:37
go
P747, 2020-03-20 01:17:37

Is Go a replacement for PHP in terms of multithreading and performance?

Good afternoon!

Those who have tried the Go language at work, is it as good as they say about it? What did you like/dislike about it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Belyaev, 2020-03-20
@P747

Like ruby, go is a write only language...
Easy and fast to prototype. When you need to test a business idea and throw an MVP onto the market yesterday, it’s hard to come up with a better language. But maintaining it later is painful and expensive...
Once again, copy-pasting the error check or forwarding it further, you start praying for those people who invented DRY and cursing the authors of go, for the design of this language.
And now it seems like a ray of good, instead of inheritance, they are trying to sell us a composition, only it was made through one place and you will easily lose control over it.
Polymorphism? I know 3 types. And I think that polymorphism is exactly the tool that allows us to make software with DRY, SOLID and other beautiful abbreviations ... Except go doesn't have any of them ... Instead, they give you terrible duck typing. Seriously ... When they tell me that JS has duck typing, I laugh and say that JS has an excellent type system and suggest looking at go, because if you study someone else's code for at least 10 minutes, then you already have at least 3 times wondered what kind of cripple wrote interface{} here instead of type...
PHP is a good language. It allows you to write both shitty code and very beautiful and correct OOP. I personally lack FP in it, but you can live without it there. PHP7+ is quite fast, and with some addons it can be multithreaded... Not as easy as go, but it can...
Is the simplicity of prototyping and spinning several human lives worth the codebase support of a slightly more complicated helloworld? It's up to you to decide ...
PS If you really ran into performance not in IO (database, disk, network, etc.), but in your favorite php / js / python / java / C # - go will not help you, you will absolutely catch the same stop-the-world from gc, in addition you will catch the costs of the work of the scheduler driving your 5 thousand goroutines on 4 cpu threads... (didn't you know that hyperthreading is evil? streams...). If you are really stuck on the performance of your PL - look towards C ++ or Rust. If you haven’t rested, you definitely shouldn’t rewrite everything on hype go.

V
Vladimir Korotenko, 2020-03-24
@firedragon

Why not .Net Core ?
The runtime is about 100MB. It will be relatively easy to master after PHP.
And a normal IDE will not let you screw up too much.
Of the pluses, normal multithreading and asynchrony out of the box.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question