3 ms·
It's harder to learn than its competitors due to the needless mental overhead from all its flaws. Consistent languages are easier to learn.
by TazeTSchnitzel 10y ago
It's harder to learn than its competitors due to the needless mental overhead from all its flaws.
Consistent languages are easier to learn.
- adambrenecki 10y agoPerhaps, 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.
- TazeTSchnitzel 10y agoYes, 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.
- gkya 10y agoWhy 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.
- jjpe 10y agoActually, 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.
- jjpe 10y agoActually, 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.
- colshrapnel 10y ago"PHP is inconsistent" is a myth cherished by haters. Besides, real world evidence is against your theoritical musings.
- bopinto 10y agoCare 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.
- colshrapnel 10y agoI'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 :)
- TazeTSchnitzel 10y agoWhat 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.
- colshrapnel 10y agoYou 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.