News for hackers. Stuff that matters.
Re:Show HN: Pts.js – A library for visualization and creativ... by seanmcdirmid on Wednesday August 08, 2018 @12:56PM (#17717454)
If a library was written in typescript, theb the users of the library wouldn’t be forced to use Typescript also, right? Does it really matter if the library is written in typescript or not?
Re:Show HN: Pts.js – A library for visualization and creativ... by Zalastax on Wednesday August 08, 2018 @01:08PM (#17717541)
It only matters in a positive sense. Being written in TypeScript signals that it uses modern features that makes the code easier to read, that it doesn't use too many strange dynamic features, and of course that there are type definitions available for other TypeScript users. Other users can use it like they would use any JavaScript library.
Re:Show HN: Pts.js – A library for visualization and creativ... by vanderZwan on Wednesday August 08, 2018 @02:28PM (#17718189)
No, because TypeScript can be compiled to JavaScript, so you can use the resulting library in plain JS. If you want to check the source of the library, then yes, you need to know TS.
Re:Show HN: Pts.js – A library for visualization and creativ... by eropple on Wednesday August 08, 2018 @06:55PM (#17720336)
"Knowing TypeScript" is...functionally trivial, though. If one can read JavaScript and can't get enough from context to read TypeScript, I question their knowledge of JavaScript!

Perhaps writing it is a bigger ask--a twenty minute session of reading and poking at the language in VSCode did it for me, but maybe I'm secretly some kind of TypeScript savant--but this just plain should not be a problem for anybody who's up on modern JS.

Re:Show HN: Pts.js – A library for visualization and creativ... by pixelbash on Wednesday August 08, 2018 @02:15PM (#17718093)
Well it does mean in order to understand the library and/or contribute you have to use <flavour of the month>. Also it makes the library prone to rewrites if something else comes up. I don’t mind TS (though es6 suits me fine) but I have seen many js paradigms come and go. Who knows maybe TS will stick around for the long haul.
Re:Show HN: Pts.js – A library for visualization and creativ... by nightski on Wednesday August 08, 2018 @06:24PM (#17720081)
Considering TS has been around since 2012 and has the full backing and support of MS since then I'd say calling it the flavor of the month is not necessary. Might they drop it some day? Maybe, but seeing as they have several large profile products using it that is unlikely any time soon.
Re:Show HN: Pts.js – A library for visualization and creativ... by znite on Wednesday August 08, 2018 @05:50PM (#17719809)
Considering Typescript is a superset of javascript & the future of javascript - ie. they always plan to be implementing future javascript 'now', that is their whole reason for existence, and that their team sits on the javascript committee, then yes, I think it is around for the long haul. https://www.techtalko.com/2018/03/17/typescript-the-future-o...
Re:Show HN: Pts.js – A library for visualization and creativ... by speedplane on Thursday August 09, 2018 @02:46AM (#17722090)
This is a tired argument. SCSS was supposed to take over CSS... still waiting. For a hot minute, CoffeeScript was supposed to take over javascript. In the end, CoffeeScript didn't have a chance, but at the time many thought it did.

Typescript may be different and may be better, but there is a lot of rightly justified hesitation to adopting it.

Re:Show HN: Pts.js – A library for visualization and creativ... by omnimus on Thursday August 09, 2018 @04:51AM (#17722593)
Well SCSS took over CSS.
Re:Show HN: Pts.js – A library for visualization and creativ... by swsieber on Thursday August 09, 2018 @11:31AM (#17725038)
By what definition? Can I execute SCSS in modern browsers without needing to compile it?
Re:Show HN: Pts.js – A library for visualization and creativ... by omnimus on Monday August 13, 2018 @06:33PM (#17754093)
As far as i know this was really never aim of the project. But everybody uses it. I would even say it oppened doors for JS compilation.. because everybody already has build process for css so why not js.
Re:Show HN: Pts.js – A library for visualization and creativ... by realusername on Wednesday August 08, 2018 @10:04PM (#17721211)
If TS does not stick around, it's very trivial to remove the types and put it back in plain JS, that's why even in the worst case scenario TS will not be a technical debt.
Re:Show HN: Pts.js – A library for visualization and creativ... by grepme on Wednesday August 08, 2018 @04:55PM (#17719390)
It does matter for the authors, with TS they would have probably needed another year or two to complete it.
Re:Show HN: Pts.js – A library for visualization and creativ... by FlorianRappl on Wednesday August 08, 2018 @06:37PM (#17720193)
They wrote it in TS. Don't know why you think it would take longer with TS. Personally, I prefer using TS as I'm faster with TS when the code is going beyond 1 file or O(10^2) LOC.
Re:Show HN: Pts.js – A library for visualization and creativ... by eropple on Wednesday August 08, 2018 @06:59PM (#17720361)
Agreed, and TypeScript's ease of writing code correctly and quickly is what finally got me away from Ruby and to Node almost all of the time. ES6 was legitimately nice and could have been good enough for about the 50%-75% case, but the ease of building expressive TypeScript typings that let the compiler tell me what I was screwing up without having to write insipid typechecking tests or repeatedly running scratch code sold me. And when I have to do something that TypeScript can't prove, it's very easy to just bail out, do my filthy misdeeds, and patch back into the type system after.

For awhile, React/Redux was really kind of gross with TypeScript, but even that's mostly hammered out. (React's new context API did a lot to reduce my use of Redux in general, and works pretty comfortably with TypeScript too.)