[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: typescript [was: Re: How to write (existential) p
On Wed, 2019-02-13 at 15:13 +0000, Dimitre Novatchev dnovatchev@xxxxxxxxx wrote: > On Wed, Feb 13, 2019 at 3:08 AM Liam R. E. Quin liam@xxxxxxxxxxxxxxxx > <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> 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 { ...} > to > 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 -- 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/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|