Live data from Hacker News

PHP in 2019

stitcher.io

241–250 of 489 posts

Re: PHP in 2019

#241
post #81

Earlier quoted context omitted.

Yeah, I've been burned too badly by PHP. There are languages I haven't done in years that I would go back to if there was a compelling need to. PHP is not that language. Far to many sleepless late nights trying to clean up some security hole. PHP is like that abusive Ex that everyone says has changed. It may be true, in which case, good for PHP But I won't be putting myself in that position again.

You can be burned by every program language if you dont know the in and outs. It all boils down to, pick the right language for the job and more important, know the language you choose.

I did know PHP. I was actually pretty good at and wrote non-trival software in it. Even then the relationship was pretty abusive. Even when I was writing bug free code the author of a library I was using wasn't or a co-worker wasn't.

It may in fact be that PHP has improved to the point that the relationship isn't abusive anymore. But I'll never go back to find out. PHP and me were done years ago.

Re: PHP in 2019

#242
post #23

Earlier quoted context omitted.

The amount of legacy applications being run on the internet is huge. Breaking stuff would put a great financial burden on the companies running those. It is a sensible approach IMHO. What kind of bad stuff are you talking about? If you talk about function names and parameter ordering not being consistent that is not an issue for developers using the language daily, most of them are using an IDE so it doesn't matter a…

Those legacy applications won't ever be upgraded to that theoretical and slimmed down PHP anyway, so I don't see a problem.

Old PHP projects can be upgraded in the present because backwards compatibility exists, as i metnioend in other comment I done such a small upgrade and I hat to change only 1 deprecated function with a different one.

If this would not have been possible the project would have still be running on an old version without security fixes and slower(eating more electricity so bad for environment)

Re: PHP in 2019

#243
post #27

Earlier quoted context omitted.

There are comparable things with other frameworks too. For example I wrote a course on building a SAAS app with Flask. It's available at: https://buildasaasappwithflask.com/ It covers everything about user registration, profiles, subscription billing, 1 time billing, invoicing, and about 50 other things you would likely want to do in a SAAS app or any application really. The course comes with the source code along wi…

Every time I try out Flask, Aiohttp or even Express.js I appreciate more the stuff Django normally does for me.

Dito.

Re: PHP in 2019

#244
post #113

Do we have still to use mb_* functions to deal with utf-8 ? That was a major PITA when I used to write PHP.

No

How ?

    ~ php --version
  PHP 7.2.17-0ubuntu0.19.04.1 (cli) (built: Apr 18 2019 18:01:25) ( NTS )
  Copyright (c) 1997-2018 The PHP Group
  Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
      with Zend OPcache v7.2.17-0ubuntu0.19.04.1, Copyright (c) 1999-2018, by Zend Technologies
    ~ cat test.php
  

Re: PHP in 2019

#245
I've been using PHP semi-regularly since the late 90s. It's been empowering and infuriating.

The ecosystem is radically better than it used to be. Composer and the Packagist registry are as mature and dependable as npm, PyPI or RubyGems. (despite hours lost to my own namespace screwups). I'm also happy to see the Prettier-PHP project automating and enforcing code-style standards.

For whatever reason, I often feel clumsier after working on a PHP project. After working in other languages like JS or Python, I tend to feel like I've leveled-up my skills.

One thing I wish PHP would address is the inconsistency in its map-filter-reduce functions -- their argument-order doesn't match (array, callback) vs. (callback, array):

    array_filter($arr, $fn)
    array_map($fn, $arr)
    array_reduce($arr, $fn)
The amount of cognitive overhead I've wasted on those is ridiculous.

- https://packagist.org/

- https://github.com/prettier/plugin-php

Re: PHP in 2019

#246
post #223

I always wondered, in a world where 1. people seem to hate writing (old?) PHP, and 2. there are a good dozen languages that were created solely because people hate this other language Javascript , which both compile to Javascript and have the semantics of Javascript, just not the syntax or stdlib of Javascript; ...why we didn’t end up with languages compiling to PHP, targeting the Zend VM, or whatever you’d have to d…

Because Javascript is the only thing that runs on the client side.

And for many “LAMP” hosting environments—such as the tiny ones many ISPs and/or universities hand out like conference swag—(secured, sandboxed) PHP is the only thing that runs on the server side. Same with many “WordPress hosts”—they don’t let you run code per se, but they let you install arbitrary WordPress plugins, so you could deploy your own code into the site... if you’re willing to write PHP.

(Secured) PHP is used by these environments in about the same way that Server Side Includes and .htaccess files were used by Apache in the late 90s: as a way to give users the ability to add some dynamism to a website, without actually giving them a Turing-complete environment that they could use to run bots on.

And yes, I’m not being facetious, it’s really not Turing-complete: most of these environments have fixed request timeouts, fixed memory quotas, and no ability for the runtime to write to disk or make network requests. So there’s no infinite tape! This is “PHP as pushdown automata.” ;)

As such, the language I’m talking about would actually have to be built to understand that it it’s operating in this super-limited environment (more limited than PHP normally is.) I would expect that this would be presented less as a “programming language” per se, and more as something you can use in a Static Site Generator to inject a bit of server-side dynamism to your generated “static” site.

Re: PHP in 2019

#247
Disclousure: Amezmo creator

The PHP community and eco system is only getting better every year, and the language continues to advance. PHP is one of the easiest platforms to get started with. I built Amezmo to automate the modern PHP server infrastructure and deployment. Check it out at https://www.amezmo.com - Use coupon code FRIEND

Re: PHP in 2019

#249
post #127

Earlier quoted context omitted.

Every time I try out Flask, Aiohttp or even Express.js I appreciate more the stuff Django normally does for me.

Django abstracts away a bit too much, if you ask me. For a simple REST API it's complete overkill. I prefer Flask or Falcon[0], in which you don't just get better performance[1] but also a lower level of control. [0] https://falconframework.org/ [1] https://klen.github.io/py-frameworks-bench/ or https://github.com/the-benchmarker/web-frameworks

How are you implementing REST using Faclon if I might ask ? fully custom ? or is there anything like DRF hanging around ?

Re: PHP in 2019

#250
post #146

Earlier quoted context omitted.

That's how the course came into existence. I built a number of SAAS apps (and apps that had similar functionality) for a few freelance clients. Then I eventually thought "hmm, lots of repeated patterns here, maybe I can make this into a course", so then I made the course. As for the process. Funny you mention it. The changelog just had me on as a guest for their "backstage" podcast last week where we talked about con…

wow, serendipity I guess :) Definitively I'll check the podcast, thanks a lot!

No problem. If you still have questions after the podcast shoot me an email and I'll do my best to answer everything.
Post reply on HN