News for hackers. Stuff that matters.
Re:Yarn's Future – v2 and beyond by bouncing on Thursday January 24, 2019 @12:05PM (#18990501)
Do people typically prefer TypeScript over ES6?
Re:Yarn's Future – v2 and beyond by ggregoire on Thursday January 24, 2019 @12:34PM (#18990822)
It's a strange question. Writing in TypeScript is almost identical to writing in ES6. TypeScript is "just" ES6 with interfaces and static types.

Do people prefer typed JavaScript over JavaScript tho? I know that I prefer typed JavaScript, especially to write long-term web applications or Node.js server applications, but I don't think there is yet an unanimous shift towards typed JavaScript.

Re:Yarn's Future – v2 and beyond by bouncing on Thursday January 24, 2019 @01:28PM (#18991418)
> Do people prefer typed JavaScript over JavaScript tho?

I'd like dynamic typing but without the implicit and dubious type coercion. Like Python.

Re:Yarn's Future – v2 and beyond by chaostheory on Thursday January 24, 2019 @12:23PM (#18990689)
Coming from a background of being comfortable with Ruby, Python, and Java; I started with ES6 a few years ago and moved over to Typescript last year. While ES6 makes Javascript much nicer, Typescript makes it way better and easier to maintain especially with a decent IDE. I already had a lot of respect for Javascript developers previously, but when I started developing node apps with ES6 it grew even more. I can only imagine the discipline needed to maintain large Javascript apps before ES6 and Typescript
Re:Yarn's Future – v2 and beyond by WorldMaker on Thursday January 24, 2019 @12:23PM (#18990690)
There's not really a competition between ES6 and Typescript because they are generally on the same side. Typescript is mostly just ES6 (ES2015) + Types. (It also supports ES2016 + Types, ES2017 + Types, and ES2018 + Types, and generally as TC39 proposals make it to at least Stage 3 Typescript adds support for them.)
Re:Yarn's Future – v2 and beyond by cphoover on Thursday January 24, 2019 @04:06PM (#18992969)
I'm a fan of functional programming over OOP as such, I don't need all of the OOP constructs just give me some immutable primitives, first-class functions and let's get to work.

There's not much I can do with a class that can't be accomplished with a simple function.

I think I've evolved in my thinking over this in the last several years of experience.

Re:Yarn's Future – v2 and beyond by fold_left on Thursday January 24, 2019 @04:56PM (#18993432)
You can continue to code the way you've been enjoying, just with the option to type your inputs and outputs if you choose to. Writing classical OOP isn't imposed on you by TypeScript, nor do you miss out on anything by not writing classical OOP.
Re:Yarn's Future – v2 and beyond by Siilwyn on Thursday January 24, 2019 @05:04PM (#18993499)
Typescript doesn't support typings for functional concepts that libraries like Ramda & Sanctuary use though.
Re:Yarn's Future – v2 and beyond by fold_left on Thursday January 24, 2019 @05:37PM (#18993759)
That's also true. TS has more to do to improve working with functional JS.
Re:Yarn's Future – v2 and beyond by BMorearty on Thursday January 24, 2019 @12:12PM (#18990580)
From what I've seen, yes.

I'm a big fan of ES6 and I haven't been a fan of typed languages for a long time but I'm liking using TypeScript. So are my coworkers.

Re:Yarn's Future – v2 and beyond by dak1 on Thursday January 24, 2019 @12:26PM (#18990732)
Since we all tend to live in bubbles to some extent, do we have any numbers to back this up (like, # of repos/commits in each language on GitHub, or questions on StackOverflow)?

I tend to view TypeScript similar to CoffeeScript — it brings to JavaScript some features from other languages that are convenient and preferred by a subset of frontend developers. It allows for experimentation in the language, and helps inform TC39 proposals.

In time, I suspect support will coalesce around a specific TC39 process proposal to add type support, it will graduate to stage 3 or 4, get integrated into browsers and Babel, and enthusiasm around TypeScript will wane.

Re:Yarn's Future – v2 and beyond by dangoor on Thursday January 24, 2019 @12:32PM (#18990793)
A flexible type system like that of TypeScript is pretty big and complex. It would take considerable time and effort to get that through TC39, I think. It could happen, but seems far off to me.

For data, 46% of npm's survey respondents used TypeScript: https://blog.npmjs.org/post/180868064080/this-year-in-javasc...

Re:Yarn's Future – v2 and beyond by mhd on Thursday January 24, 2019 @01:26PM (#18991400)
I'd prefer Eiffel or Oberon, but almost anything is better than ES6. I just wish there was some kind of standard library movement to coincide with it, but even MS seems okay with left-pad.
Re:Yarn's Future – v2 and beyond by chaostheory on Thursday January 24, 2019 @03:04PM (#18992386)
> I just wish there was some kind of standard library movement to coincide with it,

I keep hearing this complaint, and at the same time I'm wondering why it's a big problem. So you can't find 3rd party libraries that are good enough to fill in the void from the lack of a good standard library?

Re:Yarn's Future – v2 and beyond by mhd on Friday January 25, 2019 @12:55AM (#18995881)
Yes, pretty much. I don’t want to bikeshed elementary parts of the developer experience, never mind vetting all the teeny components or find replacements if dependency hell strikes, quality regresses or maintainers disappear.

Given all the constraints, it’s highly unlikely that you find something consistent.

Re:Yarn's Future – v2 and beyond by chaostheory on Friday January 25, 2019 @01:57PM (#19001144)
So you write your own standard library substitutes? Math, functional, etc...?
Re:Yarn's Future – v2 and beyond by iamjaredwalters on Thursday January 24, 2019 @01:34PM (#18991473)
ES5 is not better than ES6. So I prefer ES6 in that case.
Re:Yarn's Future – v2 and beyond by RobertKerans on Thursday January 24, 2019 @04:28PM (#18993168)
> even MS seems okay with left-pad

That's a strange choice of example to highlight the sparseness of the standard library.

Re:Yarn's Future – v2 and beyond by mhd on Friday January 25, 2019 @02:51AM (#18996278)
I thought it's a good illustration of how fractured and fragile the JS "library" situation is. It's a bit like the previous PHP standard library, combined with the worst of Perl's Tim Toady.
Re:Yarn's Future – v2 and beyond by RobertKerans on Friday January 25, 2019 @10:57AM (#18999037)
The reason I say it's a strange example is because of this: https://github.com/tc39/proposal-string-pad-start-end, which was added to the language two years ago (and seemingly very quickly [as tc39 proposals go], I assume due to left-pad)
Re:Yarn's Future – v2 and beyond by diminish on Thursday January 24, 2019 @02:10PM (#18991879)
Noone around me does. Typescript and JSX are the two ugliest tech to become fashionable recently. I suspect C#, or .NET developers find it familiar, and they've just joined the front end wagon.
Re:Yarn's Future – v2 and beyond by ng12 on Thursday January 24, 2019 @02:15PM (#18991927)
I've had the opposite experience. I don't know anyone not writing Typescript.
Re:Yarn's Future – v2 and beyond by irrational on Thursday January 24, 2019 @03:15PM (#18992477)
I don't know anyone using it either (and I work for IT in a Fortune 100 company). But there must be since I keep seeing people mention it.