Experiences
- Always try to avoid the text box and select box to remain light the browser page. try to use label.
- experience gather from line item issue of ASD data entry. (vvi)
- text box disable is not good decision. if never to enable the text box that time try to use label that help you to load faster page
- floor and ceil issue
- example
- Math.floor(3.4) +1 = 4 (i need 4) so use Math.ceil(3.4) = 4
- but Math.floor(4)+1 = 5 ( i need 4) use Math.ceil(4) = 4
- for for loop issue try to focus on lower bound and upper bound case, it helps you find the bugs.
- Try to bring data from database as less as possible. only bring required data otherwise it will make the server slow. After bring data then filter apply is very bed idea.
- in case of multiple condition please use switch case instead of if-else condition. Switch-case condition is more faster then if-else condition when condition number reached to more than 5/6/10
- for excel or csv file import, we shoud be concerned that all row has been imported.
- please avoid the for loop to find the index. please use the hash-map to find the optimize way. example: (VVI)
- var arrIndex = alreadyExistProviderId('expedition',
dataArray[i].id, invoiceNumber, jsonObj);
function alreadyExistProviderId(flowType, id, invoiceNumber, jsonObj) {
var returnIndex = -1;
for (var i = 0; i < jsonObj[flowType].details.length; i++) {
if (jsonObj[flowType].details[i].id == id
&& jsonObj[flowType].details[i].invoice_number == invoiceNumber) {
returnIndex = i;
break;
}
}
return returnIndex;
} - always try keep note of task that you have finished. so in the release period you can check your finished task is tested or not. I have faced the issue int mirror entry module. just last day QA tested the task. he forgot. so it's very crucial that try to make your task has been tested before release or delivery
- Before starting the project we need ensure the code structure and database structure.
- always insert raw data in database so you not need to be worried about calculation.
- ASD data entry: here we calculate threshold during data entry. its not wise decision. because during data update and delete again we need to calculate threshold . it may create many bugs and wrong calculation.
- always keep data in database with all floating value ... not need to be round before the before insert. just round before showing the report.
- 3.999999999 value insert in db so that we need not to be worried about client demand 3.99 or 3.9999 .
- if we save 3.99 then client demand like as 3.9999. so not wise decision.
- input form system should not be different place. because
- data management difficulty
- so posting client ui when we create mission
- mission list
- try to manage one one form to mange update and insert
- Always try to avoid multiple variable in program it could be worst.
- Need to send data over URL always use database user ID . it will help many disgusting situation. Example. so posting: mission and misson file upload issue
- When project is calculative then use sql database. when project is use data but not calculative like post comments that time use nosql.
- dont do like as ASD threshold tracking and etubeworld dashboard calculation. because it could not be a wise database design.
- alwayes keep data raw.
- no need to take precalculation for faster data retrive
- for faster data retrieve, firstly chack last transection time and deshboard table data update time. compare the time. then update the dashboard data. if already updated then no need to update the dashboard table data to show dashboard like as etube world.
- we can make a procedure to update data of dashboard after checking time status and call the procedure;
- Sometime middle of the code, we improve the code and keep the previous logic to avoid inconsistency but acttualy we remove bad logic code and fresh the code. It could be if the system is running in production.
- base config is very important because any time can chanage server or any other things. please do everything as much as possible to configurable
- try to code as much as simple, like statement and declaration reprot generate in when current month reproting. current month report generate problem
- need to careful for special char to insert in database
********************************************************************