array,
@array@fosstodon.org avatar

My first was 8.0, still in school, and I confess that I began learning it with the prejudice of it being a junky, terrible language everybody was making fun of. Fast forward ~1 year later, after finishing my internship, where I used full stack mainly, and having discovered that not only it wasn't that bad, but really a pleasure to work with. Not perfect, but perfectly suitable for its use cases and, what's perfect anyway? So reading this has been a joy. :D https://developerjoy.co/blog/php-doesnt-suck-anymore

blu256,
@blu256@floss.social avatar

@array PHP still has some syntax which feels questionable or at least strange (e.g. \ for namespaces) but otherwise it has certainly gotten better. My first PHP was version 5, nice times :')

array,
@array@fosstodon.org avatar

@blu256 Yes, but from my experience, any language I have at least tried has some syntax that feels "weird" at first... It's pretty subjective I believe. Not that it can't be annoying and could be improved though, but I believe that recent additions to the language have actually made it better than it was. Version 5 was quite different from what I've read, was it? :)

blu256,
@blu256@floss.social avatar

@array You are right. But reverse slash for namespaces still doesn't feel right for me at least 😅

PHP8 was a major leap forward for the language IMHO, and I hope it continues to improve. PHP5 wasn't that different, it was still PHP after all, but it sure felt much more restricting and quirky. 🙃

array,
@array@fosstodon.org avatar

@blu256 I totally agree with the backslash, it feels Windows-y, so kind of bad. XD But to be honest I can't remember now a single time I had to write a backslashed-route myself, I guess my code editor imported all that for me. :P

It's in some details, for example, Laravel began using explicit return types and parameters from version maybe 10 (not sure about the exact version), and coming from Java, having explicit types is something I really appreciate (and wasn't possible before, right?) :D

blu256,
@blu256@floss.social avatar

@array It was indeed nice to see explicit types arrive in ~PHP7 (I mainly write in C++ so the feature felt somehow right for me). I don't know about Laravel, I seldom use frameworks. I'm a hobbyist after all, so it works for my projects.

array,
@array@fosstodon.org avatar

@blu256 What I mean with trade offs... I've been doing stuff lately with no frameworks, just vanilla "web" languages. I wrote a bit about that here and I think it encapsulates what I mean: https://fosstodon.org/@array/112348049196060708

hydrian,
@hydrian@twit.social avatar

@blu256 @array

I started programming with at the end of 3.x days and 4 was still in development. has definitely matured nicely. By PHP 7, PHP has really started been hitting its stride. There were lots of growing pains that PHP had to get through. True OOP and tread-safety were big ones in PHP 5.x.

array,
@array@fosstodon.org avatar

@hydrian @blu256 That's, I guess, the beauty of FLOSS, I give thanks everyday to the people who have created, maintained, improved etc. the tools I use on a daily basis. I began with programming just a few years ago so I have missed the development, but I think the blog post I shared hit the point: some people who still think PHP is terrible or even "dead" maybe have the memories of way older versions of the language. :)

hydrian,
@hydrian@twit.social avatar

@array @blu256
isn't going to die anytime soon. One word:

ntha,
@ntha@mastodon.social avatar

@hydrian @array @blu256 Besides WordPress, I also see a lot of greenfield development efforts going on with Laravel and Symfony.

array, (edited )
@array@fosstodon.org avatar

@ntha @hydrian @blu256 Sure, the PHP "corpse" is quite healthy indeed. XD EDIT: and now that frameworks are mentioned, I'm really curious about WinterCMS. One of my colleagues used it in a former job and he said it's really great. :)

ntha,
@ntha@mastodon.social avatar

@array @hydrian @blu256 Wouldn't call the most used web back-end programming language a corpse tbh. It's just not in the current hype cycle anymore. Those who spend their days chasing the latest trends might care about that, but the rest of us who just want to get stuff done appreciate maturity.

array,
@array@fosstodon.org avatar

@ntha @hydrian @blu256 And I totally agree with that, at this point I believe that should be clear enough, right? ;) I'm mostly making fun of the people who make fun of PHP being "dead", which is a trend I've found quite examples on the internet already. Not my opinion, on the contrary. :)

ntha,
@ntha@mastodon.social avatar

