Programmers Quadrant

Programmers Quadrant

You Think Where Are You?

https://1drv.ms/x/s!Ajm_5YB10YZyi1gphL5aC0IbWYrQ?e=Dsd4Hs

 

Geomatics Programmers 

To Switch to Engineer Coders

Data Structure & Algorithm

  • Expert in  Data Structure & Algorithm.
  • Understands its limitation and usage (Big O n stability)
  • Can implement the DS and algo without using other people library
  • Can translate mathematical equation or natural law into algorithm
  • From requirement, know what best DS and algo to be used
  • E.g can create own ElasticSearch

What is best DS & Algo to implement?

What is best DS & Algo to implement?

Reusable Codes

  • Design Object Oriented Class follows SOLID
  • Polymorphism
  • Enforce Contract of Prototype
  • Enforce Algorithm or Checking
  • Organized Codes
  • Organized Folders
  • Follow Naming Convention
  • Follow Best Coding Practices

Design OOP Follows SOLID

Polymorphism

Animal

Milk

Sport

Meat

getMultiFixedTables<T>(select: number[], where: string[], 
tableJoints: HTableJoint[], options: HSelectOption<T>): Promise<HResponse<T[]>>{
getMultiFixedTables<T>(select: any[], where:any[], 
tableJoints: any[], options: any<T>): Promise<any<T[]>>{

Enforce Contract of Prototype

  public async getSingleFixedTable<Entity>(
       tableName: string, 
       select: HSelectCommand[] = [], 
       where: HWhereCommand[] = [], 
       options: HSelectOption<Entity> = {}
     ): Promise<HResponse<Entity[]>>{
            
            options = _.defaults(
            		options, 
                    {limit: 10, offset: 0, orders: [], groupBy: [], having: {}}
            ); 
            
            this.command.parseGet(select, where, options);   
            tableName = this.command.replacePrefix(tableName);                                             
            
            return await this._getSingleFixedTable(
              tableName, 
              this.command.getSelectFixed(), 
              this.command.getWhereFixed(), this.command.getOptions()
            );
    }

Enforce Algorithm or Checking

set default values

enforce algo

child contract

Organized Folders

Library - can be used for any projects

Plugins - library that might be used by an application

Projects - specific codes for a particular application. Can't be used by others

Resources - images, SQL that are common for all projects

Organized Codes

Principle To Remember

  1. One class one single responsibility
  2. One function one single purpose

How To Validate

  1. Change one place reflected to all classes and functions
  2. Good function doesn't have more than 10 lines

Follow Naming Convention

https://slides.com/muhaiminnaim/naming-convention

Follow Best Coding Practices

https://slides.com/muhaiminnaim/ecmascript-2016-2018

Programmers Quadrant

By Wan Razali

Programmers Quadrant

  • 129