Click here to get back home

Re: Which Is The Better Approach To Working With Javascript?

 HomeNewsGroups | Search | About
 comp.lang.php    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Re: Which Is The Better Approach To Working With Javascript? Michael Fesser 07-09-2008
Posted by Michael Fesser on July 9, 2008, 12:52 pm
Please log in for more thread options
.oO(The Natural Philosopher)

>Patient Guy wrote:
>>
>> So, based on your response, you are telling me that a PHP processing
>> implementation has no interprocess communication capability, or ability to
>> interface with a (Java)script interpreter.
>>
>
>Java SCRIPT (as opposed to java) runs in the browser exclusively.

Wrong. Various engines for running JS outside a browser context exist,
as already mentioned in the thread. JS is already incorporated in a
number of applications and document types that have nothing to do with
HTML or a browser.

http://en.wikipedia.org/wiki/Javascript#Uses_outside_web_pages

>It
>makes local decsison without reference to the server. This is great for
>speed..you can change screen appearance fast and dynamically, producing
>e.g. drop down menus and the like) at the expense of having to download
>all the code TO the browser and more data than you probably need.
>
>PHP is EXCLUSIVELY server side

PHP can also run in a browser (a proof-of-concept plugin for IE exists),
on the local machine, as a shell script, with a GUI ... It could even be
used like JS or Python for scripting in standalone applications.

>Halfway huse s do exist - Ajax - where partial page reloads are done
>dynamically, using I think javascipt on e browser and PHP server side.

AJAX has nothing to do with either of them, at least not by definition.
It's just an overestimated hype, but in fact it's nothing new. It's just
a slightly different way for sending HTTP requests, but doesn't say
anything about the language(s) to use or the type of data that's sent.

A plugin or even an external application might be able to access the
browser's XHR object directly without any JavaScript, and the data
doesn't have to be in XML format. So what's left from "AJAX" in
practice? Just the "A" for asynchronous.

>> A server, or a server-associated process, can start a script host, passing
>> some form of input to it, and the script host does the script
>> interpretation, while the calling process waits for output.
>>
>> However this is achieved, PHP (by design?) has no script interface, based
>> on your response.
>>
>
>Oh, its perfectly possible to pass commands from PHP to some other
>engine: teh classic example is the Mysql server, which is interfaced to
>PHP with a library ..but no one would ever attempt to execuste java
>SCRIPT on the server

There's no reason to not do it. And in fact some do.

>because its a bloody awful language

Depends. It's a totally different way of thinking and programming. You
simply can't compare it with a classical OOP language. But once you've
understood it, you might find prototype-based programming quite useful
in certain situations.

>and is only
>by and large written for broswers.

No language is written just for a single environment.

>Once you are server side you can in principle write in any language you
>like, PHP being just a common popular one, but shell script python, C,
>C++. PERL Java and so on are perfectly possible.

Exactly. You can use _every_ programming language you like. And JS
undoubtly _is_ a programming language.

Micha

