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

Why everyone hates php?

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: 128
Thread images: 16

File: the-php-practitioner.jpg (22KB, 716x474px) Image search: [Google]
the-php-practitioner.jpg
22KB, 716x474px
i mean, everyone acts like

>php? rlly? omg haha

i feel old... what has replaced php? should i learn it?
>>
>Still used on 85% of websites
>but /g/ says its pointless to learn

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

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.
>>
>>61329018
because it is poorly designed desu
i use it daily because it is ez as fuck
>>
>>61329018
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.
>>
File: conf.jpg (44KB, 600x450px) Image search: [Google]
conf.jpg
44KB, 600x450px
>>61329018
>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.
>>
>>61329018
Try Laravel
>>
File: 1463678551723.png (335KB, 1280x720px) Image search: [Google]
1463678551723.png
335KB, 1280x720px
>>61329018
>>
File: IMG_20170626_144102-1.jpg (119KB, 777x759px) Image search: [Google]
IMG_20170626_144102-1.jpg
119KB, 777x759px
>>61331426
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!
>>
>>61329066
i dont think people say its pointless to learn, but that its a shit language because of >>61329255
>>
Golang.
>>
>>61329018
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.
>>
>>61329255
> terrible std lib
But, php has a build in rot13 encryption function.
>>
>>61332172
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.
>>
>>61332172
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 4chan heavily use php?
>>
>>61332633
>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
>>
>>61329128
This is a good answer.
>>
>>61333079
Atleast the script its based on does.
>>
>>61329018
>Why everyone hates php?
reasons
>what has replaced php?
nothing
>should i learn it?
yes
>>
>>61333364
>>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
>>
>>61329066
It's shit nonetheless it's easy to understand to give maintenance. But I don't want to program on it.
>>
>>61329255
This.
When will c++ or haskell be used instead
>>
>>61335776
>I don't.
>>
File: php-in-a-nutshell.png (50KB, 591x655px) Image search: [Google]
php-in-a-nutshell.png
50KB, 591x655px
>>
>>61329128
Java? Are you autistic? Python? What the fuck, these languages are cancer.
>>
>>61329018

its fine, just make sure youre using php7+
>>
>>61337088
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
>>
File: golang.gif (181KB, 500x500px) Image search: [Google]
golang.gif
181KB, 500x500px
>>61332149
Golang is comfy and has a great logo/mascot.
>>
File: urafaggit.jpg (289KB, 1920x1080px) Image search: [Google]
urafaggit.jpg
289KB, 1920x1080px
>>61337088
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?
>>61335797
You can use c++ and Haskell on the web?
>>
>>61332171
>(node) JS is way faster than php
out of the box, probably. PHP 7 + opcache should be similar or faster in performance.
>>
>>61337088
Name a better language for building a website.
>>
>>61340235
not him but Java is objectively bad. python and golang are fine. I hope Crystal replaces all these shitlangs someday.
>>
>>61340253
Java is way faster though, and has more features, and is type strict.
>>
>>61340287
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.
>>
>>61340465
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++
>>
>>61340465
Java's syntax is very simple and it has like 2x less keywords than C++
>>
>>61340706

Javas API is garbage, it's worse than win32.
>>
>>61341024
But far better than c++. Plus, it works way better across multiple devices.
>>
>>61332149
/thread
>>
>>61340750
>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.

