Skip to main content

Command Palette

Search for a command to run...

The Boy Scout Rule

Updated
1 min read
The Boy Scout Rule
H

Software Engineer

Developer တွေရဲ့ဘဝမှာ အလုပ်ချိန်တော်တော်များများက code အသစ်ရေးရတာထက် ရေးပြီးသား codeကို ပြန်ပြင်ရတာ၊ အသစ်ထပ်ထည့်ရတာကပိုများတယ်။ ရှေ့က developer က ရေးခဲ့တဲ့ code က maintainable ဖြစ်ပြီး clean ဖြစ်နေရင်တော်သေးတယ်။ မဟုတ်ပဲ အလုပ်လုပ်အောင်လောက်ပဲရေးခဲ့တာမျိုးဆို တော်တော်တိုင်ပတ်တယ်။ business logic ကိုနားလည်အောင်လုပ်ရတာကတစ်ခု code ကိုနားလည်အောင်လုပ်ရတာတစ်ခုနဲ့ task ကအလွယ်တကူမပြီးပဲ အချိန်ကြာသွားတတ်တယ်။

အခုလိုဖြစ်လေ့ရှိတာက management ဘက် အတင်း rush ပြီး timeline ကြပ်တဲ့အခါမှာဖြစ်တာများတယ်။ ‌ရေးတဲ့ developer ကအနေနဲ့က management pressure နဲ့ timeline အရ task ပြီးဖို့အဓိကဆိုပြီး လုပ်လိုက်‌တော့ code က messy ဖြစ်လာရော။ business ဘက်ကလည်း feature တွေဆက်တိုက်ထုတ်‌ဖို့လိုနေတော့ refactoring လုပ်ဖို့အချိန်ဆိုတာ မရှိသလောက်ဖြစ်််််််လာတယ်။ ဒါက code base ကို technical debt‌ တွေ ရှိလာစေတယ်။

ဒီလိုဖြစ်လာရင် Uncle Bob ရဲ့ Clean code စာအုပ်မှာ ပြောထားတဲ့ Boy Scout Rule ဆိုတာလေးကိုသုံးသင့်တယ်။ သူရဲ့အဓိပ္ပာယ်က Leave your code better than you found it. တဲ့။ ကင်းထောက်လေးတွေက သူတို့ camping ထွက်လို့ စခန်းချတဲ့အခါ အဲ့နေရာကနေထွက်ရင် ရောက်ခဲ့တဲ့အချိန်တုန်းကထက်ပိုပြီး သန့်ရှင်းအောင်လုပ်ခဲ့ပါ ဆိုတဲ့rule ကနေ ယူထားတာ။ ကမ္ဘာ့ဖလားတုန်းက ဂျပန်ပရိသတ်‌တွေ ပွဲပြီးတဲ့အခါ အမှိုက်လိုက်ကောက်ကြသလိုမျိုးပေါ့။ ထိုနည်းတူပဲ feature တစ်ခုကိုပြင်ရေးတဲ့အခါ ထပ်ထည့်ရေးတဲ့ code အပြင် သက်ဆိုင်ရာ feature ရဲ့ ရှိပြီးသား code ကိုလည်း အချိန်ရရင် ရသလို တတ်နိုင်သမျှ refactoring လုပ်ခဲ့ဖို့ကို Rule က ဆိုလိုတာပါ။

လက်ရှိသုံးကြည့်သလောက်တော့ တော်တော်အဆင်ပြေတာတွေ့ရတယ်။ task လည်းပြီးသလို refactoring လုပ်ဖို့ အချိန်လည်း အရမ်းကြီးမပေးရတော့ဘူး။ technical debt ကိုလည်း တစ်ဖြည်းဖြည်းချင်း ဖြည့်ပြီးသားဖြစ်သလို နောက်တစ်ခါ အဲ့ဒီ feature ကိုထပ်ပြင်ရရင်လည်း ဘယ်သူပဲဖြစ်ဖြစ် အလွယ်တကူ ဝင်ရေးသွားလို့ရလာတယ်။

