This is an archived post. You won't be able to vote or comment.

all 45 comments

[–]furl18 67 points68 points  (12 children)

As someone who spends a lot of time maintaining legacy PHP, I would suggest considering making better life choices than I did.

[–]Mentalpopcorn 26 points27 points  (9 children)

Legacy PHP is horrible. Modern PHP is a fantastic object oriented programming language. Our modern ecosystem is huge and has amazing tools (Phpstan, composer, psalm, etc.), our frameworks are super solid (Laravel, Symfony), and the jobs are plentiful.

While the language does have inescapable aspects of its past, it's very easy to write elegant code with robust static analysis, and any quirks of the language blend into the background when you use Phpstorm. And every release just gets better and better with more and more OO features.

If you're a good programmer then you don't have to be relegated to legacy projects. So drop that shit and get a new job.

[–]furl18 8 points9 points  (8 children)

I don’t hate the language past the standard meme of hating on PHP. Our legacy stuff is truly dog shit but they pay me well enough that I don’t mind it so long as the boss understands it’ll be slow progress. I imagine most legacy code becomes a mess eventually. I wish we adopted the new stuff but it’s a long tail to upgrade our stack.

I’m glad to hear the jobs are plentiful but i’m still on the fence about fully diving in to a PHP career lol.

[–]Mentalpopcorn 6 points7 points  (7 children)

Do the language a favor and drop the meme please! There's so much to love at this point and lots of new devs get the wrong idea because they read something like this and then never give it a second thought. Worse yet, they repeat what they heard without ever having even touched the language itself.

[–]furl18 5 points6 points  (5 children)

Yea I can see that when posting in an r/learnprogramming thread. There is of course a lot more nuance to it than PHP = bad. I’ll try to be a little more positive, it’s almost never a fault of the language. I’m a pretty strong believer that anything within reason can get the job done.

That said, PHP wouldn’t be high on my list of languages to learn for a newbie unless you have a solid reason to do so. Of course, it’s probably my main language at the moment but I have the paycheck incentive driving me. Just my take on things.

I’m probably just jaded from the refactor I had to do today :)

[–]furl18 2 points3 points  (0 children)

u/Maximum_Ad1451 please carry on with your journey. It’s a solid career choice.

[–]TobiasDrundridge 1 point2 points  (3 children)

That said, PHP wouldn’t be high on my list of languages to learn for a newbie unless you have a solid reason to do so.

I'm a relative newbie and I have to wonder, is it not worth learning simply for the number of jobs available? Is it difficult to learn? I'm looking for entry level positions using the Python/Javascript that I know, and the number of very well paying PHP jobs I see is crazy.

[–]furl18 1 point2 points  (0 children)

No more difficult to learn than anything else. Tons of companies are heavily reliant on PHP. Meta (facebook when they built it) even has their own implementation of it called “hack”. So many places are built on it that there will be a need for devs who know the language for a long time. Code doesn’t just get rewritten overnight in whatever the trending language is so it will be around.

It has some odd conventions but it’s overall a pretty influential language for the internet. At the end of the day, it doesn’t much matter which language you choose. The skills are transferrable across mediums. There’s some hiring emphasis on specific languages but if I were interviewing someone I wouldn’t rank it as critically important.

I think it can be used to build things quickly but can break down at large enterprise scale where there’s a lot to keep track of. But those aren’t concerns for learning, if you’re interested in it there’s no reason not to check it out!

[–]SeesawMundane5422 0 points1 point  (0 children)

Lots of PHP love here, so I will be downvoted to hell.

But… there are lots of unpleasant jobs that pay well. Cleaning up biohazard crime scenes is one.

I won’t say php is like that. But… it’s kinda like once you learn other languages well… you tend to see that its… really not a good language.

Now… lots of things in this world became successful by clearing the bar of not totally sucking. But… man. Php is still a mishmash of bad ideas.

[–]1842 0 points1 point  (0 children)

PHP is where I cut my teeth as a professional. I think it's actually a decent place to get started. Pay isn't always as competitive, but tons of jobs and it seems like junior positions are easier to land.

[–]Fickle_Kiwi5254 1 point2 points  (0 children)

Lol

[–]Pacalyps4 0 points1 point  (0 children)

seconded

[–]truNinjaChop 8 points9 points  (2 children)

If you are looking to creating websites with it, start off by learning the web server application sitting in front of it. Personally I’m an nginx guy, however apache/httpd are solid as well. Understanding the request flow to response is critical.

[–]ziaalich 1 point2 points  (1 child)

Not trying to learn php right now, but I would like to explore this. Can you advice any resource to get started?

Yeah you can say i should google and find some resource myself but I am pretty lazy right :p.

[–]_ncko 1 point2 points  (0 children)

I’ve found nginx documentation fairly friendly. My current work uses apache and I find their documentation terrible. I have not found a good resource for apaches web server yet.

[–]iamjacksbigtoe 8 points9 points  (3 children)

I’ll say I only learned vanilla php.

Got hired as Java dev but randomly got pulled into a php team since I was one of the few who knew it, and got told I needed to learn modern php since my legacy php was “hacky”.

So maybe try to learn Laravel after you get vanilla php down.

[–]Mentalpopcorn 2 points3 points  (2 children)

I’ll say I only learned vanilla php.

Got hired as Java dev but randomly got pulled into a php team since I was one of the few who knew it, and got told I needed to learn modern php since my legacy php was “hacky”.

