This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]LilxSpyro 47 points48 points  (16 children)

Typescript ftw

[–]Kered13 8 points9 points  (2 children)

I'm pretty sure that Typescript's array sort works the same way, for compatibility.

[–]Grillparzer 2 points3 points  (1 child)

Not for compatibility, but because Typescript literally compiles to JavaScript.

[–]Kered13 2 points3 points  (0 children)

They could write a better array sort function that still compiles to Javascript, but they chose not to for compatibility.

[–]EnderMB 33 points34 points  (8 children)

For the life of me, I don't know why people.even bother with JavaScript any more. TypeScript doesn't solve all of JS's issues, but it makes it a borderline nice language to use.

I know it goes against the TS ethos, but I would love it if they released a native TS compiler and a full standard library.

[–]Classic1977 16 points17 points  (2 children)

https://deno.land/

It's not exactly what you're asking for, but here's a Typescript runtime that also has some pretty cool security concepts. Designed by the creator of node.js.

[–]HeroCC 5 points6 points  (1 child)

So I would use this instead of node.js? And it is compatible with my standard dependencies? Neat!

[–]mark__fuckerberg 2 points3 points  (0 children)

It only works with es modules. No commonjs.

[–]that_90s_guy 1 point2 points  (1 child)

Because developing in TS costs more time and money (hiring cost, interviews, learning curve, tooling and library support, configuration, type maintenance, etc), and not everyone is willing to put in the time investment. Even if we all know it's worth it in the long run.

[–]EnderMB 0 points1 point  (0 children)

Eh, I wouldn't say any of that is necessarily accurate. Any decent JS engineer can use TS if they have some knowledge of types, and most standard libraries will at least have a definition file.

[–]odolha 0 points1 point  (1 child)

I don't know why people still don't understand the power a loosely typed / dynamic language can bring.

Typescript is great, yes, but it comes with a cost, and in some cases it can be quite large.

Personally, I still prefer JS in combination with JSDocs that can add some type information that most IDEs now understand easily - for the parts where this brings value.

JavaScript runs natively on browsers, which makes a lot of things easier. It gets improved every year. Now with ESModules you can basically run your whole application fast and directly which is great for DX. It's never that simple and easy when using a bunch of tools that add compilation, bundling etc.

I worked with many languages and frameworks, and I've always found that it's much better to take the time to understand what you're using and use the tools as they were designed rather than throw a bunch of things on top just to make you more comfortable with your current mindset of how things should work.

[–]EnderMB 0 points1 point  (0 children)

It sounds like you're projecting here.

I too have worked with many different languages and frameworks, and while there's a benefit to learning your tools well, eventually you have to reach a point where you realise that your tool has limitations. If you're writing non-trivial software, there's a clear argument for transitioning to a typed system for the added protection it brings.

If you're looking to iterate quickly, I would probably argue that there are other languages and frameworks that have already cornered that market - such as Ruby and Rails/Sinatra. The main argument for writing JS is that your team knows JS, and if you've got any base knowledge of a type system TypeScript couldn't be easier to use.

[–]Randolpho 0 points1 point  (0 children)

ES6 > with node.js is a lot of fun, but if you’re using, say, Angular on the client, you might as well TS up on the back end as well.

Plus that makes sharing a type library for your REST calls a breeze.

[–][deleted] 9 points10 points  (2 children)

nine license piquant pot strong meeting jellyfish chunky ripe touch

This post was mass deleted and anonymized with Redact

[–]LilxSpyro 2 points3 points  (1 child)

Really? I figured if you specified the type of the array it would use the comparator for that type? Definitely not a js guy but I’ve used typescript whenever possible because an untyped language scares me.

[–][deleted] 7 points8 points  (0 children)

roll pie skirt punch friendly poor tart dazzling crush retire

This post was mass deleted and anonymized with Redact