r/PHPhelp • • Dec 23 '22

Solved PHP is a good programming language to study in 2023?

Hi everyone, I started to study programming in this year, In my institute I am studying PHP and I would like you all to tell me if PHP is a good programming language to study yet? Thanks.

8 Upvotes

34 comments sorted by

16

u/ryantxr Dec 23 '22

Yes. Absolutely.

2

u/Sebastianlopez0125 Dec 23 '22

I hear too many bad things about PHP, and also I hear very good things about PHP, But what I would like to know in specific is why PHP is awesome?

3

u/ryantxr Dec 23 '22

Bad things like what? I really want to know.

People say bad things about every language.

Usually people who say bad things are parroting something someone else told them. Or they don’t personally like some aspect of the language like $ variables. Or they think php is Wordpress. Or they are teetering to some bad code someone wrote 12 years ago. Whatever bad things they have to say is all BS.

I have built some amazing things with php. And I’ll stack it up against anything.

1

u/Sebastianlopez0125 Dec 23 '22

Yeah, I think same, and also they say "PHP is very old", and then I think "why do they say that?" Just you see C and C++ 🤦🏻‍♂️.

1

u/[deleted] Oct 15 '23

in my bootcamp there were some jr devs coming fresh out of the bootcamp hating on php.

we talking jrs who have like 6 months of experience and never coded anyhting substantial outside php and basic javascript.

they hate prestashop, wordpress, and symfony but they never coded themselves any c or c++ or python. they just hopped on the hate train just because one of our javascript teacher told us php was trash.

I dont have any problem with php and I would love to master it as jr dev since most jobs are php oriented in some form or another.

0

u/[deleted] Dec 23 '22

[deleted]

2

u/Sebastianlopez0125 Dec 23 '22

Yeah, that is what I like of PHP, But there are people hate it. I don’t understand these people.🤦🏻‍♂️

5

u/HolyGonzo Dec 23 '22

I've been coding for about 30 years, and writing PHP for almost 25 of those years. The complaints against PHP are somewhat legitimate.

PHP has a lot of good stuff going for it. It's easy to learn and make things work, and it's relatively fast.

The main problems, IMHO, are:

  1. It's easy to write code but difficult to write SECURE code. Because PHP is so popular, this can result in there being a lot of bad beginner code exposed out on the public internet. One of the biggest examples of this is the many, many insecure plugins written for WordPress. People will just install a poorly-written plug-in and then get hacked.

So PHP puts a lot of power within the reach of people who don't know any better. An e-commerce application I wrote back in 2001 is still hanging around out there, and I know now that it's vulnerable to all sorts of hacks but I can't do anything about it anymore.

2. PHP doesn't have good support for async or multi-threading. Natively it doesn't have any support for it - you have to rely on extensions to get it. It has started down a path towards some of that with fibers but it's still a ways away from anything solid.

That's not necessarily a terrible thing, since you don't often need async stuff with most PHP use cases, but when you DO run into a situation where you need it and you don't have great options, it can be frustrating.

3. The dynamic data types / type juggling usually seems like a good thing to newer programmers and it can lead to simpler code but it can also lead to unexpected problems.

Is the string "000” the same thing as the number 0? PHP seems to think so if you compare them with ==, unless you do a type-safe comparison ===, but beginners are less likely to do this.

Compare MD5 hashes that begin with "0e#" and you'll see that PHP thinks they are the same value even though they aren't (because PHP is trying to auto-convert them to bad floating point numbers).

So yes, there are some real problems with PHP. They are always making fixes and improvements on the language (PHP didn't have any object-oriented support when I first learned it and now it's pretty decent).

However, for what it does, it's pretty good. No scripted language will ever be faster than a compiled application, but PHP can still be pretty fast if you know what you're doing. And it has a lot of flexibility to let you do what you need to do.

1

u/Sebastianlopez0125 Dec 25 '22

Thanks for your opinion, it’s very interesting. I am a beginner in this industry and I hope to learn too many things of this.

1

u/Longjumping-Bag4294 Dec 23 '22

What most people did not like (mostly about previous versions at this point) was the inconsistencies. Furthermore, people that come from strictly typed languages pretty much always look down on PHP as it is dynamically typed and allows for type juggles.

This in itself has a benefit and a downside. The benefit is that you can hack yourself out of any situation without having to follow any convention. The downside is that it introduces a lot of pitfalls for starting programmers; unbeknownst to them.

--

That said, I think it's a fantastic language to learn. It has very vibrant and busy communities that will help you out at a whim.

2

u/Sebastianlopez0125 Dec 23 '22

I started to study PHP in my institute and I really like it. Its sintax is very simple there are too many communities and people can help you and finally easy to learn.

2

u/Itsemaumau Dec 23 '22

There are lot of people who hate everything. There are lot of people who say they hate but really do not understand how to handle programming languages, as a result they say "I hate this" to prevent you asking them about things they couldn't answer.

1

u/Frosty-Passenger-371 Dec 23 '22

A lot of so-called professionals hate it, and Tell bad things about it, baecause you can learn php all by yourself

3

u/ChrisF79 Dec 23 '22

Yep, learn PHP and then a great framework like Laravel and you're on fucking easy street.

