PHP is a great language too.
If they help people I am all for using anything that makes my job easier.
So PHP is a crap language but JS is a great languange? Why?
They both use a C style syntax and structure, the only complaint I ever make about PHP is the lack of a cohesive function naming 'paradigm', but that is because of the way it has 'grown up' with unco-ordinated volunteers "bolting on" 'bits' on in their own way, javascript on the other hand started off with a defined structure and co-ordinators in the ECMA and the W3c ensuring that it stays that way.
It's not an easy language, I agree with that. But is there a better alternative for server-side scripting? One that also is installed on (practically) all servers and that is free? ASP?PHP is a crap language
'better' is subjective, so until YOU actually try them there are only 'alternatives' which are Perl or Python for being on practically all servers.But is there a better alternative for server-side scripting?
PHP is a horribly inconsistent language. It's a victim of too many cooks in the kitchen, and in PHP's case, the cooks aren't even working from the same cookbook.PHP...would be a great language if somebody took the developers (all of them) by the scruff of the neck and shook them until they understood the meaning of consistent.
I never said PHP was a difficult language. In fact, it's an incredibly easy language to learn. If you know JavaScript, you already know most of the syntax for PHP. But as Chris rightly quips,
PHP is a horribly inconsistent language. It's a victim of too many cooks in the kitchen, and in PHP's case, the cooks aren't even working from the same cookbook.
There are a good number of alternatives, the majority of which are open source, which Chris ran down pretty well for you.
My 'manner' is just matter of fact posting, ....After reading the already linked article, I would agree it is a crap language. But I still haven't seen any decent advice on better alternatives from you guys. Chris is just saying, in this typical unfriendly if not rude manner, that I should figure it out myself, after summing up all possible alternatives. That's not why I'm asking for advice, and its not something one can easily look up.
According to StackOverflow, "Two similar but incompatible versions of Python are in widespread use (2 and 3)." I don't wanna defend the inconsistencies and what else have you that makes PHP a mediocre language at best, but it seems to me then that there is no real alternative?Perl isn't everyones cup of tea, but I'll happily do Perl coding when necessary. But on many shared hosting environments Perl is either not installed or limited to basic CGI scripts.
Same with Python, I find it fairly simple but then I run Linux as my primary operating system (I have no Windows machines at all) so Python is handy for throwing quick task automation scripts together.
...but it seems to me then that there is no real alternative?
How many alternatives are you looking for? Every one I'm aware of has been listed here.
You won the contest "Least helpful answers." With an extra bonus because you are a super moderator.
Though one thing to note ... Despite what almost every Internet tutorial seems to indicate, variable names do NOT actually have to start with 'my'![]()
And being helpful is not a task of a super moderator? What kind of forum has this become then?I wasn't trying to be helpful, so I guess I call that a win. I was simply pointing out that for the second time you've asked for alternatives, and I'm wondering why that is. Chris wrote a pretty helpful post not only naming but describing the most used alternatives, only for you to ask 3 or 4 posts down what the alternatives are. You won the "Least Attention Paid" contest. Congrats.
I've been using basic PHP for many years already, without much problems, but if I ever have to do more complicated back-end coding myself, I will certainly look into that. Thanks.I suppose it depends what you are trying to build. I have seen a PHP framework called Laravel which looks interesting.
And being helpful is not a task of a super moderator?
In post #15, Chris more ore less narrowed his advice on alternatives down to Perl and Python, but stated that "on many shared hosting environments Perl is either not installed or limited to basic CGI scripts." That left Python, of which SO says: "Two similar but incompatible versions of Python are in widespread use (2 and 3)." And as the primary objection against PHP was/is its inconsistency, that left practically zero alternatives.
At the same time however, I dropped the prerequisite of being free and widely installed on servers, which made me ask anew about the degree of difficulty/inconsistency of ASP.
'better' is subjective, so until YOU actually try them there are only 'alternatives' which are Perl or Python for being on practically all servers.
Some servers have JSP (Java Server Pages) using Apache Tomcat. Ruby [on Rails] may be installed or even Node.js which is being hailed as the latest and greatest in Server scripting (Just like Ruby [on Rails] was a few years ago, no offence to the guys at Joyent)
An opinion made from observation not an absolute. I cannot and do not know what hosting environment Robert-B or anyone else is or will be using, so it is anecdotal advice for anyone reading this thread. A "caveat emptor" for the budding programmers as it where as I am sure you are well aware.In post #15, Chris more ore less narrowed his advice on alternatives down to Perl and Python, but stated that "on many shared hosting environments Perl is either not installed or limited to basic CGI scripts."
You are misreprensenting that point to suit your argument, as I believe that they may be discussing the fact that there are significant differences between Python 2.x (2.7.7 currently) and Python 3.x (3.4.4 currently). This is not an "inconsisteny" it is a version change with improved and expanded features.That left Python, of which SO says: "Two similar but incompatible versions of Python are in widespread use (2 and 3)."
#!/usr/bin/env python3
OK, we're getting closer to the point where I think I understand. But just to make sure: does this mean that Python 2 and 3 can both be installed on a server and that the web dev choses which version to use by means of the code your provided?So, certainly there are two incompatible versions of Python, however they are NOT available in parallel and/or simultaneously, because even if both versions are installed on the same machine environment, Python 2 will be the default and to invoke Python 3 in a script requires the programmer to KNOW that Python 3 is required by adding;
to the script to start a Python 3 interpreter instance for that script. Python 2 and Python 3 coding cannot co-exist in the same script blocks.Code:#!/usr/bin/env python3
I'm getting that too, in as far as I got the first point. But I'm wondering about this: I sometimes, even though rarely, see the PHP file extensions .php4 and .php5. Do they act as PHP version commands, just like the above code your provided? In other words: if PHP5 is installed on a server, can the web dev command the server to process older PHP files, say v.4, as PHP4? In short: is PHP backwards compatible if the file extension 'asks' for an older PHP processing?The inconsistency we are refering to with PHP are the ones in the same versions, ie; the lack of a cohesive naming system within the SAME system, where function naming semantics appear to be chosen at random.
functionname
FunctionName
function_name
Function_name
Function_Name
With Perl, Python, javascript and so on the function names are consistent, certainly they are case sensitive but the case of the names is consistent and reasonably logical PHP function names are neither