How seriously am I supposed to take a language that executes after numerous syntax errors that should be fatal compile/runtime errors in every other language? It keeps on trucking no matter what "code" you give it.
Taking PHP Seriously (2016)
71–80 of 150 posts
Re: Taking PHP Seriously (2016)
#72how's PHP's websocket support? presumably if it's a thread per websocket then they're using something else to serve that?
It's helpful to be able to reuse some domain code between the two if necessary, but IO cannot be done the same in ReactPHP because it needs to be async. Good news is ReactPHP has a ton of really great async libs (mysql, redis, etc.) https://reactphp.org/
As others have said, Swoole is also an option, it's more like Go (coroutine style). Personally, I think it's super cool, but not something I want to use, because the majority of the userbase is chinese and the docs and ecosystem suffer from the language barrier.
Re: Taking PHP Seriously (2016)
#73Earlier quoted context omitted.
> As companies move to single page applications backed by javascript and REST API, PHP CGI style classic execution model provides no advantage, when it comes to generating or serving web content I lol'd. SPAs are a fad. Apps that rely heavily on REST API and browser rendering rank terribly on Google. Create a SPA and help your customers discover your competitor on the first page of Google.
This assumes Google can't figure out crawling SPA.
Generally, when I'm building a business, I prefer not to assume that Google will eventually, at some point in the future, solve the crawling a SPA site problem and finally discover my site.
I'd rather get my 70%-80% organic search traffic today, with any boring server-side rendered tech stack.
Re: Taking PHP Seriously (2016)
#74Long live PHP. 15 years of PHP dev work. Games, mobile apps, health care, etc. I have been unemployed for 2 days in 15 years. PHP runs %80 of the internet. Talk to anyone at facebook that wears a suit on friday -- they code PHP (and it seems to scale for them). I think I will be 90 years old hacking on PHP.If you really don't like how the arguments are passed just use an IDE. Or get stuck with real problems like a tr…
Re: Taking PHP Seriously (2016)
#75PHP after 5 is great. I guess from PHP 7 on things changed pretty significantly. Combine it with Laravel and nginx, and you've got an enjoyable stack in my opinion.
Does anyone start a new php project without a framework these days? There are some great ones (Laravel, Symfony, PimCore, etc.).
Re: Taking PHP Seriously (2016)
#76Languages like Java, Node, C#, etc are great but unlike PHP you can't just drag and drop a .php file on a webserver, point your browser at it and go.
Basic things required for web development like connecting to a MySQL database are made trivial in PHP.
Code is executed synchronously in PHP and as mentioned in this article requests are stateless which makes the logic much easier to follow and debug than say Java where you have state or Node where you have callbacks and promises.
PHP also gives you the flexibility to write procedural, OO, or even functional code. This flexibility is off putting to some, but it allows the language to be useful no matter what your skill level or preferences are.
Another thing that's easy with PHP is debugging. You don't have to worry about compiling code or accidentally taking down your entire server (most of the time) if you encounter a critical error. If one of your PHP pages runs into an issue you can enable debugging with a line of code, make your fix then hit the refresh to see if it's working.
I learnt to code writing PHP when I was 16 years old. Me and my friend had an idea for a startup but neither of knew how to program beyond a little bit of ActionScript. We were good with computers, but if we decided to use Java I'm certain the project would have never have gotten off the ground because of the steep learning curve.
PHP allowed us to skill up with the language and enabled us to move fast despite not really knowing what we were doing. Writing PHP in the ICT room at lunch with my friend was some of the best memories I have of school... I doubt I'd be doing this today if it wasn't for how much fun I had learning and building stuff with PHP when I was younger.
Re: Taking PHP Seriously (2016)
#77The best language for a startup is one the founders know the best. Every other discussion will at best make a 1% difference.
Really depends on what the business is doing. Chewing through TBs of data every hour? Probably not a good idea to use Ruby. Doing a bunch of really heavy math? Probably not a good idea to choose PHP. Doing a SaaS service? C++ probably isn't a good choice. There are some really good general purpose languages that can fit most circumstances (Java, .Net languages, Go). However, I'd be careful to say that you could apply…
PHP is faster than Ruby. [1]
PHP from a local script does math just fine. It's the round trip of the request to a PHP server and back that you're associating with poor language performance. In a local scripting environment PHP7 is considerably faster than Python3. [2]
PHP is an extremely popular language as the backend for SaaS, and arguably one of the oldest and most successful. [3]
[1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
[2] https://blog.famzah.net/2016/02/09/cpp-vs-python-vs-perl-vs-...
[3] https://insights.stackoverflow.com/survey/2020#most-popular-...
Re: Taking PHP Seriously (2016)
#78The argument that you don't have to restart the server after editing a file? I mean I've used a couple of web dev environments and I know for a fact that Rails, Django and Express all come with some sort of automatic reloading in development - provided by the framework itself or by a library. Quite sure there is a solution for most environments.
Re: Taking PHP Seriously (2016)
#79Long live PHP. 15 years of PHP dev work. Games, mobile apps, health care, etc. I have been unemployed for 2 days in 15 years. PHP runs %80 of the internet. Talk to anyone at facebook that wears a suit on friday -- they code PHP (and it seems to scale for them). I think I will be 90 years old hacking on PHP.If you really don't like how the arguments are passed just use an IDE. Or get stuck with real problems like a tr…
"Use an IDE" is never an answer to shitty language design. Shitty language design is shitty language design. That said, I cut my teeth on PHP and still have a fondness for it. It's especially great being able to deploy small little backend-driven pages with rsync or sftp in a pinch. I just discovered other languages and environments I enjoyed working in much better.
Re: Taking PHP Seriously (2016)
#80This seems to be an unpopular opinion in the tech world, but I honestly enjoy working with PHP. It's such a simple, robust language, and you can use it in many different ways, depending on what you're building (OOP, scripting, microservices, etc).
That being said, at some point in 2010-2015 timeline it became essential to master Javascript to do anything good on the web, and so it became a diversion of precious resources to continue to invest in PHP as well.
Instead the progression has just been to recreate the PHP high level architecture in Javascript/nodejs.
So we took the best parts of PHP and brought them to NodeJs land, and then you can cut your costs because you don't have to learn or invest in the full PHP stack.