1

u/Sebastianlopez0125 Dec 27 '22

Thanks bro 😎

6

u/Matrix009917 Dec 23 '22

What, Is It even a question? Of course Is It. 90% of web site Is based on php language.

2

u/Nerwesta Dec 23 '22

Thanks to Wordpress, mostly.

4

u/Matrix009917 Dec 23 '22

And prestahop, and Magento, and Joomla? So?

3

u/jack_skellington Dec 23 '22

And Laravel and Symfony.

2

u/Matrix009917 Dec 23 '22

Even codeigniter Is a good choice. But php Is not old, Is another language for web development.

1

u/DmitriRussian Dec 23 '22

And Shopify

1

u/Nerwesta Dec 23 '22

So my answer is pretty clear, by your sentence "xx% is run by PHP on the Web " it's mostly thanks to WordPress. That's it. In no way I wanted to say the other solutions were inferior, it's just not comparable ( I work daily on Symfony so why would I ).

But WordPress is That popular nowadays it has a huge footprint on PHP usage worldwide. I don't know what's complicated with my sentence.

0

u/Matrix009917 Dec 23 '22

That's Is not propertly correct. By the way Is your opinion

1

u/Nerwesta Dec 23 '22

Please provide some additional material if you think what I say is wrong, I'm open to the discussion.

2

u/Phopaa Dec 23 '22

70% of the content on the internet is powered by PHP. So, most likely, you’ll run into it in the wild some where.

1

u/Sebastianlopez0125 Dec 23 '22

Yeah, I know it, That is an amazing characteristic.

4

u/whitewolf08901 Dec 23 '22

Yes every tech stack has its own pros and cons you can learn Php and then learn Php frameworks like laravel and the build some web apps

3

u/oldschool-51 Dec 23 '22

Especially in 2023, as version 8.1 demands some significant changes from 7.4. It is still extremely important (most websites use Wordpress which is based on PHP) and I find it to be the easiest way to generate webapps.

2

u/kAlvaro Dec 23 '22

The main complaints I read about PHP summarise as:

  • In 2005 it missed the great features that other languages have in 2022.

  • It doesn't implement any mechanism to prevent clueless people from producing code.

They then mention alternative languages that have the exact same problems.

Debunking typical PHP criticism with arguments is like discussing "women are bad drivers" with statistics: tiring and pointless. If you like it, just learn it. It won't prevent you from adopting other tech stacks in the future and tons of basic concepts are pretty much the same in every language.

2

u/NoDoze- Dec 23 '22

It's been a great career!

1

u/[deleted] Dec 23 '22

Php and Bubble.

1

u/comment_user Dec 24 '22 edited Dec 24 '22

It depends on your use case.

If you are doing web back end development, PHP and/or Javascript (using Node.js runtime environment) are going to be pretty standard (as well as C#, Java, Ruby, Python). If it is front-end it is probably Javascript (or a variation like TypeScript). If you are dealing with traditional application development, it is probably going to be C++, C#, Java (not that these also do not have application in other areas). If you are doing Quantitative Analysis and/or statistics it is probably going to be Python, R, Matlab, or C++. If it is Machine Learning, it is probably going to be Python, Javascript, R, Java, C++ (although PHP does have a library for this - php-ml ). If it is mobile application development then it is probably going to be Java, Python, C++, Kotlin, or Rust. If it is blockchain, it is probably going to be C++ (Bitcoin), Solidity (ETH), or if it is a Tendermint (now Ignite) and Cosmos-SDK chain then it is Golang (with Rust if using CosmWasm smart contract platform). If you want to write low level - then it is machine, assembly, or more likely portable languages such as C, and then C++ and Rust. None of these are complete lists. It also does not include frameworks that are build on top of any of these programming languages.

If the programming language allows you to easily accomplish your goal, or the goal of a project, and handles extensible issues that may arise in the future, then it will be good for that use case. In most cases though, each language was developed, or extended, with certain use cases in mind - and they do really well for those cases.

If the question is, "what programming languages are most used?" (mainly with the purpose of employment in mind), then it is normally good to look at programming language statistics such as (or job sites):

Hope that helps out a little bit :)

1

u/clusterconpuntillo Dec 24 '22

The fact that you and lot of people aks makes it a reliable program language this days

1

u/joshcam Jan 13 '23

TLDR; Yes!

PHP is widely used to create web applications and is a popular choice among developers for building dynamic websites and web applications. It is a server-side language, which means that it runs on the server rather than in the user's browser, and it is widely supported on most web servers.

PHP has been widely used for more than two decades, and it is still being widely used today. It has a large and active community, which means that there are many resources, tutorials, and forums available to help you learn the language. Additionally, there are many popular PHP frameworks, such as Laravel, CodeIgniter, and Symphony, that make it easier to build web applications and can speed up the development process.

PHP is also a good choice for those who want to work with databases, as it has a good integration with MySQL and other databases.

It's worth noting that the job market for PHP developers is still strong, and there are many opportunities to work on interesting and meaningful projects.

0

u/32gbsd Dec 23 '22

Study C or Basic or Java. Php is full of antipatterns and OOP busy work designed around an increasing number of SAAS tools.