Earlier quoted context omitted.
Not if you code a lot. It is not rare for developer to use vertical screen. https://img.devrant.com/devrant/rant/r_200135_Q9Fh4.jpg
I mean I'd say it's pretty rare. I've only seen a handful of people do it personally, and I've never seen anyone exclusively use a portrait screen.
25 Years of PHP
321–330 of 426 posts
Re: 25 Years of PHP
#322Earlier quoted context omitted.
I dont agree with you at all. Why are you building arrays with mixed key types? Why do you want type hints? Why do you need generics in a dynamically typed language? Php has pthreads. They just arent needed that often. Async is being worked on You didnt mention it but immutable types are also being worked on. Everything people complain about php over tends to actually make its way into the language eventually. I dont…
I am reminded of 2 things while reading your comment: 1. The meme where someone sits in a burning house or room and says "It's fine.". 2. "Sweet lemons". That is the sort of psychological "strategy" that is often applied and that seems to be used here: Things are bad, so lets talk them good. It all sounds like "Oh come on, it's not so bad!", but that is not the point. The point is, that compared with more developed l…
Re: 25 Years of PHP
#323Re: 25 Years of PHP
#324Earlier quoted context omitted.
> One thing that still sucks is package management / composer What about Composer? Sure is in par with Slack when it comes to memory usage, bit it's functional and feature rich. v2 has partial offline support, faster downloads, etc. ( https://php.watch/articles/composer-2 ). Composer IMHO is one of the best dependency managers for any language out there. Disclaimer: the link above is a for a site I maintain.
Having to setup 10gb swap to get it to work is pretty awful.
Re: 25 Years of PHP
#325Earlier quoted context omitted.
> I mean, who uses mysql_real_escape_string when you have PDO and bindings ? You've made my point. A person with tribal knowledge probably would NOT. Any new user coming from reading an older blog post or perhaps a PHP book would have no idea that that "older approach" is out of date. Furthermore, the more precise point I was trying to make there was as a language designer, how on earth would you be okay implementing…
Um, I'd criticize a C++ programmer who didn't know anything about the STL as well. Sure, you don't need to know the STL to write C++, but it's an odd decision. If you're going to use a tool, you have to learn it if you want the job done properly. PHP is old and carries some cruft along with it for compatibility reasons (I suppose). When mysql_* was implemented, the world was a gentler place, and SQL injection wasn't…
I believe that msql_* were implemented in PHP 3.0, in 1998. By comparison Perl's DBI was first released in 1994, with placeholders and an explanation of why they were important. Of course the idea wasn't original to DBI, the feature was based on an existing Oracle feature known as bind variables that I know was available and recommended with Oracle 7 in 1992. (I don't know if it was there before. It might have been.)
So there was certainly no attempt to figure out best practices on the part of PHP. And compared to the other injection attacks that proliferated in PHP in this time frame, the mysql functions were practically sane.
Re: 25 Years of PHP
#326I've been working with PHP for a very long time and apart from web it is also very good at writing shell scripts too. One of my recent project called 'howdoi' (1) is written in less than 70 lines of code (ignoring ws) - no libraries, no deps and backward comptabile to 5.0. Just copy-paste the file and it's go! If you know how to use it, it's really useful language. (1) https://news.ycombinator.com/item?id=23230157
I'm really surprised that PHP hasn't picked up in this area. It's a great tool when you're too big for bash, but not big enough for, well, a "more proper" language...
Re: 25 Years of PHP
#327Earlier quoted context omitted.
You couldn't be more wrong about the ease of deployment. PHP is one of the hardest things to deploy. You need at least a web server and a process manager. Most popular choices are nginx + PHP-FPM or Apache + libapache2-mod-php. You also need to learn how to properly configure both of them, since both have like a million options, and default installation doesn't work in a lot of cases (e.g. uploading of files larger t…
Many smaller PHP web sites are deployed on VPSes and managed with CPanel or Plesk control panels. None of what you describe is necessary. The web server is pre-configured and PHP settings can be easily changed. Even setting up PHP on Ubuntu or CentOS is a 5 minute job. Tweaking configuration settings for max upload, max post size, etc. are very common and well understood. Once everything is in place, most deployments…
Re: 25 Years of PHP
#328Earlier quoted context omitted.
I know you don't care, you've made that very clear. If you cared about truth or accuracy, you wouldn't have made an appeal to your own authority by bragging about impossibly using PHP and making database driven web sites for 39 years, or tried to excuse your moving the goalposts by claiming to "have a bad habit of not clicking on parent to see what the context of a post is". "I don't care" is Rasmus Lerdorf's attitud…
What are you getting out of this? He worked on php and look how far it came, what have you done? Your own website was written in php which you took down due to a security vulnerability in a framework... now is it php fault that someone wrote vulnerable code? "Temporarily offline due to Drupal security vulnerability."
Back to the point: We're discussing mysql_real_escape_string. What's your excuse for it even existing in the first place, instead of simply fixing the security hole in the original mysql not-so-real escape string function?
Melania Trump's "I REALLY DON'T CARE DO U?" jacket sums up Rasmus Lerdorf's attitude towards security, software quality, programming, stardards, computer science, and unit tests. I just quoted his own words and bug reports that prove that point.
Do you like to leave loaded AK47s strewn around daycare centers, then blame the kids when they shoot each other? Is it ok if after the massacre you realized you made a mistake, and then scatter a few Nerf Guns around so the smart experienced kids who survived will have something safe to play with, but you still leave all the loaded AK47s?
Re: 25 Years of PHP
#329Earlier quoted context omitted.
I'm trying to give you the benefit of the doubt here, but I'm really suspecting that I'm just falling for a troll. I'm talking about WRITING PHP code. You don't WRITE top level functions. Every data type you WRITE is a reference type. In C++, it is common to write top level functions in a namespace for others to use. In C++ you can write a class/struct and pass it to function BY VALUE. In Java and PHP you cannot pass…
So TLF's exist and get used constantly but people don't write them often in code you look at (they do in the code I look at), you don't have to use classes and lots of pages don't but frameworks tend to stick with them, there are global variables, the syntax looks a lot more like C but class semantics exist, therefore it's exactly like Java. Whatever, if that's how you see it I guess I can't stop you.
And, even with syntax, the singular part of the syntax that looks like C is the arrow for method calls. Everything else looks like Java, including the fact that you use `struct` to group data in C, not `class`.
Also, you said C++ originally, not C. And PHP classes are NOTHING like C++ classes. They are everything like Java classes.
You're just wrong about being inspired by C++. At least in its current form.
Top level functions DO exist, admittedly. I just never see any libraries use them. I assume it's because the autoloader and composer work better with classes. What projects do you look at that use TLFs? Also, may I ask why you'd prefer them to static methods on classes (with private ctor). Isn't it less convenient to import them?
Re: 25 Years of PHP
#330While I don't use PHP today, it always makes me wonder at deceptively easy it is to deploy a PHP app. There's no having to worry about restarting processes since the next request picks up the code changes and deploying at scale has so many problems auto-solved by that such as rolling restarts. You can then handle things like percent based feature roll outs at the application level which is likely where it belongs any…
>There's no having to worry about restarting processes since the next request picks up the code changes and deploying at scale has so many problems auto-solved by that such as rolling restarts. Nearly any serious PHP deployment will use an opcode cache which has to be invalidated, though maybe they are smart enough to do that from the filesystem now. >On the flip side, for single server deploys, you can also get by w…