Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > What is a software engineer?

Reply
Thread Tools

What is a software engineer?

 
 
Garrett Smith
Guest
Posts: n/a
 
      11-25-2009
Thomas 'PointedEars' Lahn wrote:
> Garrett Smith wrote:
>
>> Thomas 'PointedEars' Lahn wrote:
>>> Garrett Smith wrote:
>>>> Richard Cornford wrote:
>>>>> Garrett Smith wrote:


[snip]

> Score adjusted
>


That is exactly what I'm talking about with pedantic snits.
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
 
Reply With Quote
 
 
 
 
Richard Cornford
Guest
Posts: n/a
 
      11-25-2009
On Nov 25, 4:57 am, Garrett Smith wrote:
> Thomas 'PointedEars' Lahn wrote:
>> Garrett Smith wrote:
>>> Richard Cornford wrote:

<snip>
>>>> It would be of use to anyone who wanted to dynamically import
>>>> script source text. It is a pity that much of the dynamic
>>>> importing of script source text that goes on at present is
>>>> already largely inadvisable.


>>> Importing script source text is possible by assigning a property
>>> to a globally-accessible identifier. Given an |items| object:

>
> ^^^^^^^^^^^^^^^^^^^^^^^^
>>> "if(typeof items !== 'undefined') {"
>>> + "items.myNewItem = { name : 'a' };"
>>> +"}";
>>>
>>> What is inadvisable?

<snip>
>> 2. What does this have to do with importing "script source text"?

>
> The example posted is a string. That string could have been fetched
> via XHR, which can be eval'd. I should have mentioned that.

<snip>

I did wonder what you were on about, and how you expected anyone to
judge the (lack of) advisability of a fragment of code without any
context.

What you are saying is that this is an instruction to act (set the
value of a property) sent from the server to the client, where the
instruction and its parameters are represented by the code that takes
the action.

The problem I would have with that example is that it has implied a
coupling between the code coming from the back-end and the code/
environment on the client while spreading the client-side code across
multiple sources. This is not something that I have ever considered
advisable, and is something that I have seen cause problems.
specifically, if something needs to be changed (in the client-side
code, say) it can either become difficult to change it because of the
trouble/inconvenience/impossibility of changing the server-side code
and/or database entries, or the attempt to make those changes across
the multiple locations fails to update all the relevant code coming
from the server, leaving odd errors popping up when those unaltered
code fragments are sent from the client.

Sending a chunk of code to be - eval-ed on the client is a very simple
way for the server to issue an instruction to the client, but
abstracting the issuing of instructions does not have to significantly
more complex. In the case of your example, what you appear to have is
a conditional instruction to set the value of a property named
'myNewItem' on an object identified as 'items' to a JSON-like (i.e.
pure name/value pair data) object reference, but in addition to that
the code sent has also mandated how that action will be carried out.

View the thing sent form the server as an action to take and a set of
parameters for that action and it should be easy to see how the same
could be achieved with little or no coupling between the server-side
and the client side. The instruction could be sent as JSON such as:-

'{"action":"conditionalAssign","subject":"item","p roperty":"myNewItem'","value":
{ "name":"a"}}'

- and the client-side code can examine that to determine how it is
going to set about carrying out the required action. In this way the
details of how it acts are completely independent of the instructions
to act issued by the server, and so can be freely modified (extended,
etc.) without any need to even look at the code issuing the
instructions.

It is, of course, possible to send sequences of such instructions (say
as arrays of such data) to achieve more complex outcomes on the
client.

Richard.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SMS gateway software, SMS gateway, SMS software, SMS server, SMPP software, WAP Push John UK VOIP 0 08-29-2007 05:14 AM
SMS gateway software, SMS gateway, SMS software, SMS server, SMPP software, WAP Push John ASP .Net 0 08-29-2007 05:08 AM
SMS gateway software, SMS gateway, SMS software, SMS server, SMPP software, WAP Push John Java 0 08-28-2007 05:53 AM
Software Synoptics LattisRing 2715b Remote Software. Howard Huntley Cisco 1 08-27-2004 01:34 AM



Advertisments