| ▲ | rixtox 5 hours ago | ||||||||||||||||||||||
If you feel that TypeScript, or hell even JavaScript, is becoming more alike C#, it's actually deliberately done by Microsoft in benefiting their ecosystem. In this interview they mentioned they had internal demands to convert/transpile C# into JavaScript or TypeScript. So by making these target languages more like C#, it directly benefits their need. But I don't think this should be the driving force in designing ECMAScript. When they are pushing a language feature, they have an unspoken internal goal, and every choice they make is to make JS/TS look more like C#, and they are more likely to dismiss proposals that preventing them from deliverying that goal. There's likely a bit of conflict of interest there. | |||||||||||||||||||||||
| ▲ | pmkary 2 hours ago | parent | next [-] | ||||||||||||||||||||||
Not at all. Before the use of TypeScript exploded, they had two features brought into it from C# which were namespaces and enums (both of which are amazingly good features. For the first one, no one knew what was the right choice back then. We had almost a dozen different module systems and TypeScript had gone their way to support all of them and namespaces were their own solution to the mess (remember they were trying to solve their own problems at first, it wasn't to dominate anything). I personally used namespaces and I could have only the TypeScript compiler running and producing a single JS file for rapid development without the burden of --- then very slow --- webpack. And for enums, using strings as enums was not a very efficient idea. I think JavaScript introduced Symbols for locked/hidden properties but also meant to use them as enums. It never worked either and then the sum type, union type feature of TypeScript made the whole community to keep using strings as enums. This is still a very bad idea, it is not ergonomic, it is prone to many problems, and very inefficient to compare strings instead of integers. But hey TypeScript tried to fix the problem and almost everyone rejected it. And so enum is now discontinued. Rest of the changes to TypeScript came from almost any other language but C#, probably the biggest changes ever to happen to JavaScript came directly from CoffeeScript. And then I personally saw how each of these new changes --- one by one --- arrived at C#. For what I have seen firsthand by reading the TC39 proposals, each feature came from a different community and different programming languages, (think about null operators !/?, the nullish coalescing ??, the incoming pipes, fat arrows and lambdas, mixings) as JavaScript is the only language everyone has to use, and it has benefited everyone to have a language that has all the great things from all other languages. | |||||||||||||||||||||||
| ▲ | oaiey 3 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
As a long term observer: definitely not a goal. But you have to be clear here: JavaScript and C# both are OO languages, both are having origins stories in Java/C++, both are facing the same niche (system development), same challenges (processor counts, ...) and so on. And then, you put teams on it which look left and right when they face a problem and then you wonder that they reuse what they like? C# language team is also really good. They did not do a lot of mistakes in the 25+ years. They are a very valid source of OO and OO-hybrid concepts. It is not only TS/JS but also Java and C++ who often look to C#. The story was not to transform C# code to JS but to use C# to write the code in the first place and transpile it. Not for the sake of having .NET usage but for the sake of having a good IDE. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | steve1977 4 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
Well, for one, benefiting Microsoft's ecosystem does not imply being detrimental to other ecosystems per se. Furthermore, couldn't the convergence of TypeScript towards C# be simply a result of shared goals and values of the two languages, especially considering they have the same principal designer? | |||||||||||||||||||||||
| ▲ | epolanski 3 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
C# is inherently OOP oriented and it's type system works completely differently. | |||||||||||||||||||||||
| ▲ | tester756 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
It sounds like conspiracy theory that they design TS/JS to convert from C# easier, huh. The truth is that C# is probably the best designed mainstream language out there. C# was known as a language with lowest amount of WTF per LoC | |||||||||||||||||||||||
| ▲ | froh 4 hours ago | parent | prev [-] | ||||||||||||||||||||||
that's the "evil MS" perspective The sequence of turbo pascal / delphi / c# / typescript which brought us LSP as a sidekick (!) IMHO has benefitted the whole industry at least as much as "transpile c# to ecma script via typescript" . no. much much much more. I do not see a problem with MS also having an internal use case . you know I wouldn't stop using python "because" Guido now works at MS ... | |||||||||||||||||||||||
| |||||||||||||||||||||||