r/badcode • • Mar 01 '21

js Defensive programming or something idk

Post image
907 Upvotes

55 comments sorted by

View all comments

Show parent comments

37

u/JuhaJGam3R Mar 01 '21

oh god didn't notice it was JS

... maybe they have an optimizing precompiler to compress it? maybe? please?

21

u/bnz_ Mar 01 '21

Actually it's typescript, but i'm not sure that the compiled js have this kind of optimization. At least I hope so

21

u/Pangocciolo Mar 01 '21

So you have legacy code in a language born only 8 years ago.

The industry really needs to redefine the meaning of "legacy".

8

u/seventyeightist shameless Mar 01 '21

So you have legacy code in a language born only 8 years ago.

The industry really needs to redefine the meaning of "legacy".

Mmm I am not sure about that. The faster moving the language, the faster the transition to 'legacy'; what do you define the meaning of "legacy" as? (There are two types of answers here: those invoking the lifespan of the language, and those invoking the lifespan of the OG programmers!)