Why everyone hates php?

i mean, everyone acts like

>php? rlly? omg haha

i feel old... what has replaced php? should i learn it?

Other urls found in this thread:

medium.com/code-zen/why-i-don-t-use-go-web-frameworks-1087e1facfa4
businessinsider.com/33-startups-to-watch-in-2017-according-to-vc-investors-2016-12?IR=T/#digit-an-app-that-saves-money-for-you-33
pastebin.com/raw/9heNawbT
blog.twitter.com/engineering/en_us/a/2011/twitter-search-is-now-3x-faster.html
db-engines.com/en/ranking
twitter.com/NSFWRedditImage

>Still used on 85% of websites
>but Sup Forums says its pointless to learn

That's why these people are neets here user. They don't fucking have jobs.

fpbp

/thread

It's just a really poorly designed language. It's prevalent because it's so easy to get up and running, but it very quickly becomes painful to work with.

If you can learn to deal with the absolute hellscape that is PHP legacy code, you could make decent money. But it would better for everyone if you just started out with something else entirely instead, Python or Java or something.

because it is poorly designed desu
i use it daily because it is ez as fuck

Slow
Disgusting syntax
Weak type system
Terrible standard library
Terrible 3rd party libraries
Not a general purpose language
No control over processes (spins up a new process and tears it down for every request)

It does shit like "for array as value" instead of "for value in array", has a ridiculously convoluted boolean comparison table and is specifically designed to be included into HTML.

There's still a ton of jobs for it though.

>muh Personal HomePage.
As far as programming languages go, It's like one step up from Logo.

It's a programming language for people who liked Geocities.

Try Laravel

...

Damn what an image. Maybe he's all the anons that are complaining about php here and he just wants it to die so he can be unemployed and watch anime.

Php is fine, JavaScript now there is a cancer in the making!

i dont think people say its pointless to learn, but that its a shit language because of

Golang.

was my first language..but switched to javascript + node.js for my own project.

Its more fun to write JS and JS is way faster than php, at least according to my benchmarks

PHP7 has solved all of the traditional issues with the language.

The whole PHP sucks thing is a bit of a meme.

> terrible std lib
But, php has a build in rot13 encryption function.

False. It's certainly better but it can't fix everything without breaking backwards compatibility, which it hasn't.
Working on PHP today probably won't drive you insane like it would have 10+ years ago.

Vanilla PHP is still used mainly because of legacy websites. Vanilla PHP sites are easy to extend and maintain because there is a simple function API and everything is visible in single PHP files. Its absolutely idiotic to use a PHP framework as all the simplicity is lost and the mechanics of your web app is hidden by the autogenerated features of the framework. So yes, you can still get jobs maintaining existing PHP sites if that is your idea of fun. Very few new businesses will start with PHP.

PHP7 solved most of the performance issues, but none of the design issues.

Guess which one was the bigger problem?

It's very useful to know if you want to do web security.

doesnt Sup Forums heavily use php?

>Performance is fixed
>Still reinitializes everything on every single page load
It can't be fixed without breaking everything.
>inb4 react
No one uses it and almost nothing supports it. But yes, that would work.

Out of 100 jobs I see online daily are 90 PHP, 7 node.js and 3 .NET
you're good grandpa

This is a good answer.

Atleast the script its based on does.

>Why everyone hates php?
reasons
>what has replaced php?
nothing
>should i learn it?
yes

>>Still reinitializes everything on every single page load
>>inb4 react
no, inb4 DOM actually -- have you ever made a single webpage before spouting shit ? fuck off

It's shit nonetheless it's easy to understand to give maintenance. But I don't want to program on it.

This.
When will c++ or haskell be used instead

>I don't.

...

Java? Are you autistic? Python? What the fuck, these languages are cancer.

its fine, just make sure youre using php7+

java is like thw total opposite of autistic. it's used by majority of companies that actually do non-autistic stuff in the real world

Golang is comfy and has a great logo/mascot.

Have you tried writing something besides "fizzbuzz" and "hello, world"?

I have no idea about programming. But doesn't HTML5 do the same phd did?
You can use c++ and Haskell on the web?

>(node) JS is way faster than php
out of the box, probably. PHP 7 + opcache should be similar or faster in performance.

