HNHacker News
TopNewBestAskShowJobs

alphadevx

1,019 karma · joined August 23, 2013

No longer an active account, but in the year 2021 HN does not support account deletion so you are reading this instead (you rock guys).
submissionscomments
alphadevx··on Apple has €13bn Irish tax bill overturned
Well apparently not, according to the ruling being overturned today by the EU court. They are the legal facts.
alphadevx··on Apple has €13bn Irish tax bill overturned
Let me introduce you to the New Hanseatic League, you will be surprised what an aligned group of small countries within the EU can achieve: https://en.wikipedia.org/wiki/New_Hanseatic_League
alphadevx··on Apple has €13bn Irish tax bill overturned
Yes and that finding has just been overturned.
alphadevx··on Apple has €13bn Irish tax bill overturned
I am Irish and perfectly fine with this being overturned. Irish capitalists will love it, Irish socialists will hate it, same as the rest of the World it depends on your personal prism. Overall seems the EC claim was weak enough to be overturned by appeal, so clearly not a water-tight case, burden of prove not strong enough:

"The EU's General Court said it had annulled that decision because the Commission had not proved that Apple had broken competition rules."

alphadevx··on A look at modern PHP
Oh I see, yes you are correct each request will bootstrap your PHP code stack framework each time (mitigate with opcache). Seems weird I know, but it goes back to that "shared nothing" principal: nothing is kept in memory between requests. On the plus side of that principal: nothing is kept in memory between requests that is not currently being used.

Coming from a Java background into PHP, this really confused me at first, until I started to think about PHP's approach as some kind of super-agressive garbage collection: everything gets released in that reqest thread once it's completed.

It's a fundemental design choice of the language that you have to embrace if you want to use PHP (I love it now, simplifies so much), or move on to another language.

alphadevx··on A look at modern PHP
I've been hearing that "PHP does not scale" arguement for many, many, years, in many, many, variations.

When you really have to scale, infrastructure, resources, and networks will rapidly overtake any concerns around your choice of language. You can develop crappy architectures in any language, and the inverse is true.

alphadevx··on A look at modern PHP
It's php-fpm persistent threads (seperate Daemon listening on port or socket), not web server threads, just to be specific. You have a lot of control of how many PHP threads you will allow per web node using php-fpm, very reliable tech. The days of mod_php are long gone.

So I meant one thread per request at the php-fpm level, not Nginx/HTTPD level.

* Edit for spelling

alphadevx··on A look at modern PHP
> presumably because you just read the title and the pre block and skipped over all the rest of the content

Nope, read it all as I mentioned already.

alphadevx··on A look at modern PHP
LOL thank you, English is hard (like engineering) ;-)
alphadevx··on A look at modern PHP
> When you can't query your DB, you hit your resident memory cache. Redis, Memcached, etc.

You would query those first surely, before loading the DB? Regardless, I've been using Redis and Memcache for years from PHP, so mute point.

> I use multiple threads in a single request flow frequently.

So how do you track those? And for how long do they live after the parent request has been processed, or do they block the parent? Gets complicated quickly.

> It's ugly and inconsistent, takes time to memorize, and leads to errors.

