Stupid Question, not an insult: Why is kbin written in PHP?

Is PHP still a relevant language in today's day and age? I know a LOT of languages and it just never occurred to me to learn this one, because anyone I've ever been aware of writing a backend these days would either choose Node or one of several compiled languages. Lemmy uses Rust for it's backend which is highly desireable, many people would have used Golang in the backend world if they desired performance and compilation, otherwise I don't know why you wouldn't just use Typescript. Makes it hard to contribute to IMO.

trynn,
trynn avatar

Of course PHP is still a relevant language today. It's actively developed and there are several very high profile sites that use PHP, including Facebook, Wikipedia and Wordpress. If Ernest knows PHP well, there's no reason for him not to use it. Developer familiarity trumps language trendiness every time.

YMS,
YMS avatar

Developer familiarity trumps language trendiness every time.

Developer familiarity is a huge pro, of course. But language trendiness is important, too. You can try to code in an obscure language that nobody knows, but you won't get many useful libraries and frameworks and tools there. You can code in a language that once was popular and has most of the libraries you'll need, but it will be hard to find other developers to hire or, like here, voluntarily engage in your project.

PHP is still popular enough that these won't really be problems here, but there sure are cases where developer familiarity won't beat language trendiness because it will result in much more work or much less helpers.

EthicalAI,

Ok good to know. I thought it was kinda a legacy support language. Is it a good developer experience? A lot of languages still in use, like Java, I’d never personally touch with a ten foot pole, and are down trending. So that was more my question: do people still like PHP and is it worth starting a new project with in 2023. Why not use a more popular framework like Node?

VerifiablyMrWonka,
VerifiablyMrWonka avatar

It's like a very comfortable pair of slippers at this point. On PHP8 and with a decent framework (optional) like Symfony (kbin uses that) or Laravel (opinionated, but puts the R in RAD) I can knock well tested code out far faster than I can with anything else.

I also like a bit of Go or Node but I'm always drawn back to PHP.

rimu, (edited )
rimu avatar

PHP is huge and more relevant than you realise. There are many many PHP developers.

IMO one of the things holding the fediverse back is that not much of it is written in Python or PHP. Neither are "good" languages but there is a massive pool of developers and they're easy to get up and running.

EmptyRadar,
EmptyRadar avatar

Speaking to its "relevancy", PHP is still by far the most widely used web language (see: WordPress).

There could be many reasons why KBin uses PHP, from general support across the widest range of platforms to accessibility of the language to facilitate extensibility, or even just because that's what they felt most comfortable developing in.

Generally speaking if code is behaving poorly, it's the code writer rather than the coding language itself.

Source: professional web developer with more than 15 years of experience

anansi,
@anansi@jlai.lu avatar

PHP is one of the most known languages amongst professional developers, which lowers the barrier to entry to participate to the project.

It uses known, trusted and tested frameworks, which would make it a bit less buggy than the alternatives.

Most of the time, the fact that a programming language is hyped up at the moment is not the deciding factor. Rust is still fairly new and lemmy is paying for it with low participation to its core compared to its client for example, that uses TypeScript and is easier to understand. It’s still fairly bugged due to the lack of proper frameworks for most things, needing re implementation.

But on top of that, I would say that kbin is built on PHP because Ernest was more comfortable with PHP than any other language.

iByteABit,

I really like Kbin and it’s amazing that Ernest did pretty much everything alone, but I feel like the choice of language will eventually become a bottleneck for the project. A project of this scale needs contributors, but PHP is kind of left in the past relative to other languages, I think many people are put off by it who would otherwise contribute.

Me for instance, I’d much rather contribute to Lemmy which is in Rust and gain experience with an upcoming language, instead of learning PHP just for Kbin and then dumping that knowledge in the closet.

majkeli,
majkeli avatar

I looked to contribute. But yea, no interest in learning PHP though.

0xtero,
0xtero avatar

Is PHP still a relevant language in today's day and age?

Yes, why wouldn't it be. It's been in active development and PHP 8 is actually pretty decent for fast prototyping (which this site is).

JollyTheRancher,

Has pretty great performance nowadays too. I’ve seen benchmarks showing it performing 3x faster on web stuff than python (obviously there are faster choices than either and Python works well with a lot of non web stuff that PHP can’t do well) - PHP deservedly earned it’s bad rap, but they have really turned things around and now I love using it.

EthicalAI, (edited )

Idk anything about it but from reading some of the code it looks like Java but with weird syntax. Not a big forced OOP fan.

rimu,
rimu avatar

No, OOP is optional in PHP.

EthicalAI,

Good to know, maybe I’ll pick up a book. I try to learn a new language every year.

rimu,
rimu avatar

When I say "optional", I mean you can just create a filename.php and start putting lines of code into it, and it'll work fine. But, these days OOP is favored by most and pretty much everyone is using it. So if you are working on code that other people have written, classes are everywhere.

A lot of Wordpress code is non-OOP, though.

czech,

I think Ernest has mentioned that he used PHP for quick prototyping and eventually plans to rebuild with something else. If you look through his post history you'll find something.

EthicalAI,

Yeah that never happens lol

tal,
tal avatar

Reddit was originally built in Lisp -- Paul Graham, an early backer, is super-rabid about Lisp. They eventually reimplemented it in Python.

I do agree that it's not the norm, though.

HidingCat,

Don't know why you're getting downvoted; anyone who's ever done a project of some kind (whether or not it's programming-related) knows that anything doing a rebuild/remake/re-anything has a high chance of not happening. xD

majkeli,
majkeli avatar

I’m currently involved in a rewrite! One of very few in 20 years of dev work. We prototyped our front end in node/js and we’re rewriting in React. We’re largely keeping the express backend, though.

baggachipz,
baggachipz avatar

we prototyped our frontend in node/js

Uh… wut

majkeli,
majkeli avatar

Yep. People make bad decisions frequently. The rewrite was a way of keeping the newer devs on the project (like me) from revolting.

baggachipz,
baggachipz avatar

But node doesn't run in the browser. So was it all SSR?

majkeli,
majkeli avatar

Mainly tooling and a few ill conceived React components that never really fit anywhere and are now polluting our new build process until we are able to rewrite them.

mrbigmouth502,
mrbigmouth502 avatar

As they say, there's nothing more permanent than a temporary fix.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • kbinMeta
  • DreamBathrooms
  • magazineikmin
  • ethstaker
  • InstantRegret
  • tacticalgear
  • rosin
  • love
  • Youngstown
  • slotface
  • ngwrru68w68
  • kavyap
  • cubers
  • thenastyranch
  • mdbf
  • provamag3
  • modclub
  • GTA5RPClips
  • normalnudes
  • khanakhh
  • everett
  • cisconetworking
  • osvaldo12
  • anitta
  • Leos
  • Durango
  • tester
  • megavids
  • JUstTest
  • All magazines