Eliminating Redundancy: Best Practices in Coding Style

Introduction I've observed a tendency among our developers to write code that goes beyond the scope of current functionality. For example: async updateEnrollmentStatus( id: string, status: EnrollmentStatus, options?: QueryOptions, ) { const query = this.model.updateOne( { id: id, }, { status: status }, ); if (options) this.setQueryOptions(query, options); const result = await query.exec(); return…

About this website

I'm Tommy Tsui. I'm a 7 years software engineer. Currently staying in Vancouver, Canada. I am also a newbie barista in Vancouver. This website is a place for me to record what I have learnt and study on in my life.…