[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
Why do autists hate PHP again?
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

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

Thread replies: 69
Thread images: 4
File: php-elephant.png (86 KB, 960x670) Image search: [iqdb] [SauceNao] [Google]
php-elephant.png
86 KB, 960x670
Why do autists hate PHP again?
>>
Recalling the exact syntax for the built-in stab() function, you make a sane assumption and call shoot(GUN, FOOT); The foot shoots your gun.
>>
>>52362478
Just use Django
>>
>>52362517
Laravel > Django
>>
>>52362528
You wish
>>
>>52362509
This. PHP's quirks are retarded, the creator of PHP is retarded, the people making PHP are retarded, coding in PHP is retarded.
>>
>>52362478
It's a comfy language despite its flaws. :3
>>
File: php.png (12 KB, 565x365) Image search: [iqdb] [SauceNao] [Google]
php.png
12 KB, 565x365
http://phpsadness.com/
>>
>>52363309
how does that work?
>>
>>52364012
(TRUE ? "a" : TRUE) ? "b" : "c"
"a" ? "b" : "c"
"b"
>>
>>52362528
Both are slow as dirt in the range that it matters.
>>
>>52362478
>TFW it has an own language to compile down to C to create extensions
>http://zephir-lang.com/
>twf it's better than PHP
>>
People base their opinions on PHP off a decade old article comparing it to a double sided hammer of some sort.

All of that is unjust, as currently PHP is a perfectly sane language and it's OOP-approach is miles ahead of that of Ruby or even Go. Besides, it doesn't use whitespace as syntax so that makes it automatically a magnitude better than - included but not limited to - Python.
>>
>>52366567
>PHP
>better than anything

you wish
>>
>>52366530
what is better than Django?
>>
>>52366567
>OOP-approach is miles ahead of that of Ruby or even Go
you can't be serious. you must either be a java-fanatic or simply an idiot who doesn't comprehend what good OOP is.

>doesn't use whitespace as syntax so that makes it [...] better than [...] python
other languages may suck at this, but the way python handles is isn't so bad. i wouldn't mind python having an 'end' statement like ruby instead of whitespace based code evaluation, but at least it forces idiots to indent their fucking code right. more to the point, this doesn't make php a better language than python _at all_ - perl doesn't use whitespace either and just look at it.dear god.
>>
>>52366567
see this:
>>52362509
>>
>>52366567
take it from someone who uses php for anything web backend related:

it fucking sucks
>>
>>52362478
Just use asp(ergers).net
>>
/g/ just hates dynamic languages. And rightfully so.
>>
>>52362478
I made my backend purely in shell scripts.
>>
>>52366975
its funny because i would say the direct opposite

professional PHP dev for the last 5 years.

it just werks

i've built everything from console applications communication over sockets to scammy survey websites with 1 million users a month.

It lets you just get work done and get paid.
>>
>>52362478
they are mad that running a webside is upload and run, instead od getting a phd in some retarded dependency framework based on their language of choice
>>
>>52362478

1) In PHP it is easier to write bad code than in most other languages. But there is nothing inherent in the language preventing you from writing good code.
2) It is weakly typed, this can lead to hard to track down bugs and is a valid complaint.
3) They are mad that someone learns PHP and gets a 100k/yr job and they know some meme language like rust or go and no they are unemployed.
>>
>>52365784
He asked how it works, not "write it again"
>>
File: php.jpg (139 KB, 1280x720) Image search: [iqdb] [SauceNao] [Google]
php.jpg
139 KB, 1280x720
>>
>>52362528

Laravel is garbage, it's an abstraction layer on top of symfony and doctrine to make its syntax like ASP.NET MVC. The best framework I've run across in PHP is called Phalcon. It's compiled into the core of php, which can be a right pain in the dick if you're on shared hosting, and it's syntax isn't as pretty as Laravel, but it's the fastest by a country mile. And before some autistic asshole comes in and starts yelling about how I can increase my RPS by adding more servers, the most important metric from an end user perspective is TTFB, and in that regard, I've written applications in Yii, CodeIgniter, Zend, Laravel and Symfony, and Phalcon gets bits on the wire ten times faster which is a better end user experience.