Name a better language for building a website.

not him but Java is objectively bad. python and golang are fine. I hope Crystal replaces all these shitlangs someday.

Java is way faster though, and has more features, and is type strict.

if I were to get hell-like syntax for performance I'd just go with C++

any other application devs hate web development ? any time I want to do something it's always oh, that piece of tech can't do that. so even for a simple idea you need to curmudgeon a half dozen things together to be able to do what you want. its not like normal programming where if a feature doesn't exist you can program it yourself.

Java is way better than C++ with similar performance though. Try opening a socket in C++ compared to Java.

Plus, I don't know of any full stack implementations for C++

Java's syntax is very simple and it has like 2x less keywords than C++

Javas API is garbage, it's worse than win32.

But far better than c++. Plus, it works way better across multiple devices.

/thread

>public static void main(String[] args)
>simple
I used Java for a server project in school and now for Android dev but always feels like I'm over-engineering shit, and the syntax is too verbose. But I guess it's just preference.

>JVM the RAM hogging slut
>similar performance

Every language/job that was created toward web development is shit

>not knowing that using more ram improves performance

Same reason fa/g/gots dislike C: they don't actually work in the field it's used.

>simple
yes, this is very simple

as for the performance, execution time is much more important. memory is very cheap. if this wasn't the case then java wouldn't be used all over the enterprise

Considering the decreasing market share of java while memory is getting cheaper tells me you don't have a clue as to why enterprise used Java (or more accurately, used the JVM).

would you recommend python for web dev? or is javascript + node.js the only good web dev language?

because it's so good
everyone hates the best

Php with some kind of framework is beautiful. Symfony for example. The simplicity is still there, its easy to use, but makes it so much easier to maintain.

PHP has 2000 ways to do everything, and they work.