>>61340706
>JVM the RAM hogging slut
>similar performance
>>
>>61329018
Every language/job that was created toward web development is shit
>>
>>61341279
>not knowing that using more ram improves performance
>>
>>61329018
Same reason fa/g/gots dislike C: they don't actually work in the field it's used.
>>
File: 1499753101682.png (157KB, 1500x783px) Image search: [Google]
1499753101682.png
157KB, 1500x783px
>>61341279
>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
>>
>>61341479
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).
>>
>>61332171
would you recommend python for web dev? or is javascript + node.js the only good web dev language?
>>
>>61329018
because it's so good
everyone hates the best
>>
>>61332599
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.
>>
>>61329128
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
>>
>>61332599
what do new businesses start with generally?
>>
>>61341518
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]
>>
>>61340253
how is crystal as a web programming language?
>>
>>61341652
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.
>>
>>61329128
what would you recommend as a web programming language?
>>
>>61329066
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.
>>
>>61341752
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.
>>
>>61329090
You can't /thread your own post, but your right so here.
/thread
>>
>>61341851
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)
>>
>>61341970
so the best languages for web dev are Go,js/nod, Elixir/Erlang
>>
>>61342081
yep
https://medium.com/code-zen/why-i-don-t-use-go-web-frameworks-1087e1facfa4
>>
>>61341652
I was curious myself so I took a look at companies from featured on list http://www.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)
https://pastebin.com/raw/9heNawbT
>>
>>61342152
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
>>
>>61342152
theirs a lot of ruby in there.
>>
>>61342228
yea, it's like they can't learn from other people's mistakes https://blog.twitter.com/engineering/en_us/a/2011/twitter-search-is-now-3x-faster.html
captcha CALLE CALLE
>>
>>61342272
wait they used something based off of java? I thought java wasn't that good? also they went away from MySQL?
>>
>>61342331
>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
>>
>>61342416
>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?
>>
>>61342551
>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 /g/

>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
>>
>>61341479
>memory is very cheap
this is quickly escalating to the Pajeet Theorem of the IO Bottleneck, abort

ABORT [1] >
>>
>>61342715
companies using languages that tend to consume much more memory than C/C++ >>61342152 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
>>
>>61342654
then why didn't they use go or Elixir/Erlang.

is MySQL gonna be phased out then?
>>
>>61342949
>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 https://db-engines.com/en/ranking but it's still very popular and fine for most usecases
>>
>>61342949
>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
>>
File: elixir_logo.png (74KB, 400x400px) Image search: [Google]
elixir_logo.png
74KB, 400x400px
>>61340253
Crystal, Golang, Elixir are the languages to keep an eye on. Mark my words, they will make serious headlines very soon
>>
>>61340750
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
>>
>>61341785
This anon knows his stuff
>>
File: 1498013618819.jpg (42KB, 306x344px) Image search: [Google]
1498013618819.jpg
42KB, 306x344px
>>61335765
What did he mean by this?
>>
>>61335797
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
>>
>>61329018
Too many shitty PHP devs and too many PHP codebases that companies insist on maintaining.
>>
>>61337088
>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.
>>
>>61332245
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)
>>
>>61331426
What is "function hashing", anyway? Hashing a function?
>>
>tfw only person using Dart

fug
>>
>>61347223
that's going to change soon. it seems to be the main app lang for google's fuschia os and flutter
>>
>>61336275
lmao
>>
>>61347312
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.
>>
File: dace of the loli.gif (3MB, 200x155px) Image search: [Google]
dace of the loli.gif
3MB, 200x155px
>>61329018
PHP Is pretty comfy when you just want to get a shitty website up and running and you don't care about security.
>>
>>61347360
I think they're pretty invested into it already
https://github.com/fuchsia-mirror/modules-music
>>
>>61347418
Err:1 https://storage.googleapis.com/download.dartlang.org/linux/debian unstable InRelease                                                           
403 Forbidden [IP: 2607:f8b0:4006:813::2010 443]


I just tried re-enabling it from the links given in https://www.dartlang.org/install/linux#using-apt-get

it's ded.

it was p chill language though. it was basically javascript that didn't have all the bad design choices and legacy cancer.
>>
>>61347496
sooo, summary of the arguments about dart's bright future:
for:
>it's the main language of the sdk that's being used for the UI and apps of Google's new OS
against:
>some debian repo doesn't work

it's not that I even like the language, because I don't
>>
>>61347562
pretty much.

obviously google doesn't give a shit if they let the repo rot.

and fuchsia is a meme and you're retarded if you think it will go anywhere.

no chink will play ball with google's meme shitware OS. instead throwing mislicensed GPLv2+ shitcode at linus or just shipping some fucking module that only works on some meme specific linux kernel abi and never update it or even provide some "mixed source" akmod/dkms cancer for new kernels.
>>
>>61329066
NEETs have a warped sense of reality.
>>
>>61332633
>design issues
Meaningless weasel words. Most of the obnoxious language-level PHP footguns people remember from a decade ago are either already deprecated or already removed from the language. Some of the older parts of the standard library could have been organized better, but it's seriously not an issue once you've used the language for a while.

