[Top] [All Lists]

Re: typescript [was: Re: [xsl] How to write (existential) predicates with maps/Why is there no effective boolean value for a map?]

2019-02-13 16:11:43
On Wed, 2019-02-13 at 15:13 +0000, Dimitre Novatchev
dnovatchev(_at_)gmail(_dot_)com wrote:
On Wed, Feb 13, 2019 at 3:08 AM Liam R. E. Quin 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

Typescript uses structural typing, not named typing.

Actually this statement is not entirely correct -- a Typescript
programmer can use both. To achieve strict typing, which people like
me would prefer, just change:
   class Student { ...}
  class Student implements Person { ...}

Kinda - i think this doesn't do what people might expect if they come
from a strict static typing world, and of course you can leave it off
and not notice... but you're right, it's a way to make that link more
explicit. However, "implements" has other effects, e.g. on subclassing
a subclass, so it's not only enabling strict(er) typing.

I believe that offering differing typing choices (starting from no
typing at all -- all Javascript code is valid in Typescript as
Typescript is a superset of Javascript) is an intentionally-designed
flexibility in the language.

Yes - to get any traction at all they needed to support existing
libraries, for one thing.

 Of course, many developers such as myself
would use just strict typing style, so that when the transpiler
reports typing errors one will correct them even before compile-time.

I'd prefer that too.


Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Web slave for vintage clipart http://www.fromoldbooks.org/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com

<Prev in Thread] Current Thread [Next in Thread>