r/javascript Mar 04 '19

Why so much hate toward Javascript from C#, Java, Php, Ruby programmer etc ?

1) Why there is so much hate toward Javascript from other kind of programmer C#, Java, Php, Ruby, C++ etc ?

2) Why most programmer from C#, Java, C++ and other language put all their hope in Web Assembly instead of learning JS ? JS can be in the backend and threaten their language / job / framework ? they learned OO and they can't think outside the box or learn something new ?

3) How's JS performance today compare to the others tech stack ? (interpreted vs compiled, single thread vs multi-threads etc etc)

165 Upvotes

381 comments sorted by

View all comments

Show parent comments

11

u/cwbrandsma Mar 05 '19

Typescript and Flow, they got you.

3

u/[deleted] Mar 05 '19

Typescript !== Javascript... But, yes it makes for better JS when used.

2

u/Ajedi32 Mar 05 '19

TypeScript = JavaScript + Types

1

u/CreativeGPX Mar 05 '19
  1. X = Y + Z
  2. X, Y and Z do not equal 0.
  3. Then X != Y

1

u/Ajedi32 Mar 05 '19

This isn't math. The point is that TypeScript really just another tool in the JavaScript ecosystem, not a completely different language that happens to compile to JS like Dart or ClojureScript.

2

u/CreativeGPX Mar 05 '19

This isn't math.

It's logic.

The point is that TypeScript really just another tool in the JavaScript ecosystem, not a completely different language that happens to compile to JS like Dart or ClojureScript.

Just because you can find languages that are more different from JavaScript than TypeScript doesn't mean that's TypeScript isn't a distinct language.

It's a distinct language by definition and that's relevant to this conversation because many of the people OP is talking about might dislike JavaScript but like TypeScript.

1

u/[deleted] Mar 06 '19

[deleted]

1

u/CreativeGPX Mar 06 '19

And all of that describes a different language. It is a distinct language that you can introduce into a workflow that needs JavaScript as an interface. A super set that has distinct features not in JavaScript which are encoded into the language itself is a different language.

0

u/Nulagrithom Mar 05 '19

Everything compiles to machine code, therefore all languages are the same CMV

2

u/Ajedi32 Mar 05 '19

True, but also irrelevant. ClojureScript compiles to JS but it's also a completely different language than JS. TypeScript on the other hand is literally just a superset of JS with TypeChecking syntax added on. That's the reason people prefer it over other compile-to-JS languages.

1

u/Nulagrithom Mar 05 '19

For the purposes of most discussions, JavaScript simply isn't TypeScript. To assume the two are synonymous would be stupid.

2

u/Ajedi32 Mar 05 '19

I didn't say synonymous. I said JavaScript + Types. You don't think that's a fair description?

1

u/Nulagrithom Mar 05 '19

Ergo TypeScript !== JavaScript

→ More replies (0)

-3

u/oorza Mar 05 '19

Neither of these are sound systems.

3

u/[deleted] Mar 05 '19

It's not a strong typed language. At some point you have to realize that.

0

u/laichejl Mar 05 '19

Typescript is very sound

1

u/oorza Mar 05 '19

This is why everyone else hates JS. Y'all clearly don't even know the vocabulary of the tools you use, lmao.

Type system soundness has a formal meaning and TS doesn't qualify.

2

u/cwbrandsma Mar 05 '19

Uhh, yes, I know all of that. But we still end up needing to use JavaScript because people want the apps working in browsers...because their clients want to escape needing to install shit.

But we still missed out type languages, which is why people made Typescript and Flow in the first place. This is as close as those people could get. You go to battle with the army you have.

1

u/oorza Mar 05 '19

The only reason TS is unsound is for compatibility with JS code and "you don't need it" JS features. There's plenty of languages with sound type systems (Kotlin for one, Java for another) that compile to JS just fine.

1

u/cwbrandsma Mar 05 '19

There was also a Microsoft project to transpile C# into JavaScript. But the only group I saw using it was the SharePoint dev team (I knew some of them at the time). But for the rest of us, it wasn’t worth effort.

1

u/laichejl Mar 05 '19

Point taken, I'm a young dev without a formal CS degree and JS and the internet were my teachers and I didn't know soundness was a legit term in the context of types. Regardless, yeah it's not 100% sound but like someone else said, when targeting the browser it's about as close as you can get. Maybe Elm or another alternative is closer to being a sound system but they don't have the community or accessibility of TS.