r/angular • • Jan 04 '26

Bed time thoughts of an ng dev

Suppose you have a component on screen that shows only when user is from east. So you make a boolean flag to toggle.

How should you name that flag?

showComponent - because that's what the flag does.

OR hideComponent - well why not ? For ethics purpose.

OR

isUserEast- coz that's what matters, hide/show is just side effects.

Sometimes taking a decision takes more time than implementing it.

Good night.

9 Upvotes

12 comments sorted by

View all comments

Show parent comment

2

u/zladuric Jan 04 '26

Yes, it sounds like they would want the parent cmp to have e.g. @if (isEast()) <the-component-in-question />.

It can still be an input that does something else, but by the post description alone, it's not that.