3 ms·
Languages bring along a culture. Sone teams buck the culture of the broader language ecosystem, most do not. IMO, the C# culture is closer to enterprise Java th
by sangnoir 2y ago
Languages bring along a culture. Sone teams buck the culture of the broader language ecosystem, most do not. IMO, the C# culture is closer to enterprise Java than it is to Typescript, for good or for ill.
- CharlieDigital 2y ago> C# culture is closer to enterprise Java than it is to Typescript I mean, this really depends on what you're looking at. Here's a sample from the MongoDB client: https://github.com/mongodb/node-mongodb-native/blob/main/src/operations/command.ts https://github.com/mongodb/node-mongodb-native/blob/main/src... Here's a sample from Storybook: https://github.com/storybookjs/storybook/blob/next/code/core/src/channels/websocket/index.ts https://github.com/storybookjs/storybook/blob/next/code/core... Here's a sample from Prisma: https://github.com/prisma/prisma/blob/main/packages/client/src/runtime/RequestHandler.ts https://github.com/prisma/prisma/blob/main/packages/client/s... Here's a sample from Cal.com: https://github.com/calcom/cal.com/blob/main/packages/core/EventManager.ts#L104 https://github.com/calcom/cal.com/blob/main/packages/core/Ev... These are all fairly mainstream repos so it's not a one off to see "enterprise" style coding in TypeScript. It's rather the specific use case that determines the style of the code that's written. In the examples above, there's no need for the teams to choose JavaScript classes and inheritance to model the logic, yet it likely better fits the programming model of those modules. Look at Nest.js as well: https://github.com/nestjs/nest/blob/master/packages/core/router/routes-resolver.ts https://github.com/nestjs/nest/blob/master/packages/core/rou... The whole codebase of Nest.js looks an awful lot like Spring or ASP.NET (controller syntax) probably because there's a lot of crossover in terms of what APIs need at scale and how to logically organize that logic. It just so happens that most use cases for C# and Java favor applications at a larger scale. Another key difference being object scope and lifecycles -- something that rarely comes into play in the generally single-threaded Node runtime. This being one of the key reasons why dependency injection is a thing in C# and Java land.
- mhh__ 2y agoMore than culture, language is a statement of values. There's reflexivity and path dependency but the culture is downstream of the values for the most part.