Live data from Hacker News

An Internet of PHP

timotijhof.net

271–280 of 333 posts

Re: An Internet of PHP

#271

Earlier quoted context omitted.

JSX and PHP are actually seriously different. When you break out of PHP, you're just outputting text to standard output. When you're using JSX syntax, you're constructing Javascript objects that can be manipulated using standard javascript techniques. Anyone who believes they're comparable seriously doesn't understand the task that is before them.

Oh please, I professionally use both daily (enjoy them both), but even I can see JSX is just PHP with extra steps.

Though not JSX, with TSX you get type checking with your markup.

Re: An Internet of PHP

#272
post #219

I'm in my 30s and grew up with PHP since the 2000s. There's still an insane amount of money to be made with WordPress plugins, WordPress support, and more. That industry isn't dead, it's thriving, it's insanely cheap to jump into and not get yourself into debt, and there's tons of people that need help. While people here argue about the 10th "correct" way to do server-side rendering (hey, React says we gotta use RSC…

where do you find work like this?

Re: An Internet of PHP

#273
post #37

I've always liked PHP. You wouldn't pick it for your job interview's coding test if you had a choice (Python all the way there), but it's so intertwined with the internet and what we've learned about programming over the years. First mover advantage kind of deal. And I've never had to deal with ESM/CJS/AMD whatever module nonsense with PHP. No transpiling anything, just edit and refresh. And so many useful functions…

I've gotten a lot of value by being able to go to a library in my vendor folder, and add some var_dumps in there to figure out where my code is going wrong. The way the dependencies works is magnificent.

Xdebug?

Re: An Internet of PHP

#274
I love PHP and MySQL. I'm self taught and I've been writing it since 2007. It has helped me solve real problems at every job I've had since which has helped me advance my career in tremendous ways.

I know PHP is not perfect and I've definitely contributed some hot messes of code in the past as I figured things out. Sorry...

PHP has let me code anything I've wanted so far, so it's a really powerful tool for me.

I'm the guy who built an automated home cinema using PHP and MySQL: I hit a button on a website and it tells a Raspberry Pi to start the desired show.

It selects a Dolby ad, some sort of vintage ad like dancing hot dogs, a couple of trailers, and the feature. It brings the lights up for the credits.

All PHP: https://www.youtube.com/watch?v=Q7YEVGWJjvI

Re: An Internet of PHP

#275

Unfortunately, the current maintainers of PHP have not learned from the success of it. And are driving PHP into the direction of having the rigid structure that Java has. It is so successful because people who build new things are different from people who are paid to maintain old things. That is why WordPress, Wikipedia and countless other successful internet projects have been created using PHP and not using Java.…

Tacit acceptance of backwards-incompatibility is a pandemic in our industry, it was only a matter of time before PHP was infected.

Re: An Internet of PHP

#276
Since PHP 5.3 why would you want to use PHP instead of Java when you're effectively writing Poor Man's Java but without the benefits of the JVM?

Re: An Internet of PHP

#277

Earlier quoted context omitted.

Not to nitpick but choosing a programming language isn't a minor decision nor is switching programming style, e.g. OOB vs FP. Of course I agree with the intend and I too want to work in pragmatic and explorative programming environments trying out different programming languages and styles depending on the project.

> Not to nitpick but choosing a programming language isn't a minor decision In the grand scheme of things, talking solely about software projects not life in general, it kind of is. Most modern languages, are interchangeable, and projects of most kinds have been done with all of them succesfully. As long as the programmers for the chosen language are available, and the libs you want are there, for startups doing some…

Working with Clojure is a world apart compared with any of the others listed.

Re: An Internet of PHP

#278

Earlier quoted context omitted.

This just reminds me of what originally got me into PHP as a teenager. Creating a site for our gaming community in PHP-Nuke was all too easy. Extending it with plugins, and eventually writing my own plugins to show live data from our game server. Now I look back on PHP3/PHP4 with disgust. Globals, function names, massive pieces of code right in the middle of HTML, shell_exec.

> Globals, function names, massive pieces of code right in the middle of HTML, shell_exec. And they're not inherently bad. PHP made the internet fun. Anyone could get going with a PHP enabled host with by creating an HTML document starting with and have a working something that the world could see by end of the day. Today's web development feels like such a drag. In that you need to choose the scaffolding, create the…

This matches my experience. In the old days (mid-2000's) I did a ton of PHP freelance work. This was done mostly with home grown "frameworks", built around HTML form to MySQL database mapping and CRUD operations. This was before REST APIs were really a thing, everything was page driven ("SSR" in today's terms, I guess.) For anything dynamic, we'd use JQuery, make an ajax call, return partial HTML, and inject it into the page. It was actually incredibly productive. I later moved on to Laravel and ditched the home grown stuff for newer projects.

I don't do PHP work much these days (permanent "working from home" made me not want to do any extra work from home after hours), but it felt incredibly productive compared to the more modern tech I've seen in my day jobs. There's a lot of crap to wade through nowadays. A typical small project might have a React front end, Python back end, REST API's, documentation, cloud deployments, on-and-on. Web development isn't fun anymore.

Re: An Internet of PHP

#279
post #66

Earlier quoted context omitted.

> The ability to interleave code and HTML was also tacky and never taken seriously but I think touted highly by some as a killer feature. And yet people seem to keep inventing variations of this as "templating" languages.

That presumably take care of the escaping rules and grammar of the output language, unlike the giant string concatenator that is PHP.

There are actually shockingly few context-sensitive templating languages for php and those that exist don't seem that popular (Latte is the main one I'm aware of). Most of them are more of the giant string concatenation type, maybe with escape by default semantics (e.g. Smarty, Mustache).

Re: An Internet of PHP

#280
post #91

Earlier quoted context omitted.

The most common defense I hear here is that the inefficiency just never mattered.. and if it did it was because the product was a blockbuster success and you could hire to rewrite the slow parts or adopt hack or whatever.

It does not when your project has not 100s of users hitting at the same time. And honestly, which application survives that at first sight and does not need to solve the problem one level higher (like building for load balancing, writer/read databases, etc ).

I mean, generally what matters is how things scale. This type of slowness is trivially solved with horizontal scaling. Not just that, as a design choice, shared-nothing makes horizontal scaling easier. So this type of slowness isn't really the type that matters, and if anything is actually a net benefit at scale. [Unless you are truly latency-critical, but quite frankly that is pretty rare and php would probably not be the best choice for that at any scale]
Post reply on HN