java is fucking terrible for web and python is difficult for web. both are clearly not built for it (which they aren't)

python has to push your entire website through it while php can embed comfortably into a page and do only specific tasks

what do new businesses start with generally?

it IS used because of its maturity, stability, enormous ecosystem, good performance and ease of development and maintenance

>the decreasing market share of java
[citation needed]

how is crystal as a web programming language?

Take a look at job ads and they list *everything*, you cant do API/SPA stuff with Rails, you cant do large CRUD apps with a lot of end points with node, so they use both. A typical job ad will list Java, Rails, node, frontend frameworks, they have to use everything because they dont know that Go could do everything by having the server as part of the language which does what node does by having everything built in to the language and does what Rails does but in a more composable way.

what would you recommend as a web programming language?

Shit is a really popular meal for billions of flies all around the world and it has been for who even knows how long.

Why don't you have some? It's obviously amazing.

imho, just refactor to be a RESTful API backend and a sexy dynamic frontend. don't use PHP to render things - just have PHP return JSON, and render those things with client-side Javascript a la React.

if you find a different tool works better for the job (go, rust, python, etc.) simply replace that single API call with a microservice written in that tool. point your load balancer / http proxy (nginx/haproxy/etc) to the new backend for that URI prefix.

so they just end up using whatever they think they need then? well from what you've said it sounds like people should learn Go because it has the functionality of at least 3 languages in one.

You can't /thread your own post, but your right so here.
/thread

It gets even more funny when you have these startups that have to handle huge traffic, so they have Java and C++ programmers to handle large scale server functionality and yet they have to use stuff like node, Rails, and frontend frameworks to handle dynamic UI's. In a perfect world everyone would use Go for CRUD, js/node for frontend and Elixir/Erlang for large scale server infrastructure (ie Hadoop should NOT be implemented in Java)

so the best languages for web dev are Go,js/nod, Elixir/Erlang

yep
medium.com/code-zen/why-i-don-t-use-go-web-frameworks-1087e1facfa4

I was curious myself so I took a look at companies from featured on list businessinsider.com/33-startups-to-watch-in-2017-according-to-vc-investors-2016-12?IR=T/#digit-an-app-that-saves-money-for-you-33

gametime: Go, Ruby
laurel&wolf: JavaScript
discord: Elixir/Erlang, Python, Go, C++
affirm: Python
sofi: Java
therealreal: Elixir, Ruby
minted: Python, Java, PHP, JavaScript
dia&co: Ruby
zola: Java, Scala
forusall: Ruby

the rest of them didn't have tech job offers posted on indeed

sources:
(couldn't post directly due to spam filter)
pastebin.com/raw/9heNawbT

featured on this list*

I'm very happy that that Elixir is gaining traction. I'm also happy than startups are reasonable enough to not use Microsoft technologies

theirs a lot of ruby in there.

yea, it's like they can't learn from other people's mistakes blog.twitter.com/engineering/en_us/a/2011/twitter-search-is-now-3x-faster.html
captcha CALLE CALLE

wait they used something based off of java? I thought java wasn't that good? also they went away from MySQL?

>I thought java wasn't that good?
you've been memed either by a neet or by a microsoft marketer

>wait they used something based off of java?
yes, they rewrote their search system from rails to java and their internal message queue to scala

>also they went away from MySQL?
yes. they moved their search to a solution that's more suited for a retardedly high amount of searches per second

>you've been memed either by a neet or by a microsoft marketer
it was actually by people in this thread.

>yes. they moved their search to a solution that's more suited for a retardedly high amount of searches per second
so I assume that this means MySQL/SQL is not good for high end traffic?

anyways though does this mean that java is better than Elixir/Erlang or Go?

>it was actually by people in this thread.
so that would be neets, because I don't believe in conspiracy theories about microsoft shills posting on Sup Forums

>so I assume that this means MySQL/SQL is not good for high end traffic?
no

>anyways though does this mean that java is better than Elixir/Erlang or Go?
no

>memory is very cheap
this is quickly escalating to the Pajeet Theorem of the IO Bottleneck, abort

ABORT [1] >

companies using languages that tend to consume much more memory than C/C++ and also using microservices architecture which also increases the total memory cost of their software proves that the memory argument is invalid outside of niches like embedded software and gamedev

then why didn't they use go or Elixir/Erlang.

is MySQL gonna be phased out then?

>then why didn't they use go or Elixir/Erlang.
there's a lot of reasons companies pick one technology over the other. in the case of twitter's search it could've been that
1. a large part of their team seemed to have a hardon for scala, and when you know scala you most likely already know java very well
2. the apache lucene search engine they decided to migrate to is itself written in java so integrating it with your code is probably the easiest when your code is also written in java
I'm really just guessing here. you'd have to ask the people who made that decision to get a reliable answer

also they started working on their new search backend in spring 2010. go was like half a year old at that time and elixir didn't even exist

>is MySQL gonna be phased out then?
MySQL is probably losing some traction db-engines.com/en/ranking but it's still very popular and fine for most usecases

>is MySQL gonna be phased out then?
relational databases are always going to be needed, but noSQL just gives you broader options, noSQL basically just means a text file that you can programmatically tailor information storage and access to your specific needs

Crystal, Golang, Elixir are the languages to keep an eye on. Mark my words, they will make serious headlines very soon

Buffer and scanner in will tell you otherwise compared to cin/out. Also no overriding and strings in Java is garbage. Still it being more pragmatic than most languages is good

This user knows his stuff

What did he mean by this?

Look up Elixir. Alternatively Ruby or Python, although they are slower.
Also use Coffeescript or Elm for front end javascript development

Its not even easy to use if you're making something beyond a simple webpage. Random function names, argument placement, etc. Confusing and painful. Just avoid it

Too many shitty PHP devs and too many PHP codebases that companies insist on maintaining.

>java
>highest performance Service Oriented Frameworks in the world
>not a good language for web

I don't even like java, but you're fucking tarded if you think it's bad.

it's pretty consistent language outside of generics stupidity.

So does vim.

ASP.NET and Node.JS jobs are on the rise on the job posting sites I lurk on, you should steer towards that instead (Node.JS would be my choice)

What is "function hashing", anyway? Hashing a function?

>tfw only person using Dart

fug

that's going to change soon. it seems to be the main app lang for google's fuschia os and flutter

lmao

doubt it.

the fucking dart sdk repo started throwing 403's last I tried.

ECMA6 pretty much added all the same shit dart had anyhow so I've moved on.

PHP Is pretty comfy when you just want to get a shitty website up and running and you don't care about security.