JS libraries

Robert-B

Member
What are people opinions on the new JS libraries such as Angular, Ember, Backbone and Node. Do you think theses are set to replace PHP? Or do you think that all websites will be JS based?
 
Last edited:

chrishirst

Well-Known Member
Staff member
Until they can communicate DIRECTLY with server side filing systems and database servers ....



... No.

Java Servlets (Tomcat), Ruby [on Rails] have both been hailed as replacing PHP in the past few years, hasn't happened yet,
 

ronaldroe

Super Moderator
Staff member
PHP is a great language too.

No, it isn't.

But to the first question, it's important to understand that Node is completely different from the others you listed, and for that matter, isn't a library at all. It's a server-side component that uses JS as its language. I think it could easily unseat PHP, and I frankly hope it does. JS is a great language.

The others you mentioned can never replace anything, as they're client-side helper libraries. In other words, junk add-ons that people will come to over-rely upon.
 

chrishirst

Well-Known Member
Staff member
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.
 

ronaldroe

Super Moderator
Staff member
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.

You've answered your own question. For me, it's exactly that. PHP suffers from the old "too many cooks in the kitchen" syndrome. There is no central body helping to ensure the language makes sense and adheres to standards. The big draw for me with JS is its consistency. No matter what you're working with (at least from my experience so far), things work the same, behavior is predictable. It doesn't matter if it's core JS, JSON, the drag and drop API or what-have-you, working with whatever is consistent. I don't have to run down workarounds for goofy built in behaviors.
 

chrishirst

Well-Known Member
Staff member
Microsoft killed off ASP in favour of ASP.NET and ASP / ASP.NET is ONLY available on M$ Windows operating systems therefore most definitely NOT 'free'.

But is there a better alternative for server-side scripting?
'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 :) )

PHP is a powerful language, and 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.
 

ronaldroe

Super Moderator
Staff member
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...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.
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.
 

Frank

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

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.
 

chrishirst

Well-Known Member
Staff member
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.
My 'manner' is just matter of fact posting, ....

What I decide is "better" than PHP is probably not what every one would consider "better".

And given the constraints of;

"One that also is installed on (practically) all servers and that is free?"

It doesn't leave many options for alternatives.

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.
 

Frank

New Member
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.
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?

Or would dropping the prerequisite of it being free make matters easier? Again: ASP? Or are ASP and ASP.NET just as incompatible as the Python versions 2 and 3? And should we therefore expect more ASP version incompatibilities in the future, if your crystal ball is able to tell that?

I would need this information because in the near future the health care IT project for which I am now making the clinimetrical set-up and the interface is to be connected to the databases. And although I will not be doing the back-end part myself, I would like to know such basic matters. It has not yet been decided which server-side language it is going to be.
 
Last edited:

chrishirst

Well-Known Member
Staff member
Can we get a little perspective here??

To start off:
ASP and ASP.NET or NOT actually languages. They are frameworks with MULTIPLE languages.

ASP has VBScript (visual basic scripting syntax) and JScript (javascript syntax)

ASP.NET has VB.net (visual basic) C# (C Sharp C/C++ syntax) and J# (J sharp Java Syntax)

I haven't said that PHP is a "mediocre" language, FAR from, it it is a very powerful scripting language. It's drawback is the lack of consistency in function naming and function syntax.

A purely aesthic point maybe, but one that makes PHP more difficult to use than it actually needs to be. I have been coding in PHP for over twelve years and I STILL have to refer to the 'online' manual for some common function names. For ASP coding I could write whole applications without refering to anything other than for the syntax of infrequently used functions/methods

Dropping the "freely/widely available" prerequisties would allow inclusion of other alternatives that are relatively simpler to learn and use than PHP is, such as ColdFusion, SMX, LUA or lasso

Learning Python? No more difficult than VB Script or javascript is, if you have a grounding in either, Python should be almost second nature. For anyone coming from vbscript, Python variables are also not statically typed and for the javascripters all Python variables are objects.

Though one thing to note ... Despite what almost every Internet tutorial seems to indicate, variable names do NOT actually have to start with 'my' :)
 

ronaldroe

Super Moderator
Staff member
You won the contest "Least helpful answers." With an extra bonus because you are a super moderator.

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.

Though one thing to note ... Despite what almost every Internet tutorial seems to indicate, variable names do NOT actually have to start with 'my' :)

Nice to see someone else cringes at that. :)
 

Frank

New Member
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.
And being helpful is not a task of a super moderator? What kind of forum has this become then?

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. So the question is who is the one that paid the least attention. I think the neutral reader will agree I was not the one.

I suppose it depends what you are trying to build. I have seen a PHP framework called Laravel which looks interesting.
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.
 

ronaldroe

Super Moderator
Staff member
And being helpful is not a task of a super moderator?

It is, I just wasn't trying to be helpful in that particular moment. I kinda was, I suppose, I just laced it with a bit of sarcasm.

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.

And when you dropped that prerequisite, that opened up all of the other options that had already been mentioned that didn't fit. My point was and still is, your question of what languages are out there has already been answered, but allow me to take a moment to be helpful, so you don't have to actually do the work yourself:

'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 :) )
 

chrishirst

Well-Known Member
Staff member
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."
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.

That left Python, of which SO says: "Two similar but incompatible versions of Python are in widespread use (2 and 3)."
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.
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;

Code:
#!/usr/bin/env python3
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.

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
 

Frank

New Member
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;

Code:
#!/usr/bin/env python3
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.
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?

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
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?
 
Top