News for hackers. Stuff that matters.
Re:Tell HN: I think you're downplaying the PHP community by gkya on Friday October 14, 2016 @12:13PM (#12709052)
Php is objectively a bad language, and as the literature on why it is is wast like oceans, I don't feel the need to add to it. That said it's quite understandable why the language is used regardless of it's inferiority, there are some practical reasons, just like JavaScript. Thus it's understandable why people follow its news and also why it's harshly criticised. HN is a technical forum of tech entrepreneurs and computer hackers, and people discuss most often the technical aspects of things, and for Php it's more than expected that the tone be downplaying. Though I believe that should be taken as is and not be extended to community itself.
Re:Tell HN: I think you're downplaying the PHP community by colshrapnel on Friday October 14, 2016 @05:00PM (#12711061)
PHP is an easy language that is usable by practically anyone. And it simply make tech snobs and self-proclaimed gurus jealous :j
Re:Tell HN: I think you're downplaying the PHP community by babyrainbow on Saturday October 15, 2016 @11:34AM (#12714317)
Php is a language that traded off every bit of sanity and security for "ease of use".

So it is easy, but have you tried building a web app in Python? You don't even need a web server. Only in recent versions Php got it's own web server. The point is, that Php is easy is mostly a myth. Other languages have as easy path to building a web applications. But they just stop short of giving up any sanity or security...

I am not sure if we should encourage people to make that tradeoff..

Re:Tell HN: I think you're downplaying the PHP community by colshrapnel on Saturday October 15, 2016 @12:01PM (#12714419)
Come on, choose one. Either PHP is easy but insane or it is not that easy, at least compared Python? Sorry, I can't get your exact idea.
Re:Tell HN: I think you're downplaying the PHP community by babyrainbow on Saturday October 15, 2016 @12:40PM (#12714591)
Not sure what you mean. Which part of my message is not clear to you?
Re:Tell HN: I think you're downplaying the PHP community by TheSpiceIsLife on Saturday October 15, 2016 @03:55PM (#12715423)
The bit where you contradicted yourself in the first line.

Php is a language that traded off every bit of sanity and security for "ease of use".

There's nothing sane about unusably difficult languages.

Re:Tell HN: I think you're downplaying the PHP community by babyrainbow on Saturday October 15, 2016 @08:23PM (#12716243)
That is not a contradiction. I am quite baffled by the way your logic works.

I saw in another comment you accuse others of using 'dirty internet tricks'. I am afraid you are either using them to the limit by yourself, or your logic is all messed up.

I will try to explain anyway. A langauge can be made difficult just for the sake of it. For example, Brainfuck. But a language can also be a bit more difficult as a result of process/methodologies that make it more secure/sane. For example the borrow checker in rust and purity in Haskell. Both of these make these languages a bit harder to use than usual.

What Php does it the opposite. Examples are things like "10"=="0x0a" being true and Php arrays being a mashup of a number of different data structures, and include/require functions that provide zero namespacing, register globals, magic_quotes etc etc....Now some of these are removed, I know, so please don't come back with that. I am mostly pointing towards one of the founding principle of the language..

Re:Tell HN: I think you're downplaying the PHP community by TazeTSchnitzel on Friday October 14, 2016 @06:05PM (#12711480)
It's harder to learn than its competitors due to the needless mental overhead from all its flaws.

Consistent languages are easier to learn.

Re:Tell HN: I think you're downplaying the PHP community by adambrenecki on Friday October 14, 2016 @06:38PM (#12711634)
Perhaps, but when it comes to PHP's niche—websites—it's easier to _get started_ than basically any other language.

Got a simple Hello World PHP site? Open your SFTP client, drag and drop, done.

Got a Hello World Python app? You have to know about WSGI adapters, process monitors, usually some sort of reverse proxying, how you're going to handle your static files, and so on.

Oh, and let's not forget that to even get to that point, you needed to use a framework of some kind, which meant wrestling with Pip and virtualenvs; you can't just 'echo "Hello World"'.

I'm picking on Python here because web dev in Python is my day job, but the story is similar for many other languages.

