[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]

Its pretty trendy to hate PHP nowadays but I really like it because

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: 29
Thread images: 2

File: unnamed (1).png (41KB, 527x279px) Image search: [Google]
unnamed (1).png
41KB, 527x279px
Its pretty trendy to hate PHP nowadays but I really like it because to me it seems incredibly simple to use. What does g think and why do people hate it so much. And what do employers think about PHP skill?
>>
I mostly hate it because the standard library is a clusterfuck of inconsistency. There are also some questionable things about the language itself like the ternary operator.
>>
>>57529001
Use it for anything more than trivial web programming 101 tasks and you'll understand pretty quickly. For instance, it shits on the concept of type systems. You can't take arbitrary user input and expect it to behave in a sensible way.

"name" + "123" = "name123"
That is sensible and what you would expect. Yet
"321" + "123" = "444"

Error handling is retarded. It supports octal syntax like C. Numbers with a 0 in front are octal, so 010 is 8. Yet if you fuck up and write 09 instead of 9, you don't get a syntax error. It just silently drops the invalid 9 and give you 0.

You can catch exceptions to handle errors, but then there's fatal errors which cannot be caught. It just bombs out and there's nothing you can do to handle it gracefully.
>>
What other languages have tools to let you mix the lang with html like php?

Talking something like
<p><?php echo 'penis';?> </a>
>>
File: kikes.png (26KB, 1178x179px) Image search: [Google]
kikes.png
26KB, 1178x179px
>>57529001
>literally the most kiked programming language in existance
>>
>>57529657
None, because this is an incredibly stupid idea.
>>
>>57529657
<?= 'penis' ?>
>>
>>57529657
every scripting language that support html template? Like erb for ruby, eex for elixir
>>
>>57530002
ya new?
>>
I think you're a retarded faggot.
>>
>>57529001
like C++ it's fine once you know the right parts to never use
>>
Even the guy who made it think it's shit. He never meant it to be used by anyone other than himself
>>
It's fucking ancient and outdated as fuck
>>
>>57529573

"name" + "123" makes error

Character concat in php: "name". "123"


>>op
From now php is not bad you can use lambda (function as parameters) only irritating part is array_map and other_ in function names...

PHP and HTML mixing is bad idea from 2000 tons of template engine out there...
However if you can controll yourself and not put logic into template using php can be a valid solution

These days I write php program only Json output, and make client "app" in HTML with Javascript...

Php session management is terrible I can't protect it, it's a garbage, don't use it at all...

>hating a software
Cmon, have a feeling to not living thing is a bad for you!
>>
comfy when i use it with Oop patterns
>>
PHP got a lot better with 7. Yeah, I still don't use it. But:

>bulit-in password hashing
>built in timing-safe library functions
>secure random number generator
>scalar type hints
>>
>>57529001
Basically, it's easy for noobs like you to learn the basics and slap something together, but when you start digging deeper you realize that the entire language is a horribly designed piece of shit. So for anything beyond a trivial project, it hurts more than it helps. Sure, good programmers can deal with it, but they can also get a lot more work done with a less shit language.

Read this for everything you would ever want to know about why php sucks:
https://eev (dot) ee/blog/2012/04/09/php-a-fractal-of-bad-design/
I guess it's written by a furry or some shit but his points are valid.
>>
>>57529025
>I mostly hate it because the standard library is a clusterfuck of inconsistency.
I agree with this.
>>
PHP noob here.
I use it mostly to stitch together fikes using "include", and for basic things like finding out which is the active page(simple if statements). Is there another language that can do this?

Example, i have the files: header.html, navbar.html, footer.html inside of a folder, and on the main page, there is an index.php that takes those files, as well as the body.html, and puts them together.
>>
>>57538810
No clue what other languages support shit like that but you might want to read up on model view controllers and perhaps find a nice framework to work with that uses it (every single one out there).
>>
>>57538810
You can do both with jQuery.

http://stackoverflow.com/questions/18712338/make-header-and-footer-files-to-be-included-in-multiple-html-pages

https://css-tricks.com/snippets/jquery/add-active-navigation-class-based-on-url/
>>
I thought javascript is not liked because of the vulnerabilities
>>
php was my first programming language back when php4 was the stable branch and php5 with all its object-oriented features was a few years away from being production-ready. php at that time resembled perl most closely; php programs took the form of cgi scripts invoked on an http request: parsed, executed, and shutdown every time

over time the object-oriented features of php5 and the zeitgeist of RoR, django, java, and asp.net style of long-running application/daemons affected the design of web applications written in php: although it still used the previous model of individual scripts being executed on a per-request basis, the scripts emulated the structure of a standalone web application server

still, php lends itself naturally to web development, boasting a standard library which proves extremely handy for the domain and is relatively easy to get started with and understand. methinks the amount of influence java and java developers has had on the language has unnecessarily complicated things a bit, and most of the outspoken proponents of php are themselves naive

also facebook has had a very real and significant role in php's development over the past decade. this should not be taken lightly

php is just as legitimate as ruby, python, javascript or any other interpreted language for web development, but I would recommend go to new developers in $CURRENT_YEAR
>>
>>57539076
That's Java.
>>
>>57529657
Lily
>>
>>57538913
>jQuery.

lmao this isnt 2009 grandpa
>>
I am shitty kitty.
>>
>>57538810
look into R
>>
>>57529001
people hate php because there's a lot of shitty php code. if you write good php code (which isn't very hard), php is a good choice for 99% of web projects.
Thread posts: 29
Thread images: 2


[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.