[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Why is PHP looked down upon?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 57
Thread images: 4

File: php.jpg (72KB, 587x330px) Image search: [Google]
php.jpg
72KB, 587x330px
Why is PHP looked down upon?
>>
The code behind the logo is JS
>>
>>55914120
kek
>>
>>55914059

It's a sloppy language. The way the interpreter reacts to code can be confusing and unpredictable. Many concepts are broken. It's easy, so it attracts the lowest denominator of programmers.
>>
>>55914059
because no one works here and just shit posts, now fuck off and ask in reddit.

sage
>>
>>55914802
>confusing and unpredictable. Many concepts are broken
>It's easy
Pick one, convenient is a more appropriate word.

Also a-fractal-of-bad-design
>>
>>55914059
It's still the most used language to create web applications.
Now php7 is quite stable and very fast compared to other interpreted languages. Frameworks like Laravel, Lumen, Phalcon or Symfony are quite addictive.
>>
PHP's perceived inconsistencies are well documented, such as type juggling during comparisons. The problem with PHP is that in an effort to remain as flexible as possible, it enforces bad habits in inexperienced programmers.

Modern PHP is only as bad as the programmer's unwillingness to learn to use to appropriately, and the same can be said about many other languages and platforms.
>>
>>55914120
Top kek underrated post
>>
>>55915473
It's the most used language for web servers only because you can just change the .html extension to .php and presto, it's a php script that just spits the embedded html to standard out while you figure out whatever php you're actually going to use. If you could do that with basically anything else, say python, php would be dead in an instant.
>>
>>55914059
"To choose an implementation is to choose a tribe" - winging

Sadly, PHP grew from a small project into a language. Which is a horrible thing. But aside from that, PHP tribe is full of plebs. Just like Java is full of secondary education Pajeets, PHP is full of webmasters that can handle conditionals but don't know Comp.Sci.

But then again, try to find a PHP job in innovative areas like NYC, SF, London, Helsinki and you will horrible companies.

Go study Python for Data Science and Scala with Spark. Or get good at Go or Erlang. If you want something that pays and feels like PHP tribe, find a Rails job.
>>
>>55916199

>"To choose an implementation is to choose a tribe" - winging

It's wingolog. You Pajeet.
>>
>>55914120
lmao first thing i noticed as well, good to see first post most obvious post.
>>
>>55914120
Oh my God lol
>>
>>55914802
Wait is PHP interpreted? I knew it was broken shit, but PHP being interpreted is like the shit icing on the shit cake
>>
>>55914059
1. It has a good share of warts, inconsistencies and bad design decision. To be frank, though, no language has more of those than JavaScript, which after years of being universally despised has suddenly became "hip".
2. It has low entry barrier, so tonnes of people with no formal training in programming are writing (and putting in production) tonnes of disgustingly bad code in it.
3. Some ancient, PHP4-compatible, terribly designed abominations like Wordpress refuse to fucking die already.

On the other hand, PHP has a lot of good parts: it's pretty fast for an interpreted language, has a C-like syntax, C++-like OOP model, sane scoping rules, proper type hinting, and real multithreading with no GIL, so being a literal oldfag I'd still take it over Python or Ruby any day even for non-web-related scripting.
>>
File: photo_2016-08-04_19-25-14.jpg (101KB, 720x1280px) Image search: [Google]
photo_2016-08-04_19-25-14.jpg
101KB, 720x1280px
>>55914059
because a lot of beginner programmers use it, code with php is most of the time shit.

also, the language itself is not powerful at all compared to other web technologies like ASP.NET, it has tons of inconsitencies, the compiler is slow (facebook made its own php compiler and instantly managed to get a speed up of 40%)
>>
Don't really understand why anybody would use php.
Basically it's just script that prints out html.
After using just bare lisp web server and making macrso that generate templates that print out html with macros I don't get why anybody would use shit like php.
>>
>>55916708
>the compiler is slow
It's an interpreted language, you retard. Of course running bytecode (as Facebook does with its HHVM) is going to be faster than full interpretation.

>>55917081
>print("<p>Hello world</p>")
>Python basically just prints out html.
>>
>>55914059
Because the one who develop php keep making absurd decisions.

But we'll still use it, because servers are cheap and common and if you know what you're doing you can do decent stuff.

Just keep in mind a simple rule, php makes simple things simpler and complex thing more complicated.

If you need complicated look into java or .net, trust me.
>>
because some sperg on /g/ couldn't land an php job and he was spamming all day that php sucks so now /g/ is riding his dick
>>
Ive got a story about PHP

I was looking for a programming job, and after i figured out which one I wanted I would learn the language needed to get it.

At the time, I did not know what job I needed, so I had not learned any language yet.
One of my friends had a pretty well paying job, and told me there were a few openings in his office. He was not a programmer, so he did not know too much. All he knew was that they had a few programming jobs open.

I asked him what language it needed me to know.

"i think php"

Ok, so i took the next 6 months learning php almost fully. I took SO much time to do learn inside and out of this language.

During this time, my friend went to canada for 2 years, so I did not see him or talk much with him as I was learning.

So I go into the building to apply for the few remaining jobs still open.

THE LADY INTERVIEWING ME TOLD ME I NEEDED TO KNOW PYTHON

I LEARNED THE WRONG LANGUAGE

NOBODY ELSE IN TOWN WANTS PHP

td;lr im gonna kill myself
>>
>>55914120
Holy shit kek
>>
>>55916391
Yeah it's pretty terrible, and at first, error handling is shit because the interpreter is complete penis
>>
>>55914059
because its a joke
>>
>>55918229
Own fault. The web of today only consists out of Python, ES, CSS and HTML.
>>
The official PHP documentation is and has always been filled with extremely unsafe code examples that "programmers" copy/pasted and used everywhere.

Also google PHP: a fractal of bad design, 4chan thinks the link is spam.
>>
>>55918336
What is ES?
>>
>>55918376
ecmascript
>>
PHP is just great if you need something easy and need something strung together very quickly. One of the best things about PHP is superglobals. Show me one language that makes grabbing POST or GET values as easy as PHP.
>>
>>55918376
Ecmascript, commonly known as JavaScript, but it often refers to its newest version; ES6.
>>
>>55918376
It's what cool kids call JavaScript.
>>
>>55918459
>>55918473
Technically, ES and JS aren't synonyms. JS implements ES (bu so does/did Adobe ActionScript) + a bunch of other stuff (most notably DOM and BOM in the case of browser implementations).

Anyway, at the core language lavel ES/JS is such a clusterfuck of inconsistencies and terrible design, it makes PHP looks amazingly well though-out in comparison.
>>
>>55918696
The fuck are you talking about?

It's just a legal issue.
Sun owns "Java" and doesn't allow ECMA to use "Javascript".
>>
>>55914059
I do PHP development. I have come across so much shit in the past 2.5 years that makes me hate it as a language.

array sort functions pass in the array by reference
0 == "php" returns true
Can't typehint scalars in PHP < 7
mysql_real_escape_string vs parameterized queries

Want to lel? Read about "magic quotes". That was a thing at one time.

There are so many more.

>>55918438
$jobs = empty($_POST['past_jobs']) ? $_POST['past_jobs'] : NULL;
OOPS! should have used isset() since empty(0) means that $jobs == NULL now, not 0.
Hope you're not putting that into the database!

>Show me one language that makes grabbing POST or GET values as easy as PHP
Python:
import cgi
form = cgi.FieldStorage()
jobs = form.getfirst("past_jobs", "")

It's really not that much more of a pain in the ass.


There is a reason that people look down on PHP, and it's because most developers do shit like that empty() vs isset() shit instead of wrapping them in a library like Symfony\HttpFoundation\Request

Globals are bad. Superglobals are Superbad.
>>
>>55916391
You can speed it up if you compile it to a C++ binary, but its not great either way.

https://en.wikipedia.org/wiki/HipHop_for_PHP
>>
>>55918971
>magic quotes
They're fucking magic all right. Expecially when your hosting provider suddenly enables them as default for a mistake.
>>
>>55914128
>>55915757
>>55916381
>>55918244
definitely not the same person
>>
>>55914059
If you can't figure that out by yourself you have a problem.
>>
>>55915971
Nah. That's no longer an advantage. That was the killer feature over 20 years ago but today, PHP even sucks as a templating language. No automatic escaping, hideous syntax, verbose, no real inheritance / splitting of your templates....

Even the shittiest frameworks of the shittiest languages have a more suitable templating language now.
>>
File: how is this even possible.png (23KB, 1022x187px) Image search: [Google]
how is this even possible.png
23KB, 1022x187px
>>55915668
>It's documented that it's broken, so it's fine!
No. It really isn't. This language keeps fucking you over because it actively lies to you and deceives you.
>>
>>55918971
> 0 == "php" returns true
The question of whether dynamic type juggling is a good idea or not aside: what value *do* you expect from casting a non-numeric string to int? 14?

>Can't typehint scalars in PHP < 7
Non-issue with 7. That, plus you can't typehing pretty much anything in other scripting languages without some dirty workarounds like putting asserts everywhere.

>mysql_real_escape_string
mysql_* functions have been deprecated for literally ages. Are you on PHP4?

>magic quotes
Same thing.

>OOPS! should have used isset()
Yes, you should have.
>>
Because it's "hip" to hate it, and it's not a meme language.

It's fucking great, and /g/ is going to insult it in any way it can.
>>
>>55918971
>import cgi
ISHYGDDT
>>
My random number generator is only generating numbers that are in the array right below it. The fuck is up with that?
>>
File: le php creator.png (335KB, 1280x720px)
le php creator.png
335KB, 1280x720px
>>55919415
Its whole existence is a meme.
>>
If you can make money using it, do it, nobody honestly gives a shit, 4chan is php.
>>
>>55920857
Just kidding.
>>
>>55921146
And some people might find that surprising since 4chan gets a lot of traffic but it is almost always fast and responsive. Everyone spouts shit about PHP being "slow as fuck", lol.
>>
>>55922164
PHP is not slow, just limited and ugly.
Just like COBOL and other shits.
>>
>>55922164
Current 4chan took some overhaul and optimization to unfuck AFAIK.
>>
>>55922340
Tell me more sensei. I'm a Jr. web dev, this interests me.
>>
>>55922368
Older version reloaded the entire page instead of just fetching new posts and appending them. Needless to say, boards tended to shit the bed during bursts of traffic (aka when /b/tards approached a milestone get). I think moot even blogged about that shit once.
>>
>>55919362
Your image only confirms my point.

Should that be broken? Reasonably, no.
Is it documented? Yep.
>>
>>55922198
Obligatory: https://www.youtube.com/watch?v=5GpOfwbFRcs

"We entered the ranks of the cool kids. Our response time went from 300 miliseconds under PHP to 3 seconds under Ruby. That's a 10-fold increase. It didn't matter though, because we had the architecture we could blog about. When you're a cool kid everyone wants to know how you make Ruby scale. So you write about how you use Redis and Tokyo Cabinet to solve your self-inflicted problem of storing user sessions in a high latency database like it's a big fucking revelation. Sure, we lost paying customers because our website ran like a flaming pile of cat crap, but when you look past the outages and consider the beauty of our finely crafted Ruby source code, you weep openly for joy and thank God you work among poets."
>>
>>55914059

It's still better than Ruby. At least it's assuredly cross platform. It's less secure than Java, but more flexible. Quicker to work with than C#, Easier to learn in than Node, and is more established than Python, but only just.

Yes it's messy, but so are your clothes. You bum.
>>
>>55922435
>Older version reloaded the entire page instead of just fetching new posts and appending them

Because they didn't implement Ajax? That's not an issue with PHP itself.

To your other point, performance issues can exist in just about any language and platform if it isn't properly optimized to meet the requirements.
Thread posts: 57
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.