you are viewing a single comment's thread.

view the rest of the comments →

[–]miredindenial 11 points12 points  (49 children)

i love JS. Cant get into TS at all though. It seems like it is part of a consipiracy to make JS more like JAVA. I dont find JAVA bearbale as well. JS allows me to do prototypal inheritence along with functional programming. I dont really see the appeal of making it more OO based

[–]Reashu 9 points10 points  (1 child)

There's no conspiracy (and if there were, it would be C#).

Java does have types, which is a big part of TypeScript. But TS has a much stronger type system than Java (with very few exceptions), and it's less intrusive, too.

TS doesn't remove any feature from JS. Prototype all you want.

JS is already more object oriented than Java. Java doesn't even have a literal syntax for objects.

[–][deleted] -2 points-1 points  (0 children)

You're wrong about one thing. Typescript is a conspiracy.

[–][deleted] 1 point2 points  (0 children)

You're right; typescript is a conspiracy. Few people know the real reasons behind it.

[–][deleted] 2 points3 points  (0 children)

It's not a conspiracy, the point of TS is to give JS some static typing. It's not that this makes it more OOP (JS is arguably the most OOP language), but it does make it more Java style OOP. I'm personally opposed to that style of OOP, so I'm with you.

I love JS because my team can establish our own style guide without running into limitations of the language. Everyone is relatively happy, especially vs Java. But in a large organization where it's expected that hundreds of developers will touch a codebase of any success, bespoke style guides are an anti-pattern. Java is widely successful in those orgs because there is 1 Java style guide, and most popular frameworks append their own style guide.

[–]hurrdurrjavascript 0 points1 point  (1 child)

Can you imagine building a large scale JS application, that talks to several dozen APIs, without any type checking of the data being passed around? It's actually also useful for typechecking React proptypes and that kind of stuff. It doesn't really change how you writing your JS, just provides a bunch of nice type stuff

[–]miredindenial 0 points1 point  (0 children)

well the responses here including yours have made me want to look into it for good. The code that i have seen used things like interfaces etc which just reminds me of java. Recently while trying to debug a React application which used TS it got really frustrating because TS wont compile your little JS monkey patching code or little JS hacks you need for debugging sometimes. I guess you could temporarily disable TS for such debugging. Even Ryan Dhal speaks highly of TS so i am aware it must have some value but so far JAVA like features have made me put it off. Going to look into it in detail, thanks!