HN user

colshrapnel

37 karma
Posts3
Comments33
View on HN
The Future of PHP 7 years ago

So, given you "don't care what happens to PHP", I assume you don't give much heed to whether it's winning or dying. That's basically what @deanclatworthy is saying, so there is nothing to fight about. Cheers!

I remember reading an article about Ben Underwood[1]. It was headlined with something like a blind boy can play video games using an echolocation. It turned out he just remembers the right succession of moves after a lot of try and fails. On the one hand, I should blame the author, not the boy for the title. But when I tried to research the topic, all I was able to find is only a couple articles using similar gimmicks, so I became quite skeptical.

[1] https://en.wikipedia.org/wiki/Human_echolocation#Ben_Underwo...

"escaping input" is a notorious delusion. And a bad one.

- it is not "input" must be treated, but, so to say - output. It's the destination that matters, not the source. By the time you get the input, you have no idea how and where it will be used. You can tell it right before the output (or, rather, better to call it "use") only. Say, you've got some input that didn't pass the verification and you will have to display it back in the HTML form. And if you already "escaped" it for SQL, it will be malformed. And vice-versa. Moreover, any data must be formatted properly before use, not just something that you tagged as "input".

- the word treated above is for a reason. Because the term "escaping" suggests some certain routine in PHP, which is the actual reason for numerous SQL injections.

You'd laugh at me, but I am still using a LiveJournal clone - Dreamwidth. This pre-social network is quite comfortable to be in. It is, so-to say, non-invasive. You'd never see a post from someone you didn't subscribe to. There are no ads. No mental viruses to pick-up. Just what a social media is meant to be for ordinary people to keep in touch with some friends. And of course there is no mobile client to ring a dozen times a hour. I just read my friends list when it is comfortable for me.

And I visit my facebook account weekly, via desktop browser, only to see what's up with my friends hanging up there.

I very seldom do likes, as I know that my likes could show up in my friends' feeds. There are NO notifications from social network or media on my phone. I call it "information hygiene".

And yes, like others mentioned, I've got A LOT of spare time for books, hobbies, movies etc.

PHP in 2019 7 years ago

What are you talking about is just a syntax. Which is not an issue for a PHP dev nowadays. I am typing much more custom method names than vanilla PHP functions. And when I have, my IDE shows me the right syntax after a few keystrokes.

So, it's apparently a good reason to hate, but by no means a reason not to use PHP.

PHP in 2019 7 years ago

And on its quest towards JIT the language becomes less and less dynamically typed. strict_types=1 is already a standard in most major applications and all the cleanup that has been done already, such as count() raises an error if you try to count a non-countable variable, and many more.

I always wanted to have an incognito browser as default option on my mobile. Recently I chanced to discover Firefox Focus on Google Play and that's exactly what I wanted. Now it's the default option to open random links, whereas Chrome and vanilla Firefox are used for the several trusted cities with permanent authorization.

If your goal is to post, then SO is excellent. But if your goal is also to read, there are questions. Nobody ever tried to use Stack Overflow without Google yet. given all its bell and whistles are intended for those who want to post, there are questions yet to answer.

And here comes the question of maintainability. For the code, we are trying to have a single repository to avoid duplicates and to have just a single place to make changes. That's what a wiki is good for. Whereas for such a dispersed knowledge base it would be hard to keep all these atomic questions up to date.

The front page for Teams boasts it's better than your "stale wikis and lost emails" but in reality there are much more stale answers on SO than anywhere else.

Yes, and it makes Stack Overflow more like an imageboard than a documentation project. So I have doubts whether it can be used for the purpose especially with Google removed from the equation.

Stack Overflow has very small experience with reusing the knowledge, aimed primarily at providing fast on-site answers, for questions too localized for reuse. I have doubts in its ability to provide a solid documentation base, given a flop it made of Documentation project. Wikipedia is a way better source of reusable knowledge than Stack Overflow, and for a reason.

SO is bad with search, entirely giving it away for Google to find relevant answers. In a wiki, at least I can follow the structure to find relevant pages, but in the heap of badly phrased questions it will be a pain to find anything relevant.