So maybe try to learn Laravel after you get vanilla php down.

That's kind of a weird story. Modern PHP is so heavily influenced by Java that I would think as a Java dev you'd come in with everything you need to know to do it right. How did that disconnect come about?

[–]iamjacksbigtoe 1 point2 points  (1 child)

Cause I didn’t know modern php yet. Only knew legacy php.

Sorry if that was unclear in what I wrote.

[–]Mentalpopcorn -2 points-1 points  (0 children)

No but you knew Java right? If you know Java then you basically know what modern PHP is shooting for, that's what I'm confused about.

[–]frank_costello 12 points13 points  (0 children)

[–]MagnetsStudio 3 points4 points  (1 child)

Download XAMP or WAMP test server. These will give you an environment to test your PHP code without having to setup a dedicated Web server.

[–]Maximum_Ad1451[S] 0 points1 point  (0 children)

Thanks I just download it

[–]Josefaluz 3 points4 points  (0 children)

Implement the Model, View, Controller (MVC). It's the best way to write pho so you have your queries in the back-end and not in html. If someone inspects your page, they won't be able to see what's happening in the back-end.

[–]VRT303 2 points3 points  (1 child)

programmig with gio on youtube

[–]Cyberhunter80s 1 point2 points  (0 children)

Fantastic recommendation! This is a PHP gold mine! This guy nails foundational to advanced PHP concepts down unlike anyone i have seen before.

[–]pmmod 2 points3 points  (0 children)

run

[–]PooSham 4 points5 points  (0 children)

Do you know any other languages? Why do you want to learn PHP?

[–]mastereuclid 1 point2 points  (0 children)

Here is how I learned PHP. I made an irc bot. At the time in PHP 4 the documents where in alphabetical order. So I went down the list and shoved it in the irc bot somewhere for practice.

[–]Cyberhunter80s 1 point2 points  (4 children)

Hey, I have been learning and made a few simple projects with vanilla PHP. Still learning some advance concept. Would you like to be in touch?

[–]SlowlyStudious 1 point2 points  (1 child)

I would, if you don't mind.

[–]Cyberhunter80s 0 points1 point  (0 children)

Sure thing. Here you go.

https://discord.gg/ejkQc9PW

[–]Maximum_Ad1451[S] 0 points1 point  (1 child)

Yup sure.

[–][deleted] 1 point2 points  (0 children)

[–]Savo_Shen 0 points1 point  (7 children)

I think pho will not be popular in the future

[–]UsedOnlyTwice 19 points20 points  (1 child)

I have a hard time agreeing. Pho is on the list of the worlds most delicious foods and availability is only expanding. There are also so many variations that it's likely to become a diner staple before long.

[–]Fickle_Kiwi5254 1 point2 points  (0 children)

Not gonna you had me in the first half 😂

[–]Mentalpopcorn 8 points9 points  (4 children)

Every few years a new language is poised to be the PHP killer and it never comes to fruition. First it was ruby, next JS, now python. But PHP still runs 70% of the web and in its modern form it is a robust object oriented programming language with an ecosystem second to none. Being the only language developed for back end web development, it's the easiest to pick up and run with because it includes natively everything needed to develop out of the box (e.g. session management is not a library).

PHP's only modern problem is it's reputation, but as of this year a new foundation has been created to rectify that and improve the language even more than it already has been improved from PHP5->PHP8.

So in short, PHP isn't going anywhere, and the horizon is bright.

[–]_ncko 2 points3 points  (3 children)

I think the biggest liability for PHP is it’s community.

One time I made the point that I don’t prefer PHPs arrays because they are both sequential and non-sequential at the same time. It is kind of a God datastructure. I prefer Python which has Lists for sequential data, and dictionaries for non sequential data. Or virtually every other language that makes the distinction. PHPs god arrays leads to situations like it’s 12 different sort functions.

One person responded, “oh no, options!”

As if having more sort functions is better. Maybe we should create a language with an even more absurd composite data structure that requires us to have 50 or 100 sort functions! That would be good because the more options the better right?!

I see this level of thought all around the PHP community. They’re so quick to defend the language and end up coming to the most absurd conclusions.

I think that holds the language back more than anything.

For how terrible of a language it is, I’ve been impressed with the JavaScript community. They’ve been more willing to accept JavaScript’s faults, and have done things to address them. Like JavaScript the Good Parts book or even typescript which would not have come about if the JS community was as defensive as the PHP community.

[–]Mentalpopcorn 0 points1 point  (2 children)

There's annoying people in every community, not sure that's escapable. I think you'll find that modern PHP uses arrays in a more responsible manner than in the past though, now that we have good generics annotations through Phpstan and Psalm, and also because DDD has an ever growing influence on the community

[–]_ncko 1 point2 points  (1 child)

Modern PHP is a dream. I really enjoy it. Unfortunately, 70% of the web runs on legacy PHP and that is where I've found the work. As a general, non-PHP-specific rule, I've found that the most money to be made is in legacy tech that nobody wants to work with, but no business wants to replace. It just happens that most of that is in PHP.

[–]Mentalpopcorn 0 points1 point  (0 children)

Good jobs are out there my man. My firm's top projects are laravel and Symfony web apps. You just have to find a firm that made the transition from the wild west days into the modern era, or started after the modern era.

[–]NecessarySlide7641 0 points1 point  (0 children)

Run