[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
What's so bad about PHP?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 34
Thread images: 4
File: it.png (12 KB, 722x350) Image search: [Google]
it.png
12 KB, 722x350
What's so bad about PHP?
>>
that python exists
>>
>>54645182
It was developed by cis white males.
>>
It's not hipster enough.
>>
The programmers.
>>
>>54645204

But the inventor of it is a fucking white male
>>
There's just so much.

The type system is completely broken. Take some arbitrary values and > < and == them, and see what happens.

The standard library usually (poorly) wraps C functions (return variable function parameters in a scripting language?), and if they find that one of their implementations is broken (mysql_escape_string), they don't just fix it, they add another implementation (mysql_real_escape_string).

The lexer is garbage. Not only does it transform literals into whatever type it seems fit, it also doesn't even build an AST.
>>
>>54645227
pls stop oppressing me
>>
>>54645182
/g/ said it sucks, and that's enough for me.
>>
>>54645232

> The type system is completely broken. Take some arbitrary values and > < and == them, and see what happens.

Huh, well that seems like a pretty significant problem, not really looking forward to working with it in the future.
>>
>>54645232
>mysql_real_escape_string

this is the kind of shit that makes me kek about php.

they fucking take backwards compat WAAAAAAAAAAAAAAY to seriously.
>>
>>54645182
Nothing really. It is yet another scripting language that makes accessing a database for web display / updating easy for everyone.
>>
>>54645280
they break backwards compatibility in the mysterious ways their type system and lexer behaves all the time by accident, and their test suite is fucking broken last I checked as well, so they're just fucking incompetent at it and try to overcompensate.
>>
Oh yeah did I also mention that they managed to balls up their implementation of the Mersenne Twister PRNG? You know, the one with the widely available reference implementation released under a very liberal license?
And they don't want to fix it for backwards compatibility, just in case somebody depends on the non-randomness of an RNG.
>>
<?php echo 3 + "3"; ?>
6
>>
Typing is meh. For a language that feign dynamism, having a string concatenation operator that causes compiler errors is a nuisance.

I also feel like so much of it pigeonholes itself into using associative arrays with dimensions that make it seem like you're writing some tensor nonsense.
>>
>>54645182
Horrible default functionality that turns your webapp into swiss cheese security-wise. Incredibly lax error handling. In general, where other programming languages would report programmer error, PHP does the least sensible thing then continues on as if nothing happened. Very odd default function names selected entirely to optimize a shitty choice of hashtable implementation. Everything is inconsistent as all hell.

Only reason to program in PHP is because halfway decent CMS platforms use it. Other than that, literally anything is better - yes I'm including both Rails and node.js in this.
>>
>>54645393
This is the reason why I actually love PHP. No need for casting shit. If you want to do something quick and dirty, this is awesome. Not trolling.
>>
>>54645436
>In general, where other programming languages would report programmer error, PHP does the least sensible thing then continues on as if nothing happened.

Error reporting should be on by default. If not, you have to set the option.
>>
There is no central philosophy as to how things should work in PHP.

Every part of the language does the similar task differently because they were designed by different people at different times in ad-hoc fashion with no central planning.

On top of that, weird mish-mash of poorly-wrapped around C libraries mean idiosyncracies of these libraries' designs also plague PHP.
>>
>>54645598
This. I wouldn't use it for real projects, but for prototyping small shit? Hell yeah, easy as fuck.
>>
>>54645182
Nothing, spergs here are too dumb to domain it properly
>>
It has a bad rap because it's incredibly easy to use, which means there are a lot of people that have no clue what they're doing using it.

Personally, I like it. It's available anywhere and has a lower barrier for support than other niche shit like node.
>>
It's not Haskell
>>
>>54645706
> It has a bad rap because it's incredibly easy to use

No, it has a bad rap because it's poorly designed. Var prefixes, first class functions via passing strings, even within core libraries they can't figure out a consistent naming convention, and a really poorly bolted-on class system all combine to make it actively hostile to people trying to write code at scale.

> other niche shit like node
m8, I don't have any particular love for node but calling it niche in 2016 makes you sound like a hick.
>>
>>54645291
This
>>
>>54645393
Literally the smartest programming language. Not PHP's fault these faggots can't figure out how to add 3 and 3
>>
File: 1450883301802.jpg (139 KB, 1280x720) Image search: [Google]
1450883301802.jpg
139 KB, 1280x720
>>
>>54646780
>I throw things together till it works...
Programming 101
>>
>>54646724
All the shit you listed is only a problem if you're inexperienced with PHP. And talking about writing code at scale, Facebook utilizes PHP in some parts. It's not a problem and applications far larger than anything you will ever use build with it.

>but calling it niche in 2016 makes you sound like a hick
There isn't a single enterprise application that runs on node. You don't see it anywhere except in hipster shit. It's niche.
>>
>>54646885
>All the shit you listed is only a problem if you're inexperienced with PHP
Wrong. With enough experience with brainfuck you can work around it but that doesn't make it a good language. There's a difference between a steep learning curve and shit design you can learn to live with.

> Facebook utilizes PHP in some parts
So what? Does facebook uses node as well, is that an endorsement of javascript? Does that mean there are no design issues in that language?

>There isn't a single enterprise application that runs on node
What the hell is your definition of enterprise? Again, facebook uses node, as do netflix and paypal. Mind these are all polyglot shops but then most large companies are. It's not even close to niche.
>>
Using a programming language of a guy who couldn't think of a hash function and rather fucked up the naming of his whole standard library...

Yeah enjoy your
>string_copy
>scpy
>str_cpy
>str_copy
>str_cpyiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
>_s_t_r_c_o_p_y_
you dumb sheeple
>>
File: 1463260825598.jpg (81 KB, 607x704) Image search: [Google]
1463260825598.jpg
81 KB, 607x704
>>54645232
>it also doesn't even build an AST.
Holy crap it didn't know that.
>>
File: 1455026692003.jpg (53 KB, 534x477) Image search: [Google]
1455026692003.jpg
53 KB, 534x477
>>54645182
>What's so bad about PHP?

4chan telling you it's bad but the site is built on PHP Just stop wasting time and go program.
Thread replies: 34
Thread images: 4

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.