DEV Community

Discussion on: The downfall of web development

Collapse
 
d_inventor profile image
Dennis

I would say there is a benefit to typescript. I'm more familiar with .NET though, so I may be somewhat biased.

I inherited a plugin from a coworker who had left way before I even joined the company. It was built on Umbraco 6, it didn't use any sort of tooling. When Umbraco started to use angular-js for the backoffice, it was translated to angular-js, but still didn't use any javascript tools. The mess that I was greeted with made me want to throw the whole thing away. I can't remember how many times I said "Where does this property suddenly come from!?" or "Where is this piece of code even used?!", but it was a lot.

I work in an environment with many junior developers and what happens is that if something is optional, it simply doesn't get done (writing comments, update documentation, write tests, remove unused code, etc.). This one project is built by a single developer and everybody else who looks at any pull request is like: "I have no idea what this is, I'm sure it's all good". For a junior developer, to make quality code, we need to set rules and typescript does that for us. Typescript helps us convey the intent of a certain piece of code, which makes it more easy to manage expectations for different flows. If you just work with any object, it's for example easier to think: "hey, this object makes its way from here to that other place where I need this data, let's add this property to this object", without considering what the object is supposed to represent. You can still do this in typescript, but by giving objects different names with well-defined properties, you make developers think twice. "Does this list of car doors really belong on the carrot object?"

Especially for projects that get touched once or twice per year and move from developer to developer, it's important to make your code speak and that's something that Typescript does for us.

If typescript doesn't work for you and your team, that's ok, this is just my experience.

That being said: I also see plenty of atrocious .NET code that definitely doesn't speak either.

tl;dr: I think typescript is useful, because it helps to manage expectations in code and it makes the code speak.