We had a developer working under me who didn't like Phalcon because he was hopelessly enamored with Laravel. So we both built a simple REST API that made a database call and returned it to the client. We deployed this to our data center, and ran them side by side. Not only could Phalcon handle 4x the requests per second, but Phalcon returned the data in about 12ms, with a 5ms ping to the server, and Laravel took over 200ms.
>>
>>52367108

He didn't write it over, he showed you the execution of the function. It's a nested ternary which is possible in any language and is always a terrible idea as it's impossible to read.
>>
>>52365784
Thanks. I wonder why the precedences are fucked up. Were nested ternary ops broken in Perl 4?
>>
>>52367158
>laravel and zend
>fucking zend

i took a moment of science for you brother

never heard of phalcon but it sounds like a bitch to setup
>>
>>52366560

>mfw I pay pay andres to write phalcon and zephir because my company uses phalcon in its core product.
>>
Why are there countless php webclient solutions like phpmyadmin or phpldapadmin but no java .war alternatives?
>>
There is no reason to like it. It does nothing good and many things very bad.
>>
>>52367193
Actually it's insanely easy, you just need to be able to install extensions on the server. CPanel I think even lets you install phalcon now. The best thing about phalcon is that once the extension is installed, you have access to all the classes in phalcon without any classloading whatsoever because at that point they essentially exist in PHP.
>>
>>52367028
I mean, if your goal is to get a working webapp in the shortest amount of time possible, then sure, php will get you there. It might end up being un unmaintainable mess for everyone else who ever has to touch it again. If you actually care about more than just getting your check, you're not going to use php for anything major.

I'll admit that I'm perpetually mad about this because the poor decisions of some of my predecessors have left me partially responsible responsible for keeping huge, ugly messes of php running and I hate every second I have to spend touching it.

>>52367064
php only just werks because of its prevalence over the last decade means shit like apache's mod_php is enabled by default all over the place, which is a fucking awful approach to running dynamic web backend code. php is only write-'n-upload if you're deploying it in a retarded way that crumbles at any sort of scale. The initial investment in setting up a stack like nginx+uwsgi+whatever framework you want is admittedly a bit more work, but leaves you with a much saner, more versatile environment.
>>
>>52367260

Say it with me. Just because you can write ugly code, doesn't mean you can't write beautiful code.
>>
Backends don't matter anymore with the emergence of backend as a service platforms(PubNub,Parse,Firebase,backand.com) wherein the front end/mobile devs also build the stuff needed for their APIs
>>
>>52367260
no
>>
>>52366560

Zephir is the fucking shit. It's young, but if it gets any serious backing and gets some years under its belt, it is going to fucking rock. Last benchmark I saw it was about 3 times as fast as HHVM and PHP7.
>>
>>52367153
>I'll just restart Apache every 10 requests
holy fuck he actually said all that WTF
>>
>>52366647
As in faster?

A lot of things, even in Py land, it seems:

http://klen.github.io/py-frameworks-bench/#results
>>
>>52367260
i'm sorry but that can happen to virtually any code base, its not PHPs fault someone wrote ugly code.

If you can't figure out what's calling that function, then you have shit problem solving skills and need to pick a new profession.

>>52367255
i'll have to look into that, sounds pretty neat, when you said compiled into PHP i thought you meant like a recompile. That sounds insanely nice.

Stuck with laravel atm
its kinda nice once you get used to it, but feels seriously bloated at times.

ANYTHING is better than zend.
>>
>>52367362
>i'm sorry but that can happen to virtually any code base, its not PHPs fault someone wrote ugly code.
It totally is though. The documentation and the language tutorials all over the web actively encourage people writing unmaintainable spaghetti code. Even Perl 5 has owned up to its reputation of write-only code and the recent documentation really encourages you to write cleanly and well.
>>
>>52367651

>The fact that someone chooses to write code in a ten year old style rather than in a modern OO style is somehow the language's fault.

>>52367362
Laravel is pretty much Babby's first framework. It has really nice, easy to understand syntax for a newbie, but it's just bloated as shit.
>>
>>52367344