Posted by The Natural Philosopher on July 9, 2008, 2:06 pm
Please log in for more thread options
Michael Fesser wrote:
> .oO(The Natural Philosopher)
>
>> Patient Guy wrote:
>>> So, based on your response, you are telling me that a PHP processing
>>> implementation has no interprocess communication capability, or ability to
>>> interface with a (Java)script interpreter.
>>>
>> Java SCRIPT (as opposed to java) runs in the browser exclusively.
>
> Wrong. Various engines for running JS outside a browser context exist,
> as already mentioned in the thread. JS is already incorporated in a
> number of applications and document types that have nothing to do with
> HTML or a browser.
>
> http://en.wikipedia.org/wiki/Javascript#Uses_outside_web_pages
>
>> It
>> makes local decsison without reference to the server. This is great for
>> speed..you can change screen appearance fast and dynamically, producing
>> e.g. drop down menus and the like) at the expense of having to download
>> all the code TO the browser and more data than you probably need.
>>
>> PHP is EXCLUSIVELY server side
>
> PHP can also run in a browser (a proof-of-concept plugin for IE exists),
> on the local machine, as a shell script, with a GUI ... It could even be
> used like JS or Python for scripting in standalone applications.
>
>> Halfway huse s do exist - Ajax - where partial page reloads are done
>> dynamically, using I think javascipt on e browser and PHP server side.
>
> AJAX has nothing to do with either of them, at least not by definition.
> It's just an overestimated hype, but in fact it's nothing new. It's just
> a slightly different way for sending HTTP requests, but doesn't say
> anything about the language(s) to use or the type of data that's sent.
>
> A plugin or even an external application might be able to access the
> browser's XHR object directly without any JavaScript, and the data
> doesn't have to be in XML format. So what's left from "AJAX" in
> practice? Just the "A" for asynchronous.
>
>>> A server, or a server-associated process, can start a script host, passing
>>> some form of input to it, and the script host does the script
>>> interpretation, while the calling process waits for output.
>>>
>>> However this is achieved, PHP (by design?) has no script interface, based
>>> on your response.
>>>
>> Oh, its perfectly possible to pass commands from PHP to some other
>> engine: teh classic example is the Mysql server, which is interfaced to
>> PHP with a library ..but no one would ever attempt to execuste java
>> SCRIPT on the server
>
> There's no reason to not do it. And in fact some do.
>
>> because its a bloody awful language
>
> Depends. It's a totally different way of thinking and programming. You
> simply can't compare it with a classical OOP language. But once you've
> understood it, you might find prototype-based programming quite useful
> in certain situations.
>
>> and is only
>> by and large written for broswers.
>
> No language is written just for a single environment.
>
>> Once you are server side you can in principle write in any language you
>> like, PHP being just a common popular one, but shell script python, C,
>> C++. PERL Java and so on are perfectly possible.
>
> Exactly. You can use _every_ programming language you like. And JS
> undoubtly _is_ a programming language.
>
> Micha

Strictly you are correct. In practice for most people I stand by the
original post.

I see almost no reason to use javascript at all except when its the only
option, and that is the case when its the only (well supported) language
a browser can run.

Likewise expecting people to have php plugins for their browsers..is..at
best, expecting a lot.


Oh, and several languages have been written for a single environment: I
wrote one myself in fact.






Posted by Barry on July 9, 2008, 3:01 pm
Please log in for more thread options