Re:Tell HN: I think you're downplaying the PHP community by gkya on Friday October 14, 2016 @08:35PM (#12712067)
Why bother? You can just put your Python script into a CGI-enabled server like you do with PHP:

    #!/usr/local/bin/python2
    import cgi
    print "Content-type: text/html\n\n"
    query = cgi.FieldStorage()
    if "name" in query:
        print "Hello, %s!" % query["name"].value
    else:
        print """
        <p>Insert your name and hit Go! to get greeted!</p>
        <form action='/cgi-bin/hello-py.cgi' method='get'>
          <input type='text' name='name'/>
          <button type='submit'>Go!</button>
        </form>"""
chmod 750 and go.
Re:Tell HN: I think you're downplaying the PHP community by TazeTSchnitzel on Friday October 14, 2016 @07:10PM (#12711758)
Yes, this is certainly an advantage. Getting to hello world is easier.

Though that might be mitigated somewhat by things like Heroku and App Engine. My first Python code was with the latter, and I didn't even realise I was using it.

Re:Tell HN: I think you're downplaying the PHP community by jjpe on Saturday October 15, 2016 @01:57AM (#12712926)
Actually, I'd say that these days that crown has been taken from PHP by Node.JS. It may not be as popular but it is definitely easier to work with than PHP, if only becausee it's 1. JavaScript and 2. Doesn't have most (all?) of the warts of PHP.

Of course it introduces a few of its own but on the whole I'd say Node is definitely easier to work with for a newcomer.

Re:Tell HN: I think you're downplaying the PHP community by colshrapnel on Saturday October 15, 2016 @12:45AM (#12712743)
"PHP is inconsistent" is a myth cherished by haters.

Besides, real world evidence is against your theoritical musings.

Re:Tell HN: I think you're downplaying the PHP community by bopinto on Saturday October 15, 2016 @05:24AM (#12713358)
Care to disagree. E.g.: array_map (callable $callback, array $array1 [, array $... ] ) and array_filter (array $array [, callable $callback [, int $flag = 0 ]]) Both are operations over an array, but the arguments aren't in the same order. I understand the why, but it is not consistent and (in my opinion) wrong, from a point of view of writing a language. This also makes it more difficult for someone to learn the language, as it was said. Let me add that Rasmus admitted he didn't know how to write programming languages, when he wrote PHP. He just wanted something that was easy and fast for web designers to learn.

That said, PHP is my go-to language when I what to get up something fast and with not much server side logic.

Re:Tell HN: I think you're downplaying the PHP community by colshrapnel on Saturday October 15, 2016 @08:01AM (#12713668)
I've got a real good advise for you. Get yourself a good IDE with a code-completion feature. Trust me, the very next day you'll forget your grief :)
Re:Tell HN: I think you're downplaying the PHP community by TazeTSchnitzel on Saturday October 15, 2016 @07:57AM (#12713659)
What myth? PHP has inconsistency throughout. It's one of the most commonly cited complaints about the standard library, for example, which lacks a consistent naming scheme, consistent parameter order, consistent error-handling behaviour, and so on.
Re:Tell HN: I think you're downplaying the PHP community by colshrapnel on Saturday October 15, 2016 @08:19AM (#12713706)
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.

Re:Tell HN: I think you're downplaying the PHP community by babyrainbow on Saturday October 15, 2016 @11:43AM (#12714352)
>do not work neither for learners who prefer PHP over "more consistent languages"

They prefer Php because they don't know any better, because they are, well, learners.

>nor professional developers, who just get their job done...

Because they were the "learners" in the earlier statement. Now they are "professionals", but still don't know any better, because they were happy from the beginning, and there is a whole community of Php apologists who will provide validation, so they didn't bothered to look elsewhere.

And someone who looked elsewhere saw a lot of unfamiliar stuff, and were turned off by it. So remained tied to php for ever...It is quite sad.

Re:Tell HN: I think you're downplaying the PHP community by colshrapnel on Saturday October 15, 2016 @12:05PM (#12714436)
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.

Re:Tell HN: I think you're downplaying the PHP community by TazeTSchnitzel on Saturday October 15, 2016 @03:26PM (#12715313)
> You guys are so fixed on that standard library thing that I am getting scared.

It's hardly the only thing wrong with PHP, it's just one particular example.

> 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

How can it be especially not a problem? That would imply it was a problem and is now less of one.

In any case, yes, you can maybe learn to deal with it, but it saves time to simply work with a language which doesn't have these problems.

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

Can you actually defend why these examples “don't work”? Learners and professionals alike have to deal with PHP's quirks.