Hacker News new | ask | show | jobs
by jypepin 2674 days ago
> I once cranked out a design based on abstract classes in TypeScript, and got ridiculed because apparently nobody does it this way in TypeScript. I certainly pretended that my colleagues were hopeless idiots. It used to help before, but that time it left me with a bad aftertaste.

seems like both he and his coworkers would need some help in humility.

3 comments

Are you suggesting that abstract classes are a good idea in TypeScript? Because to me, abstract classes suggest that you're doing a lot of inheritance, which is the opposite of a good idea in JS.
I'm not judging if the author did something right or wrong, but that he got "ridiculed" for doing something his coworkers judged wrong, and that he insults them back.
Why? Old-school pre-ES6 explicit prototype wrangling was confusing, but what's wrong with using inheritance if you're writing in TypeScript (or, for that matter, a JavaScript version with classes)?
Too much abstraction can be bad as well, many times I’ve written a nice class diagram to discover no one really needed to reuse certain functionality, a function would have sufficed :P
This article captures a few good reasons as to why composition is much preferred over inheritance:

https://medium.com/javascript-scene/a-simple-challenge-to-cl...

No, but "got ridiculed because apparently nobody does it this way" reflects poorly on the coworkers (or on the author's perception of the world), while "I certainly pretended that my colleagues were hopeless idiots" is also rather immature.

tl;dr: it sounds like a toxic work environment where everybody loses.

Author may have left out the part where his co-workers said, "no one does it this way [because it's usually a bad approach using this technology, and your particular use-case isn't some special case where over-engineered and brittle inheritance is actually a good idea.]"
I'm sure he got feedback. It may have been harsh. There may have been laughter. And yet, it's the author's choice to characterize it as ridicule, and the choice is not a helpful one to his own career. His attitude is a millstone, not his "broad experience".
In the industry there is generally no mercy for a programmer who fails due to his own hubris.
There is generally no mercy period.

It is good that the guy in the article experienced a bout of self-reflection. I hope he has learned some lessons and can move on and become more empathetic to others regardless of experience level.

FWIW, I think having a beginner mindset is a kind of "super-power" as long as one is also able to be humble, patient and cooperative at a level that many people can't achieve.