> Michael Fesser wrote:
>> .oO(The Natural Philosopher)
>>
>>> Patient Guy wrote:
>>>> So, based on your response, you are telling me that a PHP processing
>>>> implementation has no interprocess communication capability, or ability
>>>> to interface with a (Java)script interpreter.
>>>>
>>> Java SCRIPT (as opposed to java) runs in the browser exclusively.
>>
>> Wrong. Various engines for running JS outside a browser context exist,
>> as already mentioned in the thread. JS is already incorporated in a
>> number of applications and document types that have nothing to do with
>> HTML or a browser.
>>
>> http://en.wikipedia.org/wiki/Javascript#Uses_outside_web_pages
>>
>>> It makes local decsison without reference to the server. This is great
>>> for speed..you can change screen appearance fast and dynamically,
>>> producing e.g. drop down menus and the like) at the expense of having to
>>> download all the code TO the browser and more data than you probably
>>> need.
>>>
>>> PHP is EXCLUSIVELY server side
>>
>> PHP can also run in a browser (a proof-of-concept plugin for IE exists),
>> on the local machine, as a shell script, with a GUI ... It could even be
>> used like JS or Python for scripting in standalone applications.
>>
>>> Halfway huse s do exist - Ajax - where partial page reloads are done
>>> dynamically, using I think javascipt on e browser and PHP server side.
>>
>> AJAX has nothing to do with either of them, at least not by definition.
>> It's just an overestimated hype, but in fact it's nothing new. It's just
>> a slightly different way for sending HTTP requests, but doesn't say
>> anything about the language(s) to use or the type of data that's sent.
>>
>> A plugin or even an external application might be able to access the
>> browser's XHR object directly without any JavaScript, and the data
>> doesn't have to be in XML format. So what's left from "AJAX" in
>> practice? Just the "A" for asynchronous.
>>
>>>> A server, or a server-associated process, can start a script host,
>>>> passing some form of input to it, and the script host does the script
>>>> interpretation, while the calling process waits for output.
>>>> However this is achieved, PHP (by design?) has no script interface,
>>>> based on your response.
>>>>
>>> Oh, its perfectly possible to pass commands from PHP to some other
>>> engine: teh classic example is the Mysql server, which is interfaced to
>>> PHP with a library ..but no one would ever attempt to execuste java
>>> SCRIPT on the server
>>
>> There's no reason to not do it. And in fact some do.
>>
>>> because its a bloody awful language
>>
>> Depends. It's a totally different way of thinking and programming. You
>> simply can't compare it with a classical OOP language. But once you've
>> understood it, you might find prototype-based programming quite useful
>> in certain situations.
>>
>>> and is only by and large written for broswers.
>>
>> No language is written just for a single environment.
>>
>>> Once you are server side you can in principle write in any language you
>>> like, PHP being just a common popular one, but shell script python, C,
>>> C++. PERL Java and so on are perfectly possible.
>>
>> Exactly. You can use _every_ programming language you like. And JS
>> undoubtly _is_ a programming language.
>>
>> Micha
>
> Strictly you are correct. In practice for most people I stand by the
> original post.
>
> I see almost no reason to use javascript at all except when its the only
> option, and that is the case when its the only (well supported) language a
> browser can run.
>
> Likewise expecting people to have php plugins for their browsers..is..at
> best, expecting a lot.
>
>
> Oh, and several languages have been written for a single environment: I
> wrote one myself in fact.

'several' is not 'one'...and i hardly think anyone but you actually uses
your home-brewed version. ;^)

can you name another of the several?



