weak vs strong programming type,strong typing weakened type coercion,type coercion strong typing,strong and weak type xml,weak and strong type,weak typed language,weak and strong typed programming,difference strong weak typed language, xml%%%weak vs strong programming type - Re: Strong versus (weak

[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Strong versus (weak|runtime) typing


weak vs strong programming type
[Richard Tobin]
 >Java has typed variables, Python doesn't.

But in Python, everything is an object and has a type as a consequence of that.
In the expression:
         x = 1 + 2
there are three objects, each of which has a type.

[...]
 >As I think Guido pointed out, static typing only catches a fraction of
 >even the simple non-algorithmic errors you can have.  It doesn't help
 >that you type-checked an integer assignment if the LHS is in inches
 >and the RHS is in centimetres.  It doesn't stop you getting arguments
 >in the wrong order unless they happen to be of different types.
 >And the incredible verbosity of common constructs like iteration in
 >Java is largely due to static typing, and is a source of errors just
 >by ensuring that your method doesn't fit on the screen.

Absolutely!

The same is true (oh so true!) in XML where developers lull themselves
into thinking that because they have nailed down every last date, every
last floating point number that they have "caught" at XML construction
time, all the data structure errors. All the interesting errors are as David
Megginson noted, further up.

An important difference between the XML case and the programming
language case I think is that XML is much more likely to be the
subject of a contextual interpretation.

With Python *text* I can treat it as UnicodeWithTokens or as a data structure
or as instructions to a virtual machine. That's about it.

With XML, basically every single encounter with a process is a new context, 
subject
to local interpretation of the XML. In this situation, any static typing added
to the XML in a way that forces you into a particular context is 
counter-productive.
You end up fighting against it in your code. It works against you, not with 
you.

Thats basically how I have always felt about static typing - it works 
against me, not
with me and its benefits are dreadfully over estimated out there. Both in 
programming
languages and in XML.

Of course, those out there who see XML as just a convenient serialisation 
syntax
for objects won't see the point of all this. In that closed world, all the 
type coercion
issues occur further up the chain - in their programming language of choice.

regards,
Sean


http://seanmcgrath.blogspot.com



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.