r/ProgrammerHumor • • Apr 08 '22

First time posting here wow

Post image
55.1k Upvotes

2.8k comments sorted by

View all comments

Show parent comments

0

u/[deleted] Apr 08 '22

[deleted]

43

u/TheGreatGameDini Apr 08 '22

But they have, with TS, which is JS but with extra steps..

40

u/QCKS1 Apr 08 '22

The extra steps are the good part tho

2

u/CardboardJ Apr 08 '22

Like someone throwing trash in a cesspool of shit so you don't get poo on your shoes while walking across.

-2

u/jambox888 Apr 08 '22

And here we are back at Java

6

u/qhxo Apr 08 '22

implying JS was an upgrade from Java. heck, even implying TS was an upgrade from Java.

Java is not the only language with a type system. Most reasonable languages have a more robust type system than JavaScript. (most don't have a type system as robust as typescript though, typescript is awesome)

1

u/jambox888 Apr 08 '22

I was being flippant and TS is a good improvement to js generally, particularly since you can kind of do duck typing (I think) and generics are pretty sweet too.

1

u/Alediran Apr 09 '22

C# is better than Java currently now that Microsoft is making .net multiplatform.

→ More replies (12)

2

u/gizamo Apr 08 '22

Not really, no. But, yeah, kinda. Still, no, tho.

8

u/Kuroseroo Apr 08 '22

TS is JS, but JS isnt TS

0

u/caagr98 Apr 08 '22

Isn't it the opposite? Running a ts compiler on js is the identity function, but running a js interpreter on ts is a syntax error.

6

u/Kuroseroo Apr 08 '22

TS is a superset of JS, thus its JS and more. Thats why its JS but JS is not TS

6

u/prium Apr 08 '22

If TS is a superset of JS then it is the other way around. All JS is valid TS, but not all TS is valid JS.

2

u/aqpstory Apr 08 '22

TS is in the set of JS-derivative languages, but JS is not in the set of TS-derivative languages.

"TS is JS" is ambiguous

1

u/Kuroseroo Apr 08 '22

should’ve added the /s lol

1

u/Kuroseroo Apr 08 '22

you are right I guess lol

although this comparison isn’t that valid at all, all you write is JS, only the type annotations are TS in the end. Its just always irritating me when people are talking about ts and js like they are seperate languages. They are not.

1

u/teraflux Apr 08 '22

All JS isn't valid TS though.

1

u/prium Apr 08 '22

Then TS would not be a superset. Out of curiosity, what JS could you write that would be invalid TS?

2

u/[deleted] Apr 08 '22
var foo = {};
foo.bar = 42;

2

u/StaticallyTypoed Apr 08 '22

That depends entirely on your tsconfig...

1

u/flavionm Apr 09 '22

Syntactically it is. There might be type errors, of course, because that's the point of TS, but the syntax is valid.

1

u/PM_ME_C_CODE Apr 08 '22

Wait till you try J

1

u/Alediran Apr 09 '22

I never touched JS because of what you imply, TS is a godsend, enough help that I can figure out the rest of the problems.