I love writing documentation too, but from years participating on Stack Overflow I found it most unreliable for the purpose. As I once quipped, "Imagine Wikipedia where there are several hundred articles on the New York city. And one that Google links first is copy-pasted from Encyclopedia Britannica, 1913. And every single day several kids from elementary school start a new one."

SO is torn between essentially ambiguous goals, providing fast on-site answers and being a reusable knowledge base. And it's good with the latter only because of Google. Without Google it will be no better than fast on-site answers on Slack.

Stack Overflow largely relies on Google Search, but for private teams it won't be available. And internal search is just unreliable.

Also I fail to see how answers on SO for Teams are supposed to be less "stale" than your old wiki articles.

For me, at least our corporate wiki is more organized, without duplicates, whereas Stack Overflow's modus operandi is largely relies on creating thousands of duplicated questions.

It it will break BC, then don't use it? You guys are using every dirty trick invented for internet discussions in the last 30 years. You said it dosen't exist. When I showed the way to get it, the agrument should stop this very instant.

Instead you started nitpicking on the solution. That's dishonest. And it makes the discussion endless.

Third, nobody does it.

This statement of yours clearly states that you have no idea of the actual PHP ecosystem. Every single major PHP framework is routinely doing it.

That's just your speculations that you are trying to pull here, to support your point of view that contradicts with the real world evidence (PHP is popular).

Honestly, you are claiming that all these people are dumb and lazy. I respect some snobbery but apparently not up to that point.

You can make them throw actually.

set_error_handler("myErrorHandler"); function myErrorHandler($errno, $errstr, $errfile, $errline) { throw new Exception($errstr, $errno); }

Is all you need.

They are functions - yes. If your first language was fully OOP, then probably PHP is not your language of choice. It doesn't make it bad, though.

You guys are so fixed on that standard library thing that I am getting scared. In a way, it's the best compliment PHP can get, means nitpicking on the function names is all they can blame PHP for. Nevertheless, for me it never was a problem - neither at a time when I used to stick with FAR commander's internal editor, nor - especially - with PHPStorm nowadays, that always put the proper syntax under my fingertips, parameter order included.

Consistent error handling is a matter of one set_error_handler() call.

Ok, undeed PHP can be called inconsistent, if one would have a fancy to. And this opinion could be even defended with numerous examples... which examples, for some reason, do not work neither for learners who prefer PHP over "more consistent languages", nor professional developers, who just get their job done.

To boil it down, I think this "inconsistency" argument works more for the internet discussion than for the real life consideration.

I pity you (no offense intended). Really. One of my own biggest fears is that it may happen that I would have to earn my living by doing things I hate.

May be your hate is entirely from the fact that you are forced to work with the tool you don't like.

"keeping the ship from sinking" - surely you are a borad member for Facebook, Badoo, Dailymotion. I appreciate your first hand evidence.

Come on, if a handful inconsistent function names is all the problem with PHP to you, let me suggest you to get yourself a good IDE with a code completion feature. You'll forget that "broken stdlib" forever... of course if your aim is to get the job jone, not to slander a language you aren't working with.

"that doesn't say PHP is good" - what are you trying to say here? That they hate PHP but keep working with it?

You see, that's a hater's logic.

Every PHP's advantage or eviddence you've given, you are trying to dismiss or even twist, calling it a disadvantage - usual tricks for the internet discussion when you aren't interested to find the truth but just to keep pressing with your opinion.

Honestly, this kind of discussion is the only problem with PHP.

They don't host video nor curate anything. The technology stack is very simple:

1. Search up Internet for the existing tutorials. 2. Plagiarize the content. 3. When caught, rewrite several sentences to make it look slightly different and hard to google. 4. When asked to remove the plagiarized content, make an innocent look and say "It's not me, it's the author! I can't do anything."

My tutorial has been plagiarized on this site, thus such a bitterness. But nevertheless it's a fact that all tutorials that published on the site at the moment are just compilations of plagiarized content.

You can browse this site ( https://www.google.com/search?q=site:w3clan.com ), pick a random tutorial and google for a sentence taken from any chapter. And you will see the original source. The technology behind this site is mostly cheating.