Its pretty trendy to hate PHP nowadays but I really like it because to me it seems incredibly simple to use...

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?

Other urls found in this thread:

eev
stackoverflow.com/questions/18712338/make-header-and-footer-files-to-be-included-in-multiple-html-pages
css-tricks.com/snippets/jquery/add-active-navigation-class-based-on-url/
twitter.com/SFWRedditImages

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.

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

>literally the most kiked programming language in existance

None, because this is an incredibly stupid idea.

...

every scripting language that support html template? Like erb for ruby, eex for elixir

ya new?

I think you're a retarded faggot.

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

"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

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

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

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

You can do both with jQuery.

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

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

That's Java.

Lily

>jQuery.

lmao this isnt 2009 grandpa

I am shitty kitty.

look into R

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.