At least PHP didn't break vast swaths of old working code for no reason while at the same time not giving people a real reason to upgrade.
>>
>>61331022
Built my career so far on Laravel. Would highly suggest it.
>>
>>61329018
it pointless to learn PHP, you should be able to do any PHP job without learning
>>
>it pointless to learn PHP
Then what should i learn? Is there a better server side scripting language?
>>
>>61331426
Why hasn't anybody shopped DiGiannantonio's hair onto Rasmus' head in that pic?
>>
>>61349286

Learn D.

http://vibed.org/
>>
>>61347385
Which langauge has good security?
>>
>>61349406
BCHS
https://learnbchs.org/
>>
>copy_of_real_escape_string_works_latest()
>>
File: 1499610043056.png (39KB, 370x320px) Image search: [Google]
1499610043056.png
39KB, 370x320px
>>61333364
>tfw I use react//redux at a major company for my shitty internal app
>>
File: 8fERTur.png (175KB, 600x603px) Image search: [Google]
8fERTur.png
175KB, 600x603px
>>61329066
this
>>
>>61346021
>they will make serious headlines very soon
Go already has proven itself many times already. Everyone is using it and it's impressive how many libs are available for it already, even for quite niche needs.

Elixir is gaining some traction but it probably won't become a "mainstream" language since functional (and erlang) programmers are still rare. Still, it's probably the best language for extremely concurrent applications.

Crystal is interesting but way too new to get adopted widely.
>>
File: 1499449150729.jpg (799KB, 1080x1080px) Image search: [Google]
1499449150729.jpg
799KB, 1080x1080px
Why has nobody mentioned node.js yet? It's basically what all the cool new startups that'll be bankrupt one year from now are using.
>>
File: Screenshot_2017-07-13-02-21-31.png (269KB, 1440x2560px) Image search: [Google]
Screenshot_2017-07-13-02-21-31.png
269KB, 1440x2560px
>>61341870
Nah
>>
>>61349317
>>61349423
These seem like meme languages.
Also i'm a newbie at web dev. Should i learn it anyway even if im really new?
>>
>>61349654
No.
Learn PHP or Python.
>>
>>61348088
Yeah, its called Dunning Kruger syndrome

I'm dead serious btw
>>
>>61342228
there's *
>>
>>61342152
go is a good language
I would drop python & php for it if you could fucking run a go program via crontab -e
but you can't
so fuck it.
>>
>>61331022
>>61349134
Try Symfony
>>
>>61329018
I'm a web developer and PHP is my main language. Love PHP
>>
>>61329255
I don't write PHP (anymore) but as far as interpreted languages go, I'd take it over Python or Ruby any day, so let me play devil's advocate here (disclaimer: I'd also take Perl over those two because I'm a literal oldfag):

>Slow
Still way, way, way faster than Python or Ruby.
>Disgusting syntax
There's literally nothing wrong with C-like syntax, especially if the alternatives involve significant whitespace.
>Weak type system
Use type hinting to get best of both worlds.
>Terrible standard library
Somewhat messy and inconsistent but definitely useful.
>Terrible 3rd party libraries
Yeah, I think the main reason for PHP's shit reputation is that its shallow learning curve resulted in legions of pajeets writing petabytes of terribly and I mean terribly shitty code in it. It's not really the languge's fault, but I can see how one might think that after seeing the shit people produce in it (or some ancient abominations like Wordpress that just refuse to die).
>Not a general purpose language
To the contrary. When I did write PHP, 90% of my code were CLI SAPI scripts. Unlike Python or Ruby, PHP doesn't have global interpreter lock which means with real threading, it's actually *more* suitable for some non-web-related tasks.
>No control over processes (spins up a new process and tears it down for every request)
I truly believe share-nothing architecture is actually a good idea in the web context.
>>
>>61353230
>Still way, way, way faster than Python or Ruby.
slower than PyPy and TruffleRuby

>There's literally nothing wrong with C-like syntax, especially if the alternatives involve significant whitespace.
there are some dumb choices like -> for member access, dot for string concat or no arrow lambdas, but a lot of stuff like array definition got improved. it's bearable

>Use type hinting to get best of both worlds.
not nearly enough. but some mad men don't even like strict typing so whatever

>I truly believe share-nothing architecture is actually a good idea in the web context.
no. please don't try to spin this into an advantage because it isn't
Thread posts: 128
Thread images: 16


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