Posted by Jerry Stuckle on July 9, 2008, 5:57 pm
Please log in for more thread options
Barry wrote:
>> Michael Fesser wrote:
>>> .oO(The Natural Philosopher)
>>>
>>>> Patient Guy wrote:
>>>>> So, based on your response, you are telling me that a PHP processing
>>>>> implementation has no interprocess communication capability, or ability
>>>>> to interface with a (Java)script interpreter.
>>>>>
>>>> Java SCRIPT (as opposed to java) runs in the browser exclusively.
>>> Wrong. Various engines for running JS outside a browser context exist,
>>> as already mentioned in the thread. JS is already incorporated in a
>>> number of applications and document types that have nothing to do with
>>> HTML or a browser.
>>>
>>> http://en.wikipedia.org/wiki/Javascript#Uses_outside_web_pages
>>>
>>>> It makes local decsison without reference to the server. This is great
>>>> for speed..you can change screen appearance fast and dynamically,
>>>> producing e.g. drop down menus and the like) at the expense of having to
>>>> download all the code TO the browser and more data than you probably
>>>> need.
>>>>
>>>> PHP is EXCLUSIVELY server side
>>> PHP can also run in a browser (a proof-of-concept plugin for IE exists),
>>> on the local machine, as a shell script, with a GUI ... It could even be
>>> used like JS or Python for scripting in standalone applications.
>>>
>>>> Halfway huse s do exist - Ajax - where partial page reloads are done
>>>> dynamically, using I think javascipt on e browser and PHP server side.
>>> AJAX has nothing to do with either of them, at least not by definition.
>>> It's just an overestimated hype, but in fact it's nothing new. It's just
>>> a slightly different way for sending HTTP requests, but doesn't say
>>> anything about the language(s) to use or the type of data that's sent.
>>>
>>> A plugin or even an external application might be able to access the
>>> browser's XHR object directly without any JavaScript, and the data
>>> doesn't have to be in XML format. So what's left from "AJAX" in
>>> practice? Just the "A" for asynchronous.
>>>
>>>>> A server, or a server-associated process, can start a script host,
>>>>> passing some form of input to it, and the script host does the script
>>>>> interpretation, while the calling process waits for output.
>>>>> However this is achieved, PHP (by design?) has no script interface,
>>>>> based on your response.
>>>>>
>>>> Oh, its perfectly possible to pass commands from PHP to some other
>>>> engine: teh classic example is the Mysql server, which is interfaced to
>>>> PHP with a library ..but no one would ever attempt to execuste java
>>>> SCRIPT on the server
>>> There's no reason to not do it. And in fact some do.
>>>
>>>> because its a bloody awful language
>>> Depends. It's a totally different way of thinking and programming. You
>>> simply can't compare it with a classical OOP language. But once you've
>>> understood it, you might find prototype-based programming quite useful
>>> in certain situations.
>>>
>>>> and is only by and large written for broswers.
>>> No language is written just for a single environment.
>>>
>>>> Once you are server side you can in principle write in any language you
>>>> like, PHP being just a common popular one, but shell script python, C,
>>>> C++. PERL Java and so on are perfectly possible.
>>> Exactly. You can use _every_ programming language you like. And JS
>>> undoubtly _is_ a programming language.
>>>
>>> Micha
>> Strictly you are correct. In practice for most people I stand by the
>> original post.
>>
>> I see almost no reason to use javascript at all except when its the only
>> option, and that is the case when its the only (well supported) language a
>> browser can run.
>>
>> Likewise expecting people to have php plugins for their browsers..is..at
>> best, expecting a lot.
>>
>>
>> Oh, and several languages have been written for a single environment: I
>> wrote one myself in fact.
>
> 'several' is not 'one'...and i hardly think anyone but you actually uses
> your home-brewed version. ;^)
>
> can you name another of the several?
>
>
>

PL/S. Used internally by IBM for system development in the 80's, it was
a subset of PL/1 with inline assembler.

Microcode for any of the microprocessors out there. All are written in
specialized languages (same for microcode on mainframes).

There are lots of specialized languages out there. But since they are
specialized, you seldom hear of them unless you have a need for them.
Not that there's anything secret about most - just that they are seldom
mentioned outside of the groups which use them.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================


Posted by Barry on July 10, 2008, 1:35 am
Please log in for more thread options