Phalcon is almost twice as fast as Django, if memory serves, granted benchmarks aren't very representative of actual use cases.
>>
>>52367153
strlen() is technically a valid hashing mechanism
>>
>>52367153
>but I am probably still better than you :)
given this is directed at CS fags it's probably right
>>
>>52363309
Because it's the way he wrote it to work..

That's the language doing it right... If you put that in another language and got "a", it would not be checking all of the parameters of the call.... B was declared after A so it is the one that is correct.
>>
>>52362478

It's entirely unfunctional. The state of javascript has been in absolute decline since Java was locked down for the internet.

At this point, the best language for webapps is visual basic with a c++ wrapper for rendering. Anything else is absolute trash tier.
>>
>>52368712
no it should stop after the first instance of true
>>
>>52367968
>>The fact that someone chooses to write code in a ten year old style rather than in a modern OO style is somehow the language's fault.
Yes it is, because the language encourages it. Properly designed languages discourage deprecated features and bad code by spewing warnings all over the place, only PHP doesn't do that because if a warning gets written to stdout it breaks bad old web pages that use the bad old style.
>>
>>52368988

>PHP doesn't do that

It kind of does unless you turn off errors.

>>52368918

The interpreter basically turns that unintelligible garbage into ((true) ? "a" : true) ? "b" : "c".

Compilers have to do something with it. They have to give some order of operations. It isn't right or wrong, it's just how the compiler handles that vague code.
>>
>>52369125
its wrong, php is terrible, stop lying to urself
>>
>>52369125
>It kind of does unless you turn off errors.
It only does that for the most egregious errors that would stop the program from executing at all in a better language.
>>
>PHP chuggs along when it encounters a division by zero
10/10 language
>>
>>52369145

Whatever you say, professor.

There two ways to interpret
true ? "a" : "b" ? "c"
.

((true) ? "a" : true) ? "b" : "c"


or

true ? "a" : (true ? "b" : "c")


Just because a language uses one approach versus the other does not make either language wrong. It means that you're a shit programmer if you write code that can't be read.
>>
>>52369243
yeah, if you use semicolons

without semicolons it means to interpret the first instance of true

like if statements

if (a) then
else if (b) then

so your argument is moot, php sucks
>>
>>52369243
One of those interpretations makes sense
The other one doesn't

return cond1 ? value1 :
cond2 ? value2 :
cond3 ? value3 :
default_value;
>>
>>52369270

Don't want the compiler to get confused, don't write shit code.
>>
>>52369291
> compiler gets confused

sounds like a shitty language

also php has an interpreter not a compiler
>>
>>52369310
you can compile it, but its interpreted, this cuckboi thinks it has a compiler, top kek
>>
T_PAAMAYIM_NEKUDOTAYIM
>>
>>52369243
>Just because a language uses one approach versus the other does not make either language wrong. It means that you're a shit programmer if you write code that can't be read.
Fucking this, (almost) every "PHP is bad" example is some ambiguous travesty of logical notation that should have never been written to begin with.

If your goal is to write unreadable code that means nothing clear but gets interpreted the same way the other programming language you threw your shitty code into, PHP isn't the language for you.
>>
>>52369310
>>52369355

You fuckers can't be this stupid. It's compiled at run time you dumb fucks. PHP scripts end up as binary which gets executed, those binaries can be cached in an opcache and executed without any re-interpretation. They are compiled.
>>
>>52369310
>>52369355

>arguing semantics because you have no valid points to make
>>
>>52369542
php is interpreted, can be compiled, please research
>>
>>52367187
Actually it's perfectly fine to do it, because every other programming language that isn't PHP and has a ternary operator correctly makes it right-associative:

TRUE ? "a" : (TRUE ? "b" : "c")
"a"
>>
>>52369243
java codemokey detected
>>
No idea. Only autists criticize one another for another's choice in a programming language. Pick a language based on what you need.
Thread replies: 69
Thread images: 4
Thread DB ID: 399774



[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | 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.
This is a 4chan archive - all of the shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.