Live data from Hacker News

The history of C# and TypeScript with Anders Hejlsberg [video]

youtube.com

161–162 of 162 posts

Re: The history of C# and TypeScript with Anders Hejlsberg [video]

#161

I don't know that many languages but, having been writing lots of typescript in the last 3 years there are so many things I love about it. It infers types. If I do const data = [ { name: 'bob', age: 35, state: 'CA' }, { name: 'jill', age: 37, state: 'MA' }, { name: 'sam', age: 23, state: 'NY' }, ]; Typescript knows data is an array of { name: string, age: number, state: string }. I don't have to tell it. Further, if…

Not surprisingly, C# worlds the same way with the only exception that you have to declare the variables as “var” but they are still strongly typed

It's also not quite as easy to declare and build an array. You can't just write

  var arr = [ 1, 2, 3];
You have to write something like

  var arr = new int[] { 1, 2, 3 };
However if you have previously declared `arr` to be of type `int[]` (or another collection type such as `List`), then you can write

  arr = [ 1, 2, 3 ];
I haven't used TypeScript so don't know if it distinguishes between arrays and lists, and if so how it determines one or the other in inferred types. Would be curious to know.

Re: The history of C# and TypeScript with Anders Hejlsberg [video]

#162
post #114
post #94

Earlier quoted context omitted.

Same experience here. C# might have superior tooling, performance, whatever but the OOP baggage is too heavy. In theory you can write something else than a giant over-complicated, over-abstracted pile of OOP nonsense in C#, but every team I've seen has .

Just to keep it relevant and off topic. Typescript is moving to go because you just cannot get performance out of javascript because of its design. As he says in the video about perf "you cannot leave 10x on the table".

> Typescript is moving to go because you just cannot get performance out of javascript because of its design.

That's not an accurate summary. An accurate summary is that:

- They can't get the performance they want out of V8

- They're are moving to Go because its design is similar enough to JS that they can do a line-by-line port

These aren't similar claims (or mere quibbling) compared to what you wrote. They're very nearly exact opposites.

Post reply on HN