Javascript is a fad, we should all move to WASM. 🙃
But no, TypeScript is not a fad. Unless a better "Typescript like" thing comes out - I know how in frontend land people like to make their own substitute framework that does something slightly different than an existing framework - But I don't really see why anyone would want to make a NewTypeScript, and not just expand existing TypeScript
I'm not 100% familiar with Kotlin, but I think extension methods in Kotlin are the same as C#, basically syntactic sugar.
So you'd write an extension method like:
this
being the keyword making it an extension method - and you can call that function on an object by doingobject.DoSomething()
- Yes. But underneath it's the same as doingObjectExtension.DoSomething(object)
(A static invocation to yourObjectExtension
class andDoSomething
method.So on the surface it looks like you're injecting a new method into your DTO, and your DTO is not a pure data object anymore, but actually you're just creating an helper function that's statically invoked - that looks like you can call it "on the object" but actually you're not.
As for whether it's a good / common practice to create mappers like that in Kotlin, I don't really know. I do it often in C# though.