Oddbean new post about | logout
 @ddc3da8f @ec7374a8 @aecfae5b or just go with some another language ;-) 
 @90991173 @ec7374a8 @aecfae5b

my friend is building PWA app in Golang, it's pain in the ass - time to complete the project ~ 100x times of PHP 8 
 @ddc3da8f @90991173 @ec7374a8 @aecfae5b
For all of the complaints and flaws, PHP is a mature, well supported language.  It has more years of code written for it then literally any other language in common use today, save maybe C, simply because It's been around since the very early days of HTML.

Sure, it was meant to automate the layouts and some of the content of small homepages, but there's been solid support for it for all that time, and development in good faith for the purpose of being used by everyone.  ASP and other imitators never had that going for them, they never even got off the ground compared to PHP.

For the entire time I've been programming in PHP, people have said it's on the way out... And yet everything they said would replace it has either become a legacy language you have to struggle to maintain work in, or a dead language you had to scramble to convert your work over from.

I wouldn't be surprised if it stays relevant for another 15 years. 
 @f8dfc7e8 @90991173 @ec7374a8 @aecfae5b

I hope PHP or fork will stay with us, and move to Typescript native in the browser + more use of Web Assembly (not just crypto mining ⚒), long live PWA!

BTW I am PWA early adopter, ran Twitter, Instagram, Google News and currently Mastodon as PWA (unf. have installed Android Mastodon too as it can accept shared images - PWA can do that too, Twitter has that feature) ❤️ 
 @ddc3da8f @90991173 @ec7374a8 @aecfae5b
PHP just has too much legacy code still running in it, too many people still using it, too many people still willing to maintain it as a useful standard language, for it to really die at this point.

Other languages I've seen die did so because either there was a proprietary developer backing them who lost interest in maintaining them, or because people just didn't want to use them.

Honestly, I wouldn't be surprised if Google pulled the plug on Go or Rust or whatever they're pushing right here without warning tomorrow, simply because they don't have the attention span.  I also wouldn't be surprised if Microsoft came out with another one that turned out to just be a pile of problems touting features that have been standard everywhere else for the past decade.

PHP has its issues, but we can at least trust that it will be there tomorrow, with plenty of support for whatever we need. 
 @f8dfc7e8 @90991173 @ec7374a8 @aecfae5b

Go and Rust will stay, but making web in Go and Rust is hard, it's slow development 
 @ddc3da8f @f8dfc7e8 @ec7374a8 @aecfae5b the only big limitation of PWA has been Apple not supporting web push notifications, well this has recently changed. I love PWA and their independence on app stores. However I would doubt PHP will ever do it to browser side, you may compile it into wasm and with some react trickery to get it working. But it will ultimately fails the same way as pyscript loading 5MB before app even starts. 
 @90991173 @f8dfc7e8 @ec7374a8 @aecfae5b

there's Python implementation for Web Assembly, my friend works on Golang PWA app (slow dev, many problems, can't easily add JS fns to the DOM) 
 @90991173 @f8dfc7e8 @ec7374a8 @aecfae5b

Apple has many limitations, it's their war on Google

I was perplexed that you even can't use NFC from iPhone to read payment cards

(Global Payments say you must have Android phone) 
 @90991173

which one?

ASP.NET 😂
Ruby 😳
Python 😵
C++ 😶
Nodejs 😂😂😂
Rust 😎🥃
Golang 😎🍸
Java 🐢 
 @ddc3da8f @90991173
Nah brah, he gonna use Perl to push ActiveX plugins. 
 @f8dfc7e8 @90991173

let's make Flash Remake using Web Assembly and some fancy CSS 3 ❤️🍸 
 @ddc3da8f @90991173 
Why bother with CSS, when Active X can automatically add inline styling to your HTML?

Better yet, why bother with HTML, when you could just publish your web page in Visual Basic? 
 @f8dfc7e8 @90991173

let's make a web in Unreal Engine 5 😂 
 @ddc3da8f @f8dfc7e8 why to remake flash, we have PixiJS 
 @90991173 @f8dfc7e8

because remakes are hot 🔥 
 @90991173 @f8dfc7e8

current state of the web dev is No JS = black screen

that's why we need hybrid solutions = PHP + JS, not JS only 
 @ddc3da8f @90991173
I'm just glad the state of web dev has finally stopped being "Use jQuery to do things that could be done in a single line of JavaScript, CSS, or even pure HTML." 
 @f8dfc7e8 @90991173

I still use jQuery even that I like Vue.js

making HTML templates and using clone for rapid population from REST JSON data is awesome 
 @f8dfc7e8 @ddc3da8f yep, JQ is one of the biggest waste of bandwidth before DOM is even rendered. 
 @90991173 @f8dfc7e8

you can defer jQuery loading, but nobody does that 
 @ddc3da8f @f8dfc7e8 well if someone is using jquery as building block that he can’t defer while he needs to use it from beginning. Not mentioning the mess with shadow DOM. 
 @90991173 @f8dfc7e8

everything can be deferred, it's just laziness 
 @90991173 @f8dfc7e8

I have moved jQuery to cdn.gscloud.cz so it's at least closer to the customer (Cf Pages) 
 @ddc3da8f @90991173
The issue I've always had with jQuery is that people use it for things that take more time to do in jQuery then they do in pure JavaScript, CSS, and HTML.  Like, I've been baffled for years by people using it for things like expanding / collapsing divs (JS) dropdown menus (CSS) and input forms (HTML).  Finally, W3C has made this push of overstating the additions they've made the things like HTML5, pushing people to learn how to do it the normal way, and now these people are finally using the stuff that's been in there all along thinking these are new features that replace jQuery.

I have no idea why jQuery got so popular in the first place, but I can only assume it's a combination of good marketing and bad teaching. 
 @f8dfc7e8 @90991173

