WHY yeh matter karta hai (the economics): Code likhne se kahin zyada baar padha jaata hai — studies aur
folklore is ratio ko 10:1 reads to writes ke aas paas rakhte hain. Ek tiny per-read saving ko
sau reads se multiply karo toh woh writing cost se kahin zyada ho jaata hai. Documentation amortized hai: ek baar likho, har
future read par bachao.
WHAT galat hota hai bina iske: "bus factor" of 1 (sirf ek hi insaan ek module samajhta hai), decisions
baar baar litigate hote hain, onboarding weeks mein measure hoti hai, aur bugs tab aate hain jab log intent guess karte hain.
HOW decide karo ki comment apni jagah earn karta hai ya nahi — poochho: "Kya main code ko rewrite kar sakta hoon taaki yeh comment unnecessary ho jaaye?" Agar haan, toh variable rename karo / function extract karo. Jo comments code ko restate karte hain woh rot karte hain, kyunki code change hota hai aur comment chup chap jhooth bolta rehta hai.
WHY attached, sirf comment nahi: kyunki yeh ek real string object hai, tools isse extract kar sakte hain — IDE
tooltips, help(), auto-generated API docs (Sphinx). Comment in sab ke liye invisible hai; docstring
machine-accessible documentation hai.
WHY ADRs (killer feature): code current state dikhata hai lekin history erase kar deta hai. Chhe mahine
baad koi poochh ta hai "hum Postgres kyun use kar rahe hain, Mongo kyun nahi?" — bina ADR ke woh zero se re-debate karte hain.
ADR yeh why ki memory hai ki ek decision kyun liya gaya, rejected options samait (Steel-man:
record karta hai kyun alternative sahi laga aur kyun haara).
Recall Feynman: ek 12-saal ke bachche ko explain karo (hidden — pehle recall karo!)
Ek tricky brick par sticky note jo kahe "yeh hissa gate ko thaame hai, isko mat khiincho" = inline comment.
Har tower par ek chhota card jo kahe "is tower ko kholne ke liye flag ghoomao" = docstring.
Entrance par ek poster: "Yeh Dragon Castle hai! Khelne ka tarika yeh hai." = README.
Ek diary entry: "Humne khai ko laal ki jagah blue banaya, kyunki laal rang tapakta rehta tha." = ADR.
Castle bina in sab ke bhi kaam karta hai — lekin agla bachcha jo khele (ya future-you jo
bhool gaya) kho jaayega aur cheezein torega. Notes ek mystery box ko friendly guide mein badal dete hain.
Ek inline comment ko konsa ek sawaal answer karna chahiye?
Why (rationale/intent jo code express nahi kar sakta) — kabhi what nahi jo code already dikhata hai.
Comment add karne ki jagah rename/extract kyun prefer karein?
Self-documenting code rot nahi kar sakta; comments drift ho sakte hain aur jab code change ho toh jhooth bolne lagte hain.
Kya cheez technically docstring ko comment se alag banati hai?
Docstring ek real string object hai jo code object se attached hoti hai (__doc__), isliye help(), IDEs, aur Sphinx jaisi tools isse extract kar sakti hain; comments un tools ke liye invisible hain.
Ek function docstring ke teen contract parts ke naam batao.
Ek-sentence what + why plus copy-pasteable install/quickstart — woh chhota hissa jo zyaatar visitors padhte hain decide karne aur kuch run karne ke liye.
ADR kya record karta hai jo code nahi kar sakta?
Ek decision ke peeche ka why, jisme consider kiye gaye alternatives aur unke consequences shamil hain — woh history jo code erase kar deta hai.
ADRs immutable aur dated kyun hote hain?
Yeh ek append-only historical log hain; tum past decision edit nahi karte, tum ek naya ADR likhte ho jo isse supersede karta hai, timeline preserve karte hue.
Documentation ko justify karne wala read:write ratio kya hai?
Roughly 10:1 — code likhne se kahin zyada baar padha jaata hai, isliye per-read savings writing cost ko amortize kar deti hain.