Skip to content

u/reasonoverconviction

In this archive from Mar 2021 to Aug 2022

0
posts
41
comments
0
media
153
score

Top comments

Honestly, when you are writing about concurrency with a title like "php is not truly async", chances are that people, who are reading it, already know what threads and processes are. Same goes for the concept of synchronism.

Going through all of that is kinda pointless and makes your article hard to follow since its "meat" is aimed at intermediate developers, but it has a wall of beginner level information preventing the reader from reaching the important part.

​

I also think that, by adding all of that "unnecessary" information, you missed the chance to elaborate more on why you'd say that async php is not truly async.

I get that you probably meant that it is not truly async because you still need to get into a message loop in order to make it work or because those native functions don't receive a callback.

But you could've expanded further by using php's native coroutines for example(https://www.npopov.com/2012/12/22/Cooperative-multitasking-using-coroutines-in-PHP.html).

​

But anyway, just my two cents. The article is very well written and you obviously put a lot of effort into it.

cheers

21 points

Never heard of this pattern and, honestly, not sure if I like it.

It seems like it would be more useful in C++ where overloading would make the "accept" function not necessary I believe. It'd be more readable as well since having a function called "accept" returning an integer doesn't sit well for me.

In C++ you'd just PageCounter::getPageCount(document) since, in C++, you can declare the method getPageCount as many times as you want as long as the parameters have different types.

In C# you could even declare it as an extension method and then just call document.getPageCount() directly without even touching the class's original declaration(which is awesome honestly and should be copied by php).

11 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.