because $('#fuck').click(function(){}); is so easy to write
or $('#fuck').toggleClass('shit'); 
 @ddc3da8f @f8dfc7e8 tbh, NOJS = blank screen happens when someone disabled it, I don’t see the difference with PHP on client side, if someone disable JS for sure, he will disable PHP also. 
 @90991173 @f8dfc7e8

I am just saying that I prefer HTML output through PHP, then progressive enhancement through JS 
 @ddc3da8f 

Of the ones you listed the only acceptabke ones are:

Ruby
Python
C++
NodeJs
Rusr
Golang
Java

@90991173 
 @b05df304 @90991173

for Web Servers? shit no 😂 
 @ddc3da8f 

Depends what your writing it for... ill be honest while im happy to run a php app despite the fact that i know how to code in php id never personally code up an app in php, thats just my preference

@90991173 
 @b05df304 @90991173

I write mediocre apps since 1998
David Grudl is our PHP God (Nette framework, Tracy, NEON) 
 @b05df304 @90991173

BTW our famous Czech @8aabb2c9 maintains PHP PPA for Debian and Ubuntu 
 @b05df304 @90991173 @8aabb2c9

also KNOT DNS created by Czech NIC is used by Cloudflare

Czechs everywhere 😜😎 
 @ddc3da8f @90991173 @8aabb2c9 

No shortage of thrm in this business for sure. 
 @b05df304 @90991173 @8aabb2c9

I think that Czechs are only well known for beer and contact lenses 😂 

most people don't know about KNOT DNS server or polarographic analysis... 
 @ddc3da8f @b05df304 @8aabb2c9 yep Jaroslav Heyrovský received Nobel Price for polarography and electrochemistry. 
 @90991173 @b05df304

Czechs received 6 Nobel prices 
 @b05df304 @90991173

anybody who tried nodejs knows it's a hell

Rust and Golang for Web? sure, your productivity will drop to 5 % 
 @ddc3da8f 

No i agree most of those languages arent the best for web apps.

Nodejs works, i dont like it as a web app server side language but it works (id take it over pho)... rust and go lang suck, php is better those are your only other choices...

Ill take ruby, java, or python over ruby for a webapp in a beartbeat though

@90991173 
 @b05df304 @90991173

I know about Ruby companies in Czechia - all available rubyists work there, like 30 😂 
 @ddc3da8f @90991173 

Never claimed ruby was a great choice for work. Just that id use it over php if i were picking a modern web project if those were my choices.

Personally i wouldnt use ruby for webapps, though i love it for scripts and personal projects. 
 @b05df304 @90991173

the only fine thing about Python is their beer session Pyvo 
 @b05df304 @ddc3da8f if you say Java, we should also say Kotlin. However if I would be tasked with 5+ nines SLA than I would take into consideration Erlang/Elixir perhaps Scala with their Actors models. 
 @90991173 @ddc3da8f 

I was sticking to the list fred used 
 @90991173 @b05df304

Kotlin is good! I wrote my first K app for Android some 5 years ago even without any K knowledge, that's awesome 😂 but who likes compilation and fucking with Play Store when there's PWA 
 @ddc3da8f @b05df304 I was referring to using Kotlin in Backend side 
 @90991173 

Most php programmers in my experience dont have a clear separation of front and back that talk via a rest layer like we tend to do with modern web apps.

@ddc3da8f 
 @b05df304 @ddc3da8f and if they do, they than do not separate data model and this will kill them during horizontal scaling because they are not stateless :-) you have idea how many state full micro services I have seen in my live in terms of for example login sessions. Technically impossible to horizontally scale. 
 @90991173 

Preaching to the choire

@ddc3da8f 
 @90991173 @b05df304

my CMS is sessionless, I can scale up right away 😂

(Sodium encrypted cookie for Auth) 
 @90991173 @b05df304

well, Redis sessions will do

when Redis crashes, the whole system crashes

🤔😳 
 @ddc3da8f 

thats why you run redis in a high availibility cluster itself... To create high availibility servers all your services need to be capable and running in high availiblity mode as well (usually means multiple servers all staying in sync somehow)

@90991173 
 @b05df304 @ddc3da8f and we are back to Erlang/OTP and distributed Mnesia, never understood how someone can name data storage system like this :-) 
 @90991173 @b05df304

PHP session cookie is the worst shit concept I have ever seen in my life 😎 
 @90991173 @b05df304

I have seen PHP session problem solutions like MySQL storage, Redis, NFS, rsync and Syncthing.... 😂 all the worst nightmares possible 🙆 
 @90991173 @b05df304

authentication should be baked into Auth cookie, encrypted, protected

session data should be in local storage and sent when needed as an encrypted object 
 @b05df304 @90991173

high availability hell 😂

then you migrate everything to Cloudflare and pay $200 a month from Bali 
 @b05df304 @90991173

There are only 3 important hard problems to solve in IT.

1. Correct addition and subtraction of 1.
2. Cache management. 
 @90991173 @b05df304

what's 5+ nines? 🤔 
 @ddc3da8f @90991173 

5+ nines sla refer to very high availibility servers. 
 @b05df304 @90991173

I'd still go for PHP 8.2 😂 
 @ddc3da8f 

To each their own, you write in whatever you enjoy...

All I know is I dont mind running a php web app, they are easy enough to use for a system admin for a service...

But I will never ever start a project in php and would avoid programming the language if I ever could despite understanding the language.

@90991173 
 @b05df304 @90991173

and that's correct way to do it ❤️

I plan to rewrite my CMS to Golang one day, but for prototyping it's not well suited 
 @b05df304 @90991173 

my Hetzner server has 246 days uptime

we had over 300 days as a common uptime on OpenBSD in the 90s