473,385 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Why PHP gets so much hate?

I am new to programming and I've seen lots of posts making fun of PHP. Why does it gets so much hate? What language should I learn for web developing instead of it?

EDIT: Considering the fact that I already know JS.

PHP is incredibly popular. A lot of very useful things is written in PHP or what started as a dialect of PHP including WordPress, Facebook, and Wikipedia. PHP is ubiquitous and incredibly easy to get started with and so a lot of developers of very different skill sets have used PHP and written about it. As a result, there are a lot of tutorials, blog posts, and projects which demonstrate poor or unsafe practice.

Additionally, earlier versions of PHP made it difficult to write good code. PHP strives for a low barrier to entry and ease of use and this resulted in some terrible design decisions such as magic quotes. Aspects of the language from this time are often inconsistent from the perspective of someone using the language.

However, the language has seen steady improvement over the last several years. PHP 5 and PHP 7 have gone a long way towards transforming it in a modern language and resources such as PHP the Right Way demonstrate how to use the language effectively. Some old cruft still exists because it’s hard to change existing code but a lot of it is mitigated by an IDE that understands the language.
Dec 22 '20 #1
4 6048
dev7060
636 Expert 512MB
PHP is as secure as any other language. The application code is as safe as the programmer makes it. Online content covering the insecure code can not be a factor for the judgment. Ignorance and bad practices of the individuals is probably the worst excuse to blame the technology.
Dec 23 '20 #2
I was wondering the same thing myself.
Dec 23 '20 #3
bakertaylor28
45 32bit
PHP is ubiquitous and incredibly easy to get started with and so a lot of developers of very different skill sets have used PHP and written about it. As a result, there are a lot of tutorials, blog posts, and projects which demonstrate poor or unsafe practice.
First of all, what you have to contend with is how "up to date" a tutorial, etc. is. For example, prepared statements didn't even exist before around 2004, and therefore you're not going to see them in php tutorials from before then, and not a lot for some time after- because after they put something in the code, it takes time for the news to get around and enough people to learn it before we start seeing it in tutorials and the like. As the language changes, so does the basic way of doing things. This is true for ALL languages- not just PHP.

Second of all, about the worst thing that can happen with PHP is someone drops your SQL database tables and steals everyone's account information. By comparison, about the worst that can happen with a high-level language C++, Python, Perl, etc. is someone installing a BIOS rootkit on the server. Simply put, high level language = even more nefarious things that can be done within theory, and even higher stakes when it comes to security. Simply put, the more a language is capable of, the worse the possible security implications are- Therefore, we must select the right tool to accomplish that which we want to accomplish considering what capabilities we need (perhaps sacrificing some of the capabilities we want).

Chances are, if you're not designing PHP code to be secure, you're probably not going to be securing your C++, Java, JavaScript, Python, Perl, Ruby, (fill in the blank here) code either, because those languages are much more difficult to learn than PHP is. While some languages are easier to write secure code in than others, you still have the accessibility issue of most people being able to grasp the syntax beyond a "hello world" script. That's one of the reasons we see more PHP on the internet than any other language. (that and languages like ASP are proprietary and come with a price tag. This was one of the things that killed VisualBasic - Microsoft quickly found out that people were willing to bootleg it before they were willing to pay for it.)
Mar 2 '21 #4
bridgetb4045
1 Bit
I still like PHP because it's easy to use
May 16 '21 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

25
by: Mark Hahn | last post by:
There is a new release of Prothon that I think is worth mentioning here. Prothon version 0.1.0 has changed almost beyond recognition compared to what was discussed here before. For example: the...
5
by: Jeremy | last post by:
I have a very large HTML form (with about 50 fields) that's being submitted to an ASP page via the "POST" method. I don't use "GET" because the data would probably exceed the limit allowed in the...
10
by: in | last post by:
I hate static variables and methods. Hate them. HATE THEM AAAAAAAAAAAAAAAAAAAAAAA!!!!!!!!!!!!!!!!!!!!!!!!!!!
111
by: JKop | last post by:
Okay here we go, I feel it's about time people conversed about the bullshit aspects of C++ (including the bullshit stuff brought forward from C). I'll begin with a few of my own grievances: 1)...
92
by: Jeffrey P via AccessMonster.com | last post by:
Our IT guys are on a vendetta against MS Access (and Lotus Notes but they've won that fight). What I can't understand is, what's the problem? Why does IT hate MS Access so much. I have tried...
27
by: Riaan Cillié | last post by:
Hi I'm trying to learn C, but I am struggling with using scanf and a struct. I want to define a structure and declare a variable of that type in int main. This has to be passed to a function and...
57
by: Eric Boutin | last post by:
Hi ! I was wondering how to quickly and safely use a safe scanf( ) or gets function... I mean.. if I do : char a; scanf("%s", a); and the user input a 257 char string.. that creates a...
13
by: Academic | last post by:
I have a MDI form, sometimes child forms and sometimes forms that are neither If I close the app the child forms closing and closed event happens followed by the Mdi form receiving the...
40
by: PJ6 | last post by:
I want to rant, but I'm too busy at the moment. Who else hates working in C#? What's your biggest pet peeve? Paul
15
by: Jon Davis | last post by:
Bill Wagner posted something here .. http://msdn2.microsoft.com/en-us/vcsharp/default.aspx "Local Type Inference, Anonymous Types, and var" "Of all the features in C# 3.0, local type inference...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.