Management အနေနဲ့ code quality ထက် feature ကို အမြန်ရဖို့က အဓိကဆိုတော့ timeline ကိုအများကြီးမပေးချင်ကြဘူး။ ဒါပေမယ့် တကယ် implementation လုပ်ရတဲ့ developer တွေအတွက်ကြ code base က clean ဖြစ်လေလေ task ကို deliver မြန်မြန်လုပ်နိုင်လေလေဖြစ်တဲ့အတွက် refactoring လုပ်ဖို့ကို အချိန်သီးသန့်မရတဲ့အခါမျိုးမှာ လက်ရှိ task အတွက် အချိန်နည်းနည်းပိုတောင်းပြီး Boy scout rule ကိုသုံးလိုက်ခြင်းက developer ဘက်ရော business အတွက်ရော win win situation တစ်ခု ရရှိစေနိုင်ပါလိမ့်မယ်။

#hwp23

More from this blog

Infrastructure ကိုင်ပြီး အိပ်ရေးမပျက် ချင် လျှင် ဒါမျိုး Alarms လုပ် 🔥🔥🔥

High Level ရေးထားတာပါ ဒါပေမဲ့ လွယ်ပါတယ် ​ကိုယ့်မှာ AWS Infra တွေရှိတယ်ဆို တွေ့သမျှ metric တွေကို alarms တွေလုပ်ပြီး notification ယူမနေဘဲ တကယ် effective ဖြစ်တဲ့ metric တွေကိုမှ CloudWatch ရဲ့ alarm feature တွေနဲ့ ပေါင်းပြီး ပို့စေချင်ပါတယ်။ ​ဥပမာ prod...

Jan 17, 20263 min read159
Infrastructure ကိုင်ပြီး အိပ်ရေးမပျက် ချင် လျှင်  ဒါမျိုး Alarms လုပ် 🔥🔥🔥

How to connect On Premises Network and Cloud (AWS)? (Part-2)

ကိုယ့်ရဲ့ ‌data center (on-prem) network နဲ့ AWS ချိတ်ဆက်ဖို့ လိုလာပြီဆိုရင် ဘယ်လို ချိတ်ဆက်ကြမလဲ? အပိုင်း (၂) မှာ တော့ Direct connect အကြောင်းကို ဆွေးနွေး သွားမှာ ဖြစ်ပါတယ်။ အပိုင်း (၁) Site-to-site VPN အကြောင်းကို လေ့လာချင်ရင်တော့ အောက်ပါ link မှာ ...

Dec 20, 20253 min read224
How to connect On Premises Network and Cloud (AWS)? (Part-2)

How to connect On Premises Network and Cloud (AWS)? (Part-1)

ကိုယ့်ရဲ့ ‌data center (on-prem) network နဲ့ AWS ချိတ်ဆက်ဖို့ လိုလာပြီဆိုရင် ချိတ်ဆက်နိုင်တဲ့ နည်း (၂) နည်း ရှိပါတယ်။ 1. Site-to-Site VPN (Virtual Private Network) 2. Direct connect Site-to-Site VPN - On-prem network နဲ့ AWS resources တွေ ချိတ်ဆက်တဲ့...

Dec 12, 20252 min read262
How to connect On Premises Network and Cloud (AWS)? (Part-1)

Accessibility for Designer

လွန်ခဲ့တဲ့အပတ်က ရုံးက Designer တွေနဲ့ တော်ကီပွားရင်း Accessibility နဲ့ပတ်သတ်တာတွေ သူတို့ကို ရှင်းပြဖြစ်တယ်။ ကိုယ်တိုင်ကလည်း အရင်ကတည်းက ဒီ topic ကိုစိတ်ဝင်စားလို့ လေ့လာနေတာဆိုတော့ အခွင့်အရေးရရင် ရသလို sharing လုပ်ဖြစ်တယ်။ အဓိကက Accessibility နဲ့ပတ်သတ်...

Nov 21, 20253 min read69
Accessibility for Designer

VPC Endpoint

အားလုံးဘဲ မင်္ဂလာပါ။ ဒီနေ့ sharing လုပ်ပေးချင်တာကတော့ VPC Endpoint အကြောင်းဘဲဖြစ်ပါတယ်။ VPC Endpoint ဆိုတာ VPC နဲ့ AWS services တွေ ကို public Internet ကို အသုံးမပြုဘဲနဲ့ Privately connect လုပ်ပေးတာ ဖြစ်ပါတယ်။ Internet Gateway, NAT Gateway နဲ့ Public...

Nov 18, 20252 min read98
VPC Endpoint
M

Myanmar Technical Blog

108 posts

Cloud, Linux, DevOps, Docker, Security အစရှိတဲ့ နည်းပညာများ အကြောင်းကို မြန်မာလို ပြန်လည်မျှဝေပေးမယ့် Blog ပဲဖြစ်ပါတယ်ခဗျာ...