Rule(s) of Thumb
All these rules are circumstantial and will not always apply to all teams or projects. Here’s a list of questions you can ask yourself to check your sanity:
Questions to ask yourself:
Section titled “Questions to ask yourself:”- Is today a day I want to try out something new?
- Can I try something new today?
- Do we/I have standards around this?
- Do we/I have helpers to do this?
- Do I have a reason why I coded this way today?
- Will future me like this solution/piece of code?
- Will my team lead (or anyone who reads and reviews my code) like what I did? Or am I willing to argue/justify why I did it?
- Am I taking too long or is it expected to take this long?
- Do I know that I am willingly going against standards?
- If I strip all code and just leave class, properties, method, function names, etc., do I still understand what this code does?
- Can I do this with pure CSS?
You know you are doing something wrong when:
Section titled “You know you are doing something wrong when:”- You can move really fast based on the code you wrote but others cannot.
- You are subscribing inside a subscription.
- You are using
ngOnInit
to do something that depends on a possibly changing input. - You named a TypeScript interface/class/helper utility with a one-word name such as
helper
,blob
,subscription
, etc. - You are on Angular 19+ and writing new code using any lifecycle hook besides
ngOnDestroy
. - You are on Angular 18+ and writing new code using
ngIf
,ngFor
, orngSwitch
in your templates. - You are redirecting a user to a
404
or similar page from a component. - You are on Angular 16+ and you are writing new code into or as modules.
Hot takes:
Section titled “Hot takes:”- 🌶️ You are on Angular 9+ and you are using
ngOnChanges
. - 🌶️ You write too many template-driven forms.
- 🌶️ You are on Angular 19+ but you are not using any observables/subjects.
- 🌶️ You are on Angular 19+ and you are writing or relying heavily on pipes.
You know you are doing something right when:
Section titled “You know you are doing something right when:”- You or your company is making money from the code you are writing.
- You can move really fast while working on your codebase and others can too.
- You are redirecting a user to a
404
or similar page from a route guard. - You are on Angular 18+ and you have replaced most template or content-specific lifecycle hooks with
computed
,effect
, andafterNextRender
. - All your new components/directives/pipes are standalone.
- All your new components are using
ChangeDetectionStrategy.OnPush
.
If you know you are doing something right:
Section titled “If you know you are doing something right:”- Leave a comment, get a lot of that git blame dopamine.
- Share with someone more knowledgeable than you and get a reaction.
If you know you are doing something wrong:
Section titled “If you know you are doing something wrong:”- Leave a comment with a TODO and hopefully a ticket number.
- Share with someone more knowledgeable than you and get a reaction.
- If your peers/manager and product accept it, document it in your ticket and PR.
Learn More with AI
Section titled “Learn More with AI”Don’t use AI for these questions, they are meant to be answered by you.
Also, you should come up with rules that make sense for you and your team.