Posts

Showing posts from May, 2026

Why OOP's Shared State is Limiting in Multi-core

 Modern computers have multiple cores — meaning several tasks can run simultaneously in parallel. This is exactly where OOP reveals one of its biggest limitations. What is the Problem with OOP? In OOP, objects hold their own state — data that keeps changing over time. When multiple cores try to read and write to the same object simultaneously, problems like Race Conditions appear. Think of it like two people editing the same Google Doc offline at the same time — both changes clash and one overwrites the other. To handle this, developers resort to locks and mutexes — which make the code complex, slow, and notoriously hard to debug. How Does Functional Programming Solve This? FP's biggest strength is Immutability. Data is created once and never modified Functions always return the same output for the same input — these are called Pure Functions No shared state means cores never conflict with each other Real-world Analogy: OOP = One whiteboard where everyone writes at the same time — ...

Binary को Human-Readable Text में कैसे बदला जाता है?

 Computer सिर्फ numbers समझता है — 0 और 1। तो जब हम "A" लिखते हैं, computer के लिए वो actually एक number होता है। इस पूरे process को Character Encoding कहते हैं। Step-by-step समझते हैं: Step 1 — Binary से Number बनता है 8 bits मिलकर एक byte बनाते हैं, और वो byte एक number represent करती है। उदाहरण: 01000001 = 65 Step 2 — Number से Character बनता है एक encoding table होती है जो हर number को एक character से map करती है। ASCII table के हिसाब से: 65 = "A" Step 3 — Encoding Standards ASCII — सिर्फ English के लिए, 128 characters UTF-8 — दुनिया की सभी languages support करता है Unicode — Universal standard, 1 लाख+ characters Real Example: "Hi" को computer इस तरह store करता है: H = 01001000 → 72 → "H" i = 01101001 → 105 → "i" एक line में बोलें तो: Binary → Numbers → Encoding Table → Human-readable Text बस एक dictionary है जिसमें computer देखता है कि यह number मतलब यह letter। जिस dictionary का use हो, वही encoding है।