MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/r5bhsl/_/
r/badcode • u/[deleted] • Nov 30 '21
6 comments sorted by
8
I could see myself doing this if Iβm not thinking. Itβs dumb but not the worst. Seems more like an oversight really.
5
Do typescript has getter and setter as C#?
17 u/TheUnlocked Nov 30 '21 Javascript does, and so Typescript by consequence does as well.But if this code is relying on getter/setter side effects... that's much worse than if those lines are just a no-op. 2 u/KanykaYet Nov 30 '21 I don't saying it is good, I just wanted to now if it isn't a completely useless lines, but yes it be better be done with some call of a function.
17
Javascript does, and so Typescript by consequence does as well.
But if this code is relying on getter/setter side effects... that's much worse than if those lines are just a no-op.
2 u/KanykaYet Nov 30 '21 I don't saying it is good, I just wanted to now if it isn't a completely useless lines, but yes it be better be done with some call of a function.
2
I don't saying it is good, I just wanted to now if it isn't a completely useless lines, but yes it be better be done with some call of a function.
Isn't that just basically a reset? Done bad?
1
Gotta be sure it was reassigned 8)
8
u/GreatBarrier86 Nov 30 '21
I could see myself doing this if Iβm not thinking. Itβs dumb but not the worst. Seems more like an oversight really.
5
u/KanykaYet Nov 30 '21
Do typescript has getter and setter as C#?
2
u/TheWashbear Nov 30 '21
Isn't that just basically a reset? Done bad?
1
u/[deleted] Nov 30 '21
Gotta be sure it was reassigned 8)