@array @hydrian @blu256 Ah sorry, didn't read too far back to have the right context, so assumed corpse in bad-faith rather than in irony. Text based communication be damned!

But yeah, hating on PHP is like a sub-culture at this point. Everyone's favourite punching bag.

array,
@array@fosstodon.org avatar

@ntha @hydrian @blu256 No problem, I guessed you just missed the context. And out of context yeah, that maybe sounded like a trigger, so sorry about that. ;)

Sigh, I don't have much experience (finished my programming AD less than a year ago), but I've already worked with PHP and JS, and next Monday I'll start a full stack position with Java... So I may know a thing or two about programming languages being "punching bags". :P Yet I really enjoy all of them!

ntha,
@ntha@mastodon.social avatar

@array @hydrian @blu256 But you know, after being away from PHP for half a decade doing other languages, coming back to PHP I feel I can have so much impact working for medium sized digital agenies, introducing version control, CI/CD pipelines, proper testing and code quality. Day in and day out my existence actually matters.

As opposed to working with the JS tech stack of the week in a modern start-up and watching my life pass by in agile meetings wondering if I will ever matter.

ntha,
@ntha@mastodon.social avatar

@array @hydrian @blu256 So I guess what I'm saying is, the more people hate on PHP, the more impactful work I have left to take, and I don't mind that one bit.

array,
@array@fosstodon.org avatar

@ntha @hydrian @blu256 Fair enough, and agreed. For me it will be Java now, but I guess that mutatis mutandis it all applies. Java (and PHP) can be seen as old, junky languages, inferior to those new and flashy ones, but most web dev job offers I see are precisely Java (a lot) and PHP (WordPress), if we talk backend/ full stack. I love them both, though. As you say, the maturity of the ecosystem really pays. :)

ntha,
@ntha@mastodon.social avatar

@array @hydrian @blu256 I think Java is awesome, and a really solid choice for when you want to create something that you can be sure to still run fine 10 years later.

array,
@array@fosstodon.org avatar

@ntha @hydrian @blu256 Same, exactly. Actually, seeing what you already posted in your profile I think there's another thing we may agree with: https://fosstodon.org/@array/112348049196060708 I'm not in principle against frameworks, ORMs and so on, but for personal projects and as a learning experience, going down the abstraction layers may have its benefits too! (And yeah, I'm using "raw" SQL statements -sanitized, though- in my project, too).

ntha,
@ntha@mastodon.social avatar

@array @hydrian @blu256 Yeah! The way I run SQL stuff is with my own thin wrapper class over PDO, which instead of a SQL query takes a name of a SQL file, but still passes data through via prepared statements and via sanitization.

array,
@array@fosstodon.org avatar

@ntha @hydrian @blu256 That's great! In Java I'm using dedicated validation classes, then declaring the SQL statements as constants in its own package with placeholders when needed, and then service classes which use the PreparedStatement interface. These are finally called by the servlets, and the data is passed to .JSP views. There's a bit more going on (I have some extra interfaces and factories), but that's the gist of it. Going minimal is great for experimenting and getting a better grasp!

ntha,
@ntha@mastodon.social avatar

@array @hydrian @blu256 Do you assign data to Dto/Model classes (for better editor integration) or just keep it as a HashMap of some kind? In PHP I've been lazy and just keep everything as an array, even though for type support casting to a Model class would be better.

array,
@array@fosstodon.org avatar

@ntha @hydrian @blu256 No, my models declare the attributes (mapped to the database ones), with constructors and getters/setters. That way I can pass the model objects through, for example, factories and interfaces (I use generics) up to the views. In this I was clearly "inspired" by the way say Laravel implements the MVC model. I'm just a noob so take this with a grain of salt, I'm probably doing more than one thing wrong or at least, not the best way possible. ;)

array,
@array@fosstodon.org avatar

@blu256 Frameworks are quite the norm in webdev $jobOffers, so I've had to learn and use them. I've used Bootstrap, Vue (and Vuetify), Laravel, Nuxt, and Express, and I can say that Laravel is really the one I like most. It's really straightforward, saves a lot of boilerplate, kind of puts you on development rails (using sane conventions), has a huge ecosystem... But then again it may be a bit overkill for small, pet projects. Frameworks are mostly trade offs I believe.

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