Rasmus will admit the same, but he will also admit he does not care (I've seen him say this during a talk). Nobody bought your product because it had beautiful, consistent code.

> This limits you to writing basic CRUD. And so many other languages offer this.

99.9% of web apps are CRUD.

alphadevx··on A look at modern PHP
I accept it mentions that in the content, I guess its the title I find misleading. You can see on this very HN thread, lots of confused replies are falsely equating those features as new developments.

My simple point is that PHP has been "mature", in OOP terms anyway, for at least 10 years now, so the original author tying that milestone to PHP 7.4 seems weird and outdated to me.

alphadevx··on A look at modern PHP
Where to begin indeed!

> - No proper connection pooling with circuit breakers.

PHP has had a "shared nothing" architecture since the very beginning, that includes DB connections. It helps it to scale (think micro-services being stateless in a modern context): nothing is shared between requests, again including connections, by design.

> - No proper multithreading (that works in web environment) or parallelism in general.

I once asked Rasmus about this face-to-face, during one of his presentations, specifically his thoughts about the pThread extension (https://www.php.net/manual/en/intro.pthreads.php), and he responded that it was not required in a web context, as web servers already have threads per request so its a mute point.

> - Almost everything blocks (even `new PDO('mysql:...')` can block for whatever the execution time limit is, if there is an issue with connection or MySQL server).

Well, it depends on your code of course, but pretty hard to proceed with some code that works with a DB when the connection can't be established, so proceed with what exactly other than error handling? Seems like a strange example. And as mentioned above, no (excluding optional pThreads) support for asynchronous threads in the language, so...?

> - Most libraries are implemented in C instead of in PHP, whereas with other languages people try to avoid native code as much as possible. This means that code is not memory safe, and understanding or contributing is close to impossible.

Ok now you have just thrown away one of the main benefits of PHP. Remember, Rasmus is a C programmer, not a PHP programmer, so he wanted to leverage that HUGE library of existing C-code from his new scripting language, from the very beginning, deliberately by design.

> The reason for this is because PHP doesn't support many things that are expected in any other language.

Yes it does, via the C-extensions, see above.

> PHP C API is hard to understand, hard to use, and documentation is subpar.

Yes programming in C is hard.

> - There is no way to easily share memory between processes. You have to rely on APCu (hack), because this cannot be implemented in PHP.

Deliberate design choice, "shared nothing architecture", stateless between requests, as above.

> - Did I mention that almost anything can block? ODBC? PDO? Some 3rd party library? Even set_time_limit cannot help you here. Handling this gracefully is close to impossible.

Yes because each request is a synchronous thread, as described above above. By design.

alphadevx··on A look at modern PHP
Yes I read it, why accuse me of not doing so? The main block of sample code is highlighting OOP features in PHP, but PHP has had most of those features since 5.3, e.g. namespaces, so my point still stands. Those features are not part of "PHP showing its maturity in release 7.4", but have been around since at least 2009, so why lead with that example?
alphadevx··on A look at modern PHP
Many of the features highlighted in that article as "new" are from PHP 5.x, so it reads more like a list written by someone who has been out of touch with PHP development for a number of years.
alphadevx··on Providence Lost: The Rise and Fall of Cromwell’s Protectorate
I would love to see Britain become a republic some day for their benefit (up to them of course to vote on that), but agree they need a better hero.
alphadevx··on Providence Lost: The Rise and Fall of Cromwell’s Protectorate
Wow, what a truly offensive article. Firstly speaking as an Irish person, the dismissive tone here is outrageous:

"And later in the century, as one phase of the conflict between England and Ireland followed another, the sins of Cromwell and his army in rooting out the supporters (both Catholic and Protestant) of the Stuarts in Ireland were used regularly as a stick with which to beat the English, albeit well over 300 years later, and as further proof that the Irish have perhaps the longest memories in the world."

For some historical context, start here: https://en.wikipedia.org/wiki/Siege_of_Drogheda

And as for the conclusion:

"The growth of British power and prosperity in the eighteenth and nineteenth centuries was in great measure built on those secure foundations. Cromwell’s part in leading the great change of culture was absolutely fundamental to that."

So Cromwell helped build the foundations of the British Empire, and that's a "good thing"? I don't know where to start, consider me triggered ;-)

alphadevx··on New System76 Laptop: Lemur Pro
The 2020 model of Dell XPS 13 has 16:10 @ 4K AFAIK. If you get the Developer Edition, it comes with Linux preinstalled.
alphadevx··on LibraryThing Is Now Free to All
LibraryThing is used by fine press book collectors to discuss the physical properties of fine editions from for example The Folio Society, Easton Press, Centipede Press etc. The forums will discuss in length for example expensive limited editions, the bindings, choices of paper etc. It really is a different audience to Goodreads, which is more focused on reviewing the content of books rather than the bindings.

If you love fine books and supporting small independent publishers, LibraryThing is an amazing niche community.

alphadevx··on Max Von Sydow has died
What an amazing actor, he had so many fine performances during his career. I loved him in Dune, and also this cameo as King Osric in Conan the Barbarian: https://www.youtube.com/watch?v=MVTOag1lQHc
alphadevx··on My productivity app for the past 12 years has been a single .txt file
I tried the todo.txt approach, but found I wanted to have secure access from any device (including devices I don't own), so went with an easy cloud option: https://five.today
alphadevx··on Ask HN: Do you contribute to open source? Why? Why not?
I maintain my own open source project. I do this because I am a manager now, therefore I no longer writing code during my day job. However I still love to code, so an open source project is a perfect hobby for me.
alphadevx··on Michael Apted's “Seven Up” series is reaching its conclusion
Thank you kindly, profound advice for any father! I do my best to advocate for him every day, and I have made some mistakes along the way, but will never waiver my commitment.
alphadevx··on Michael Apted's “Seven Up” series is reaching its conclusion
Wonderful post, I wish you well on your journey friend. As a father of a seven year old boy who is already being buffeted by life's challenges, I also find this topic somewhat depressing but you expressed it more eloquently than I ever could.
alphadevx··on Xerox Considers Takeover Offer for HP
HP stock already up 10% in pre-market alone, based on this rumour: https://finance.yahoo.com/quote/HPQ?p=HPQ&.tsrc=fin-tre-srch
alphadevx··on A Fine Map from Alexander von Humboldt (1851)
Humboldt is a very fascinating character, who sadly is often overlooked. If anyone is interested in learning more about him, I strongly recommend this biography by Andrea Wulf: https://amzn.to/2KWiy36
alphadevx··on How to get your first ten customers (2013)
Great article, and while also relevant for B2C in some parts, I'd love to read advice dedicated to B2C (SAAS in particular). Anyone got any nice links to share?
alphadevx··on Ends of the Urth
Ah good, then I have already read it as I own that edition from the Folio Society :-)
alphadevx··on Ends of the Urth
I did not stick around to read it all, the first hint of a spoiler sent me back here to warn others. Neil knows the material really well, he wrote the introduction to the recent limited edition of The Book of the New Sun for the Folio Society for example, so I should have trusted him not to blow it.
alphadevx··on Ends of the Urth
SPOILER ALERT. I'm reading the first volume of The Book of The New Sun right now for the first time, so was surprised that Neil introduced a spoiler in the first paragraph of the linked article so I had to stop reading it...
alphadevx··on Ask HN: What books changed the way you think about almost everything?
I think most books I read should impact me, given the time invested in selecting and reading them.

My most recent example is Solaris by Stanislaw Lem, it made me realize how difficult it would be for us to communicate with, or even comprehend the motives of a sentient alien. I wrote a full review here: http://www.alphadevx.com/a/519-Review-of-Solaris-by-Stanisla...

← PreviousPage 2 of 9Next →