> Barry wrote:
>>> Michael Fesser wrote:
>>>> .oO(The Natural Philosopher)
>>>>
>>>>> Patient Guy wrote:
>>>>>> So, based on your response, you are telling me that a PHP processing
>>>>>> implementation has no interprocess communication capability, or
>>>>>> ability to interface with a (Java)script interpreter.
>>>>>>
>>>>> Java SCRIPT (as opposed to java) runs in the browser exclusively.
>>>> Wrong. Various engines for running JS outside a browser context exist,
>>>> as already mentioned in the thread. JS is already incorporated in a
>>>> number of applications and document types that have nothing to do with
>>>> HTML or a browser.
>>>>
>>>> http://en.wikipedia.org/wiki/Javascript#Uses_outside_web_pages
>>>>
>>>>> It makes local decsison without reference to the server. This is great
>>>>> for speed..you can change screen appearance fast and dynamically,
>>>>> producing e.g. drop down menus and the like) at the expense of having
>>>>> to download all the code TO the browser and more data than you
>>>>> probably need.
>>>>>
>>>>> PHP is EXCLUSIVELY server side
>>>> PHP can also run in a browser (a proof-of-concept plugin for IE
>>>> exists),
>>>> on the local machine, as a shell script, with a GUI ... It could even
>>>> be
>>>> used like JS or Python for scripting in standalone applications.
>>>>
>>>>> Halfway huse s do exist - Ajax - where partial page reloads are done
>>>>> dynamically, using I think javascipt on e browser and PHP server side.
>>>> AJAX has nothing to do with either of them, at least not by definition.
>>>> It's just an overestimated hype, but in fact it's nothing new. It's
>>>> just
>>>> a slightly different way for sending HTTP requests, but doesn't say
>>>> anything about the language(s) to use or the type of data that's sent.
>>>>
>>>> A plugin or even an external application might be able to access the
>>>> browser's XHR object directly without any JavaScript, and the data
>>>> doesn't have to be in XML format. So what's left from "AJAX" in
>>>> practice? Just the "A" for asynchronous.
>>>>
>>>>>> A server, or a server-associated process, can start a script host,
>>>>>> passing some form of input to it, and the script host does the script
>>>>>> interpretation, while the calling process waits for output.
>>>>>> However this is achieved, PHP (by design?) has no script interface,
>>>>>> based on your response.
>>>>>>
>>>>> Oh, its perfectly possible to pass commands from PHP to some other
>>>>> engine: teh classic example is the Mysql server, which is interfaced
>>>>> to PHP with a library ..but no one would ever attempt to execuste java
>>>>> SCRIPT on the server
>>>> There's no reason to not do it. And in fact some do.
>>>>
>>>>> because its a bloody awful language
>>>> Depends. It's a totally different way of thinking and programming. You
>>>> simply can't compare it with a classical OOP language. But once you've
>>>> understood it, you might find prototype-based programming quite useful
>>>> in certain situations.
>>>>
>>>>> and is only by and large written for broswers.
>>>> No language is written just for a single environment.
>>>>
>>>>> Once you are server side you can in principle write in any language
>>>>> you like, PHP being just a common popular one, but shell script
>>>>> python, C, C++. PERL Java and so on are perfectly possible.
>>>> Exactly. You can use _every_ programming language you like. And JS
>>>> undoubtly _is_ a programming language.
>>>>
>>>> Micha
>>> Strictly you are correct. In practice for most people I stand by the
>>> original post.
>>>
>>> I see almost no reason to use javascript at all except when its the only
>>> option, and that is the case when its the only (well supported) language
>>> a browser can run.
>>>
>>> Likewise expecting people to have php plugins for their browsers..is..at
>>> best, expecting a lot.
>>>
>>>
>>> Oh, and several languages have been written for a single environment: I
>>> wrote one myself in fact.
>>
>> 'several' is not 'one'...and i hardly think anyone but you actually uses
>> your home-brewed version. ;^)
>>
>> can you name another of the several?
>
> PL/S. Used internally by IBM for system development in the 80's, it was a
> subset of PL/1 with inline assembler.
>
> Microcode for any of the microprocessors out there. All are written in
> specialized languages (same for microcode on mainframes).
>
> There are lots of specialized languages out there. But since they are
> specialized, you seldom hear of them unless you have a need for them. Not
> that there's anything secret about most - just that they are seldom
> mentioned outside of the groups which use them.

agreed, jerry. i was having fun with phil's one example to prove his point
being a homemade language. the question i posed was just encouragement from
him to follow with the route he (and you) just did.



Similar ThreadsPosted
Re: Which Is The Better Approach To Working With Javascript? July 8, 2008, 7:00 pm
Re: Which Is The Better Approach To Working With Javascript? July 9, 2008, 11:20 am
Re: Which Is The Better Approach To Working With Javascript? July 9, 2008, 11:35 am
Re: Which Is The Better Approach To Working With Javascript? July 9, 2008, 11:57 am
Re: Which Is The Better Approach To Working With Javascript? July 9, 2008, 6:05 pm
Re: Which Is The Better Approach To Working With Javascript? July 10, 2008, 11:13 am
Re: Which Is The Better Approach To Working With Javascript? July 10, 2008, 11:18 am
My CMS approach - good or bad? July 21, 2004, 11:43 am
COM's approach to == vs. === June 14, 2006, 9:20 am
Approach to internationalization January 7, 2008, 3:26 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap