4 .Net contract positions

C

Chris Smith

Stefan Ram said:
Such points of time also have the drawback that they are not
Lorentz invariant, i.e., they can not be extended to the whole
spacetime unless a specific frame of reference is chosen.

I don't know that "drawback" is the word I would have chosen. Perhaps
"property that is irrelevant in practice". :)

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
A

Arvind

Chris Smith wrote:
And quite a few features there are in that set. JavaScript has no types
at all, while Java provides moderately strong type rules.
--
<snip>

Javascript does support c-like Structure....you can define a structure

function dog (name)
{
this.name = name;
}

and then instantiate it too...

var mydog = new dog('Tony');
 
C

Chris Smith

Arvind said:
Javascript does support c-like Structure....you can define a structure

No, it doesn't. JavaScript implements objects (it is, after all, an OO
language). However, there is nothing analogous to a struct or class,
which would be an external specification of what members certain
categories of objects have.
function dog (name)
{
this.name = name;
}

and then instantiate it too...

var mydog = new dog('Tony');

and then

var yourdog = new dog('Fido');

mydog.poodlePoofiness = true;
if (yourdog.poodlePoofiness == false) ... /* CRASH */

So you see, each object and its members are distinct from any other
object and its members. The function that was used as a constructor for
the object is just that: an implementation choice of how to create an
object. It is no more a part of that object's identity than which
method you called last.

That doesn't fit the definition of a class or a struct.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
A

Arvind

Chris said:
No, it doesn't. JavaScript implements objects (it is, after all, an OO
language). However, there is nothing analogous to a struct or class,
which would be an external specification of what members certain
categories of objects have.


and then

var yourdog = new dog('Fido');

mydog.poodlePoofiness = true;
if (yourdog.poodlePoofiness == false) ... /* CRASH */

So you see, each object and its members are distinct from any other
object and its members. The function that was used as a constructor for
the object is just that: an implementation choice of how to create an
object. It is no more a part of that object's identity than which
method you called last.

That doesn't fit the definition of a class or a struct.

I am not sure i understood your argument, mypoint was about the
reference to types. Now this 'dog' type can definitely be passed around
and used like any other object....

<!--
<script>
function dog(nm)
{
this.name = nm;
//this.age = 5;
}

var mydog = new dog('roger');
var yourdog = new dog('smith');

mydog.age = 1;
yourdog.age = 2;

alert ("mydog.name="+mydog.name+" and mydog.age="+mydog.age);
alert ("yourdog.name="+yourdog.name+" and yourdog.age="+yourdog.age);

</script>
-->
 
C

Chris Smith

Arvind said:
I am not sure i understood your argument, mypoint was about the
reference to types.

JavaScript has no types. We weren't talking about types, anyway. We
were talking about classes, which JavaScript (some versions) also
doesn't have, nor does it have anything like them. You are attributing
too much meaning to "new dog(...)".
Now this 'dog' type can definitely be passed around
and used like any other object....

JavaScript DOES have objects. That doesn't mean it has classes or
types.

There is do 'dog' type. The only thing called 'dog' here is a function,
which happens to have been used as a constructor to create an object.
The interpreter doesn't possess any knowledge about that object just by
virtue of its having been created by using the 'dog' function as a
constructor. I could just as easily write:

var herdog = new Object();
herdog.name = 'Buddy';
herdog.age = 1;

Now this new variable 'herdog' can be used in exactly the same places
and contexts as the variables 'mydog' and 'yourdog'. If I then wanted
to pass 'herdog' to the airline reservation subsystem, I could write:

herdog.carrier = 'United';
herdog.flightNum = '1234';
herdog.departure = new Date();
reserveSeat(herdog, 'Prefer Window Seat');

That's what it means to not have types or classes. 'herdog' does not
necessarily have anything in common with any object that was created
with any particular constructor.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
A

Arvind

Chris said:
JavaScript has no types. We weren't talking about types, anyway. We
were talking about classes, which JavaScript (some versions) also
doesn't have, nor does it have anything like them. You are attributing
too much meaning to "new dog(...)".


JavaScript DOES have objects. That doesn't mean it has classes or
types.

There is do 'dog' type. The only thing called 'dog' here is a function,
which happens to have been used as a constructor to create an object.
The interpreter doesn't possess any knowledge about that object just by
virtue of its having been created by using the 'dog' function as a
constructor.

True, never looked at it from that perspective. Agreed
I could just as easily write:

var herdog = new Object();
herdog.name = 'Buddy';
herdog.age = 1;

Now this new variable 'herdog' can be used in exactly the same places
and contexts as the variables 'mydog' and 'yourdog'. If I then wanted
to pass 'herdog' to the airline reservation subsystem, I could write:

Yes, this substantiates, that you pass around Objects, but not defined
'type'd objects as parameters
herdog.carrier = 'United';
herdog.flightNum = '1234';
herdog.departure = new Date();
reserveSeat(herdog, 'Prefer Window Seat');

That's what it means to not have types or classes. 'herdog' does not
necessarily have anything in common with any object that was created
with any particular constructor.

Makes sense !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top