<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Manas Kumar Pradhan]]></title><description><![CDATA[Manas Kumar Pradhan]]></description><link>https://blogs.devmanas.in</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Apr 2026 09:52:34 GMT</lastBuildDate><atom:link href="https://blogs.devmanas.in/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Building Big with Less: Rails and the Power of Monolithic Architecture]]></title><description><![CDATA[You Have an Idea. Now What?
You've got a brilliant idea. You've gathered your friends - maybe 10-20 people who can code. Everyone's excited, the energy is incredible, and you're ready to build something amazing.
Then someone asks: "How should we actu...]]></description><link>https://blogs.devmanas.in/power-of-monolithic-architecture-in-rails</link><guid isPermaLink="true">https://blogs.devmanas.in/power-of-monolithic-architecture-in-rails</guid><category><![CDATA[Rails]]></category><category><![CDATA[Ruby on Rails]]></category><category><![CDATA[monolithic architecture]]></category><dc:creator><![CDATA[Manas Kumar Pradhan]]></dc:creator><pubDate>Thu, 18 Dec 2025 04:06:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1766140607080/3acf5ca7-1352-48f5-9722-77be46e05141.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-you-have-an-idea-now-what"><strong>You Have an Idea. Now What?</strong></h2>
<p>You've got a brilliant idea. You've gathered your friends - maybe 10-20 people who can code. Everyone's excited, the energy is incredible, and you're ready to build something amazing.</p>
<p>Then someone asks: "How should we actually build this?"</p>
<p>Suddenly you're confused. Should you use microservices? Do you need fancy cloud architecture? What even is Kubernetes, and do you need it?</p>
<p>Here's the truth: You're overthinking it.</p>
<p>Let's talk about the simplest way to turn your idea into reality.</p>
<h2 id="heading-the-big-question-simple-or-complicated"><strong>The Big Question: Simple or Complicated?</strong></h2>
<p><strong>Q: Everyone talks about splitting apps into tiny pieces (microservices). Is that what we need?</strong></p>
<p>Imagine you're building a house. One contractor says: "First, you need to dig the foundation yourself. Then source all the materials. Then figure out the plumbing. Then the electrical. I'll supervise."</p>
<p>Another contractor says: "I've built 10,000 houses. I know exactly what you need. I'll handle the foundation, plumbing, electrical, everything. You just tell me how many bedrooms you want."</p>
<p>Which sounds easier?</p>
<p>Microservices are like hiring 10 separate contractors. Big companies like Google need this because they have thousands of programmers who can't all work on the same thing.</p>
<p>But you're not Google. You're a small team trying to build something people will love.</p>
<p><strong>Q: But won't we need to scale eventually?</strong></p>
<p>Yes, eventually. But here's what most people miss: GitHub handled millions of developers with a Rails monolith for years. Shopify processes billions in transactions on Rails. Basecamp has run profitably for decades without breaking into microservices.</p>
<p>The question isn't "will we need to scale?" It's "what's preventing us from building the product right now?"</p>
<p><strong>Q: So what's the alternative?</strong></p>
<p>A well-crafted monolith. And specifically, a Rails monolith.</p>
<h2 id="heading-what-is-rails-why-rails-why-now"><strong>What is Rails? Why Rails? Why Now?</strong></h2>
<p><strong>Q: What is Rails? I haven't heard of this one.</strong></p>
<p>Rails is a web application framework written in Ruby. Ruby is a programming language similar to Python or JavaScript. <strong>David Heinemeier Hansson (DHH)</strong> created the Rails framework to make web development faster and more enjoyable.</p>
<h3 id="heading-the-rails-philosophy-two-core-principles"><strong>The Rails Philosophy: Two Core Principles</strong></h3>
<ol>
<li><p><strong>Convention Over Configuration</strong></p>
</li>
<li><p><strong>Don't Repeat Yourself (DRY)</strong></p>
</li>
</ol>
<p><strong>Q: What does "Convention Over Configuration" actually mean in practice?</strong></p>
<p>Let's get concrete. In many frameworks, before you can save a user to the database, you need to install a database driver, write configuration files connecting to the database, define your database schema manually, write queries or ORM mappings, set up connection pools, and configure transaction handling.</p>
<p>In Rails, you type:</p>
<p><code>rails generate model User name:string email:string</code></p>
<p><code>rails db:migrate</code></p>
<p>Done. You now have a User model that can save to the database. Rails assumed you want PostgreSQL or MySQL (you can change it), created the database table, set up all connections, and gave you methods like <code>User.create(name: "Alice", email: "alice@example.com")</code>.</p>
<p>That's convention over configuration. Rails makes smart decisions so you don't have to.</p>
<p><strong>Q: Give me another example.</strong></p>
<p>Sure. Let's say you want to send password reset emails. In most frameworks, you'd need to choose an email library, configure SMTP settings, create email templates, write the logic to generate tokens, set up background job processing, and handle delivery failures.</p>
<p>In Rails, you run:</p>
<p><code>rails generate mailer UserMailer password_reset</code></p>
<p>Rails creates a complete email system. You write your email template in HTML and text versions. The mailer class handles everything. Want to send it in the background so your web request doesn't wait? Change UserMailer.password_reset(user).deliver_now to deliver_later. That's it.</p>
<p>Rails has been doing this for 20 years. It knows what you need.  </p>
<p><strong>Q: How does Rails keep code DRY?</strong></p>
<p><strong>"Don't Repeat Yourself (DRY),"</strong> which is a trademark concept for developers. You don't need to rewrite the same code again and again. Write it once in one place and reuse it throughout your application. It's a basic principle of software development, and Rails makes it incredibly easy.</p>
<p>Rails provides several tools for the DRY principle. Helpers extract logic from your views - as the name suggests, views are what's shown to the end user, and helpers keep them clean and focused. Concerns extract common controller logic into controller concerns and common model logic into model concerns. This promotes code reuse and keeps your codebase maintainable.</p>
<p>When you use these tools effectively, you avoid duplicating code across your application.</p>
<h2 id="heading-the-companies-that-bet-big-on-rails"><strong>The Companies That Bet Big on Rails</strong></h2>
<p><strong>Q: Who actually uses Rails? I hear it's outdated.</strong></p>
<p>Let's look at the numbers:</p>
<p><strong>GitHub</strong> - 100+ million developers, billions of repositories. Still Rails. They're not a small startup anymore - they're Microsoft-owned and processing some of the most critical infrastructure in software development.</p>
<p><strong>Shopify</strong> - Over $200 billion in total sales processed. Rails handles Black Friday traffic spikes that would crush most systems. They've proven you can scale a monolith to handle millions of concurrent users.</p>
<p><strong>Airbnb</strong> - Revolutionized an entire industry with Rails. They only started extracting services after they had millions of listings and needed specialized search functionality.</p>
<p><strong>Basecamp</strong> - Built by DHH himself, profitable for 20+ years, never needed to break into microservices. They handle millions of users with a small team.</p>
<p><strong>Q: So these companies never moved to microservices?</strong></p>
<p>Some extracted specific services when they had a concrete reason. Airbnb pulled out search because Elasticsearch required specialized knowledge. GitHub extracted some Git operations for performance. But their core applications? Still monolithic Rails.</p>
<p>The key insight: They started with monoliths and only broke things apart when they had specific, measurable problems that required it. They didn't start with complexity.</p>
<h2 id="heading-inside-a-rails-application"><strong>Inside a Rails Application</strong></h2>
<p><strong>Q: What does Rails actually give me when I start a project?</strong></p>
<p><code>Run rails new my_startup</code> and you get a complete application structure:</p>
<p><strong>The app/ directory</strong> - Where you'll spend 90% of your time:</p>
<ul>
<li><p><strong>models/</strong> - Your business data and logic</p>
</li>
<li><p><strong>controllers/</strong> - Handle HTTP requests</p>
</li>
<li><p><strong>views/ -</strong> HTML, JSON, or XML responses</p>
</li>
<li><p><strong>jobs/</strong> - Background tasks</p>
</li>
<li><p><strong>mailers/</strong> - Email templates and logic</p>
</li>
<li><p><strong>channels/</strong> - Real-time WebSocket features</p>
</li>
<li><p><strong>assets/</strong> - CSS, JavaScript, images</p>
</li>
</ul>
<p><strong>The config/ directory</strong> - Database, routes, environment settings, all configured intelligently by default.</p>
<p><strong>The db/ directory</strong> - Database migrations tracked in code, so your entire team stays in sync.</p>
<p><strong>The test/ directory</strong> - Because Rails believes good code has tests.</p>
<h3 id="heading-the-power-of-rails-generators"><strong>The Power of Rails Generators</strong></h3>
<p><strong>Q: What is a generator?</strong></p>
<p>A generator is a Rails tool that automatically creates code following Rails conventions. It eliminates thousands of tiny decisions that drain your energy. Because every generator follows the same conventions, code from one Rails app looks like code from another. New team members onboard faster, and you can move between projects without relearning the structure.</p>
<p><strong>Q: What can generators create?</strong></p>
<p>Everything. Here's a sampling:</p>
<p><strong>Controllers:</strong> rails generate controller Products index show new create - Creates the controller, view templates, route entries, and test files.</p>
<p><strong>Models:</strong> rails generate model Product name:string price:decimal inventory:integer - Creates the model, database migration, and tests. Automatically sets up the database table with correct data types.</p>
<p><strong>Scaffolds:</strong> rails generate scaffold Article title:string body:text published:boolean - Creates everything - model, migration, controller, views, routes, tests. A complete CRUD interface in one command.</p>
<p><strong>Mailers:</strong> rails generate mailer Order confirmation shipping_notification - Creates email templates and mailer classes.</p>
<p><strong>Jobs:</strong> rails generate job ProcessPayment - Creates a background job class ready for Sidekiq or other job processors.</p>
<p><strong>Q: Doesn't this generated code lead to bloat?</strong></p>
<p>Only if you leave what you don't need. Experienced Rails developers generate the structure, then delete or modify what doesn't fit. The point is to get 80% of the boilerplate instantly, then customize the remaining 20%.</p>
<h2 id="heading-everything-you-need-batteries-included"><strong>Everything You Need, Batteries Included</strong></h2>
<p><strong>Q: What about features beyond basic CRUD?</strong></p>
<p>This is where Rails truly shines. Most frameworks give you the basics. Rails gives you production-grade features:</p>
<p><strong>Caching</strong> - Out of the box, Rails supports fragment caching, page caching, and Russian doll caching. Wrap slow operations in Rails.cache.fetch and Rails handles the rest. Your database query that takes 500ms? Now 5ms from cache.</p>
<p><strong>File Uploads</strong> - Active Storage handles file uploads to your disk, Amazon S3, Google Cloud, or Azure. It processes image variants automatically. Upload a 5MB photo, Rails can generate thumbnails, handle responsive images, and serve them efficiently.</p>
<p><strong>Internationalization (i18n)</strong> - Building for multiple countries? Rails has translation management built-in. Store text in YAML files, Rails handles plural forms, date formatting, and number formatting for every locale.</p>
<p><strong>Action Cable</strong> - Real-time features without the complexity. Chat applications, live notifications, collaborative editing - WebSockets are first-class citizens in Rails.</p>
<p><strong>Background Jobs</strong> - Send 10,000 welcome emails? Process video uploads? Rails queues jobs through Active Job, which works with Sidekiq, Resque, or other processors.</p>
<p><strong>Q: What about security?</strong></p>
<p>Rails takes security seriously with built-in protections:</p>
<p><strong>Brakeman</strong> - Run bin/brakeman and get a security audit. It scans for SQL injection, cross-site scripting, unsafe redirects, and dozens of other vulnerabilities.</p>
<p><strong>CSRF Protection</strong> - Every form automatically includes CSRF tokens. Rails rejects form submissions that don't have valid tokens.</p>
<p><strong>Parameter Filtering</strong> - Passwords and sensitive data automatically filtered from logs.</p>
<p><strong>SQL Injection Prevention</strong> - Active Record parameterizes queries. Writing User.where("email = ?", params[:email]) is safe by default.</p>
<p><strong>Q: How does Rails help maintain code quality?</strong></p>
<p><strong>RuboCop</strong> - Run bin/rubocop and Rails checks your code style. Inconsistent indentation? Extra whitespace? Long methods? RuboCop flags them. Better yet, run bin/rubocop -a and it auto-corrects most issues.</p>
<p><strong>Built-in Testing</strong> - Every generator creates test files. Rails encourages test-driven development from day one. Run rails test to verify everything works.</p>
<p><strong>Database Migrations</strong> - Changes to your database schema are versioned. Every migration is timestamped. Rolling back a bad deploy? Just roll back migrations too. Your entire team's databases stay synchronized.</p>
<h2 id="heading-tldr"><strong>TLDR;</strong></h2>
<p>Stop overcomplicating your startup's tech stack. Rails gives you a complete, production-ready framework that powers GitHub, Shopify, Airbnb, and Basecamp. With convention over configuration, you'll spend less time on infrastructure decisions and more time building features your users will love. Start with a monolith, ship fast, and scale when you actually need to - not because someone told you microservices are "the future." Rails has 20 years of battle-tested wisdom baked in. Use it.</p>
<h2 id="heading-lets-connect"><strong>Let's Connect</strong></h2>
<p>Found this helpful? Connect with me on LinkedIn to continue the conversation and share your experiences with Rails or monolithic architecture. What's your take - monolith first or microservices from day one?</p>
<p><a target="_blank" href="https://www.linkedin.com/in/manask-pradhan/"><strong>https://www.linkedin.com/in/manask-pradhan/</strong></a></p>
<p><a target="_blank" href="mailto:contact@devmanas.in"><strong>contact@devmanas.in</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[Will AI Take Your Job Before You Even Get One? Here’s the Truth.]]></title><description><![CDATA[First, a Quick Reality Check
Before getting into the story, let me remind you of something.When computers first became a thing, people were scared. They thought it would take away all the jobs. And yes, it did replace some—like the clerk who used onl...]]></description><link>https://blogs.devmanas.in/will-ai-take-your-job-before-you-even-get-one-heres-the-truth</link><guid isPermaLink="true">https://blogs.devmanas.in/will-ai-take-your-job-before-you-even-get-one-heres-the-truth</guid><category><![CDATA[AI]]></category><category><![CDATA[technology]]></category><category><![CDATA[Developer]]></category><dc:creator><![CDATA[Manas Kumar Pradhan]]></dc:creator><pubDate>Mon, 12 May 2025 15:43:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1747063227513/f6057988-625e-49be-a9b4-978c5c5c9e7a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-first-a-quick-reality-check">First, a Quick Reality Check</h2>
<p>Before getting into the story, let me remind you of something.<br />When computers first became a thing, people were scared. They thought it would take away all the jobs. And yes, it did replace some—like the clerk who used only pen and paper. But fast forward to today, and look around: computers have created <em>way more jobs</em> than they replaced. That same clerk? He probably learned how to use Excel and got even better at his job.</p>
<p>Now, here we are again. Same fear, new tech. This time, it’s <strong>AI</strong>.</p>
<hr />
<h2 id="heading-so-is-ai-going-to-steal-our-jobs">So... Is AI Going to Steal <em>Our</em> Jobs?</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1747063481637/1e3641d5-6ebf-46b0-b992-1616a54a6855.png" alt class="image--center mx-auto" /></p>
<p>Let’s be real. This is the question almost every tech student is thinking about lately.</p>
<p>With headlines shouting about layoffs at <strong>Google, Microsoft, Meta, Apple, TCS</strong>, and more, it’s hard <em>not</em> to stress.<br />A report by <strong>Goldman Sachs</strong> even estimates that <strong>300 million jobs could be displaced globally</strong> by 2030.<br />And already, <strong>25% of routine tasks</strong> are being automated.<br />According to <strong>Statista</strong>, <strong>46% of office/admin work</strong> is highly vulnerable to AI.</p>
<p>Sounds intense, right?</p>
<p>On top of that, <strong>AI can already automate 70% of workforce tasks</strong>, says <strong>McKinsey</strong>.<br />And <strong>23% of existing roles</strong> are expected to change completely by 2027.<br />If you’re aiming for an entry-level job, it’s natural to feel nervous. That’s where the pressure hits first.</p>
<hr />
<h2 id="heading-but-hold-on-its-not-all-doom-and-gloom">But Hold On — It’s Not All Doom and Gloom</h2>
<p><img src="https://assets.weforum.org/editor/eo6f75uJGTbcfSpky7ByXEK3El6b_1TKf03DtSj4ZZE.jpg" alt="A chart showing total job growth and loss" class="image--center mx-auto" /></p>
<p>Before we spiral into panic, here’s the flip side: AI is also <em>creating</em> jobs. A lot of them.</p>
<p>In fact, a recent survey suggests that <strong>170 million new jobs</strong> will pop up globally this decade, even while AI is automating so many other roles. And guess what? <strong>69 million</strong> new positions will emerge, even as <strong>92 million</strong> disappear – so that’s a <strong>net gain of 14 million</strong> jobs in the next five years. Seems like there’s still hope, right?</p>
<p>So yeah, AI will change the game—but it doesn’t mean we’re out of the game.</p>
<hr />
<h2 id="heading-the-real-gamechanger-people-who-know-ai">The Real Gamechanger: People Who <em>Know</em> AI</h2>
<p>It’s not about competing <em>against</em> AI—it’s about working <em>with</em> it.</p>
<p><strong>Magnus Grimeland</strong>, venture capitalist and founder of Antler, said:</p>
<blockquote>
<p>“The demand for great software engineers will only increase in the coming decades.”</p>
</blockquote>
<p>Why? Because even the smartest AI can mess up. That’s where <em>you</em> come in—to clean up, guide, and make better decisions. It still needs us humans to fix things.</p>
<p><strong>Mark Zuckerberg</strong>, CEO of Meta, put it this way:</p>
<blockquote>
<p>“AI allows small startups to do what only large teams could do before.”</p>
</blockquote>
<p>That’s huge. With just a small team and the right AI tools, you can launch products that once needed full departments.</p>
<p>Even big companies are taking note. <strong>JP Morgan</strong> is training <strong>200,000+ employees</strong> on AI tools because they see AI as a must-have skill, not a fancy add-on.</p>
<p>And guess what?<br /><strong>70% of companies are expected to be using AI by 2030</strong>.<br />Not knowing how to use it might be the new “not knowing how to use email.”</p>
<hr />
<h2 id="heading-its-not-ai-vs-you-its-ai-with-you">It’s Not AI <em>vs</em> You — It’s AI <em>with</em> You</h2>
<p><img src="https://videos.openai.com/vg-assets/assets%2Ftask_01jv2j5cw3ehn9hmbsqxykvqmq%2F1747064198_img_3.webp?st=2025-05-12T14%3A15%3A24Z&amp;se=2025-05-18T15%3A15%3A24Z&amp;sks=b&amp;skt=2025-05-12T14%3A15%3A24Z&amp;ske=2025-05-18T15%3A15%3A24Z&amp;sktid=a48cca56-e6da-484e-a814-9c849652bcb3&amp;skoid=aa5ddad1-c91a-4f0a-9aca-e20682cc8969&amp;skv=2019-02-02&amp;sv=2018-11-09&amp;sr=b&amp;sp=r&amp;spr=https%2Chttp&amp;sig=qVJ1KCEz460z%2BIZrWXd1pUSRWsI%2B6zOd7Io%2F2p4uNMQ%3D&amp;az=oaivgprodscus" alt="Generated image" class="image--center mx-auto" /></p>
<p>This might be the most important line in this whole article:</p>
<blockquote>
<p><strong>It’s not AI vs YOU — it’s AI + YOU.</strong></p>
</blockquote>
<p>Instead of being scared, look at AI like your teammate. It can handle all the boring, repeat work, and leave <em>you</em> with the creative, strategic stuff.</p>
<p><strong>Jensen Huang</strong>, CEO of NVIDIA, put it perfectly:</p>
<blockquote>
<p>“You won’t lose your job to AI, but to someone who uses it.”</p>
</blockquote>
<p>And <strong>Bill Gates</strong> backed that up too. He said:</p>
<blockquote>
<p>“AI will free us up to do things that software never helped with before—like teaching, caring for patients, and supporting the elderly.”</p>
</blockquote>
<p>So basically, AI isn’t stealing your future. It’s <em>reshaping</em> it.</p>
<hr />
<h2 id="heading-heard-about-vibe-coding">Heard About Vibe Coding?</h2>
<p><img src="https://videos.openai.com/vg-assets/assets%2Ftask_01jv2hwra9et4v8h2xs7gd1jfy%2F1747063907_img_1.webp?st=2025-05-12T13%3A48%3A54Z&amp;se=2025-05-18T14%3A48%3A54Z&amp;sks=b&amp;skt=2025-05-12T13%3A48%3A54Z&amp;ske=2025-05-18T14%3A48%3A54Z&amp;sktid=a48cca56-e6da-484e-a814-9c849652bcb3&amp;skoid=aa5ddad1-c91a-4f0a-9aca-e20682cc8969&amp;skv=2019-02-02&amp;sv=2018-11-09&amp;sr=b&amp;sp=r&amp;spr=https%2Chttp&amp;sig=CENybJGlLRsMygrcSeWEjMvqDTwSsM92STiG9dLW10o%3D&amp;az=oaivgprodscus" alt="Generated image" class="image--center mx-auto" /></p>
<p>Let’s take a quick detour to talk about something buzzing in the dev world lately: <strong>vibe coding</strong> (or <strong>vibecoding</strong>).</p>
<p>No, it’s not a programming language—it’s more of a <strong>mindset and approach</strong>.</p>
<p>It’s like coding based on your <em>gut</em>, your <em>flow</em>—the vibe of the project. You don’t overthink every line. You just start building. It's about being experimental and going with what feels right.</p>
<p>But here's the twist...</p>
<blockquote>
<p><strong>According to Wikipedia</strong>, <em>vibe coding</em> also refers to a new AI-driven way of programming, where you describe your problem in natural language (like a prompt), and <strong>a large language model (LLM)</strong> like ChatGPT writes the code for you.</p>
</blockquote>
<p>The term was introduced by <strong>Andrej Karpathy</strong> (former OpenAI co-founder and Tesla AI lead) in <strong>February 2025</strong>, who said:</p>
<blockquote>
<p><em>“It’s not really coding — I just see things, say things, run things, and copy-paste things, and it mostly works.”</em></p>
</blockquote>
<p>He uses this method for weekend projects, calling it <strong>“conversational coding”</strong> — using voice prompts and letting AI do the typing.</p>
<p>Now, vibe coding <strong>isn’t perfect</strong>. Yeah, it can get messy. Bugs can creep in. And in big projects, things can break. But for small hacks, MVPs, or personal stuff? It helps you stay in the zone and avoid burnout.</p>
<p>So whether you’re vibing with your keyboard or vibing with an AI, next time you’re stuck, don’t overthink it — <strong>just vibe code it.</strong></p>
<hr />
<h2 id="heading-what-you-can-actually-do-about-all-this">What You Can Actually Do About All This</h2>
<p>Alright, so what now?</p>
<p>Here’s how you <em>future-proof</em> yourself in the age of AI:</p>
<ul>
<li><p><strong>Learn AI tools</strong> – Not just ChatGPT, but tools that fit your field.</p>
</li>
<li><p><strong>Build hybrid skills</strong> – Pair your tech knowledge with creativity, communication, and problem-solving.</p>
</li>
<li><p><strong>Stay curious and open-minded</strong> – Like <strong>Anima Anandkumar</strong>, Director of ML at NVIDIA, says:</p>
<blockquote>
<p>“Don’t fear AI. Focus on the things AI can’t do—like solving new, hard problems.”</p>
</blockquote>
</li>
</ul>
<p>Most importantly: don’t just follow trends. Adapt to them.</p>
<p>Marketing, customer support, analytics—all being reshaped by AI.<br />But fields that need human judgment—like design, writing, education, or mental health—are still super relevant.</p>
<hr />
<h2 id="heading-tldr-the-future-of-jobs-is-still-yours">TL;DR – The Future of Jobs Is Still Yours</h2>
<p>AI’s not here to destroy us. It’s here to <strong>change how we work</strong>.</p>
<p>So here’s what you need to ask yourself:</p>
<ul>
<li><p>Will you let AI handle the repetitive stuff while you level up?</p>
</li>
<li><p>Will you use it to build smarter, faster, and more creatively?</p>
</li>
<li><p>Will you adapt—or be replaced by someone who does?</p>
</li>
</ul>
<p>Because in the end, the future of work won’t be written <em>by</em> AI.</p>
<p>It’ll be written <em>by people who know how to use it</em>.</p>
<p>So next time someone says, <em>“Will AI take your job?”</em><br />You say:</p>
<blockquote>
<p><strong>“Only if I ignore it.”</strong></p>
</blockquote>
<p><em>All images proudly brought to you by AI, approved by vibes.</em></p>
<p><em>AI’s not here to take over—it’s here to work with us! You can read my other article over on Hashnode (</em><a target="_blank" href="https://pkmanas22.hashnode.dev/"><em>https://pkmanas22.hashnode.dev/</em></a><em>). Let’s connect on Twitter or LinkedIn (I’m</em> <strong><em>pkmanas22</em></strong> <em>everywhere) and share thoughts or questions. And if you enjoyed this piece, leave me a comment or give me a little love on Hashnode!</em></p>
]]></content:encoded></item><item><title><![CDATA[Understanding JavaScript Prototypes: A Deep Dive into Class Functionality]]></title><description><![CDATA[Introduction: Everything in JavaScript is an Object
You might be surprised by this subtitle, but it’s true: in JavaScript, everything is an object—either directly an object or it inherits from Object. After learning some jargon like __proto__, protot...]]></description><link>https://blogs.devmanas.in/understanding-javascript-prototypes-a-deep-dive-into-class-functionality</link><guid isPermaLink="true">https://blogs.devmanas.in/understanding-javascript-prototypes-a-deep-dive-into-class-functionality</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[oop]]></category><category><![CDATA[coding]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[prototype]]></category><dc:creator><![CDATA[Manas Kumar Pradhan]]></dc:creator><pubDate>Sun, 13 Apr 2025 23:09:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1744585338156/a678aaf6-d06f-4580-9ad5-57f0311a76b7.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction-everything-in-javascript-is-an-object">Introduction: Everything in JavaScript is an Object</h2>
<p>You might be surprised by this subtitle, but it’s true: in JavaScript, everything is an object—either directly an object or it inherits from <code>Object</code>. After learning some jargon like <code>__proto__</code>, <code>prototype</code>, we circle back to this core concept. So, let’s start with the basics: <strong>What are Prototypes?</strong></p>
<h2 id="heading-what-is-a-prototype">What is a Prototype?</h2>
<blockquote>
<p>A prototype is the mechanism by which JavaScript objects inherit properties from one another. Every object has some built-in properties—these come from its prototype.</p>
</blockquote>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> arr = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>];

<span class="hljs-keyword">const</span> user = {
    <span class="hljs-attr">name</span>: <span class="hljs-string">"Manas"</span>
}
</code></pre>
<p>In the code above, we created an array that inherits from the <code>Array</code> prototype. This means we can access methods like <code>map</code>, <code>filter</code>, <code>sort</code>, <code>reverse</code>, etc., even though they weren’t explicitly declared. Similarly, the <code>user</code> object also inherits from JavaScript’s default <code>Object</code>.</p>
<p>JavaScript also has a <code>typeof</code> operator, which is a unary operator (takes only one operand). It's used to determine the type of a variable.</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">console</span>.log(<span class="hljs-keyword">typeof</span> arr)    <span class="hljs-comment">// object</span>
<span class="hljs-built_in">console</span>.log(<span class="hljs-keyword">typeof</span> user)    <span class="hljs-comment">// object</span>
</code></pre>
<p>When we access <code>user.</code> (user dot) in editor, we’ll notice more properties than just <code>name</code>. These additional properties come from the <code>Object</code> prototype.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744572137152/8af070b3-d870-4916-bfa2-4b3b20b0f3d2.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-prototype-chaining">Prototype Chaining</h2>
<p>Earlier, we explored prototypes. The <strong>process</strong> by which inheritance flows is called the <strong>prototype chain</strong>.</p>
<p>Take the array example again. The variable <code>arr</code> inherits properties from the <code>Array</code> class, which itself inherits from the <code>Object</code> class. Eventually, this chain ends at <code>null</code>.</p>
<p>This hierarchical lookup is called the <strong>prototype chain</strong>—a term that sounds complex but is simple in practice.</p>
<p>You can try this with arrays or regular objects. Keep inspecting the prototype until you reach <code>null</code>—that’s the end of the chain.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744573301341/f1dd9606-8204-4e5c-8efa-d8c70f259fd5.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-proto-vs-prototype-vs-objectgetprototypeof"><code>__proto__</code> vs <code>prototype</code> vs <code>Object.getPrototypeOf()</code></h2>
<ol>
<li><h3 id="heading-proto"><code>__proto__</code></h3>
<p> Used to access or set the internal <code>[[Prototype]]</code> of an object.<br /> <strong>Syntax:</strong> <code>arr.__proto__</code></p>
</li>
<li><h3 id="heading-prototype"><code>prototype</code></h3>
<p> Used as a blueprint for creating objects (usually with constructor functions or classes).<br /> <strong>Syntax:</strong> <code>Array.prototype</code></p>
</li>
<li><h3 id="heading-objectgetprototypeof"><code>Object.getPrototypeOf( )</code></h3>
<p> Used to retrieve the prototype of a specific object.<br /> <strong>Syntax:</strong> <code>Object.getPrototypeOf(arr)</code></p>
</li>
</ol>
<p>All three methods help you access or understand the prototype chain—but they serve different purposes.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744575050444/1cb7e83e-5ecd-49fa-814a-9ac14eeab132.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-why-is-everything-an-object-in-js">Why Is Everything an Object in JS?</h2>
<p>Now that you understand <code>__proto__</code>, you can better appreciate that <strong>everything in JavaScript, even primitives like strings and numbers, inherit from</strong> <code>Object</code>—either directly or through their respective wrappers.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744576129636/db379e3c-54c5-4162-8853-12b61ad30695.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744576396780/acea88d1-8621-46e9-9995-77cfdb32bcc3.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-shadowing-properties-overriding-inherited-properties">Shadowing Properties (Overriding Inherited Properties)</h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> date = <span class="hljs-keyword">new</span> <span class="hljs-built_in">Date</span>();

<span class="hljs-built_in">console</span>.log(date.getFullYear())     <span class="hljs-comment">// 2025;</span>

date.getFullYear = <span class="hljs-function">() =&gt;</span> <span class="hljs-string">"Hijacked"</span>;

<span class="hljs-built_in">console</span>.log(date.getFullYear())    <span class="hljs-comment">// Hijacked</span>
</code></pre>
<p>In the code above, we override the built-in <code>getFullYear()</code> method of the <code>Date</code> object. Initially, it returns the current year (2025), but after shadowing, it returns "Hijacked".</p>
<p>How does this work?</p>
<ul>
<li><p>First, JavaScript checks if the property exists on the object itself.</p>
</li>
<li><p>If not, it looks up the prototype chain.</p>
</li>
<li><p>If still not found, it returns <code>undefined</code>.</p>
</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> obj = {
    <span class="hljs-attr">name</span>: <span class="hljs-string">"Manas"</span>,
    <span class="hljs-attr">age</span>: <span class="hljs-number">21</span>,
    greetings () {
        <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Good morning"</span>);
    }
}
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744577645965/b1720a39-5403-46ad-afdd-7737be262d3e.png" alt class="image--center mx-auto" /></p>
<p>When you type <code>obj.</code> in your editor, you’ll see your own properties and some inherited from <code>Object</code>. You can override any inherited method, which is what <strong>shadowing</strong> means.</p>
<h2 id="heading-pre-es6-prototypes-and-inheritance">Pre-ES6 Prototypes and Inheritance</h2>
<p>Initially, JavaScript didn’t have classes. The <code>class</code> keyword was introduced in <strong>ES6</strong>. Before that, developers used <strong>constructor functions and prototypes</strong> for object creation.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> userA = {
    <span class="hljs-attr">fname</span>: <span class="hljs-string">"Manas"</span>,
    <span class="hljs-attr">lname</span>: <span class="hljs-string">"Pradhan"</span>,
    fullName () {
        <span class="hljs-keyword">return</span> <span class="hljs-string">`<span class="hljs-subst">${<span class="hljs-built_in">this</span>.fname}</span> <span class="hljs-subst">${<span class="hljs-built_in">this</span>.lname}</span>`</span>;
    }
}

<span class="hljs-keyword">const</span> userB = {
    <span class="hljs-attr">fname</span>: <span class="hljs-string">"John"</span>,
    <span class="hljs-attr">lname</span>: <span class="hljs-string">"Doe"</span>
}

<span class="hljs-built_in">console</span>.log(userA.fullName())    <span class="hljs-comment">// "Manas Pradhan"</span>
<span class="hljs-built_in">console</span>.log(userB.fullName())    <span class="hljs-comment">// Uncaught TypeError: userB.fullName is not a function</span>
</code></pre>
<p>In these two objects, we have to maintain the coding principle <strong>DRY</strong> (Don’t Repeat Yourself). Instead of writing again, we can add the below line.</p>
<pre><code class="lang-javascript">userB.__proto__ = userA;

<span class="hljs-built_in">console</span>.log(userA.fullName())    <span class="hljs-comment">// "Manas Pradhan"</span>
<span class="hljs-built_in">console</span>.log(userB.fullName())    <span class="hljs-comment">// John Doe</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744579059504/56da0a2c-e39d-46b1-942a-1fea2ad557ac.png" alt class="image--center mx-auto" /></p>
<p>But this approach overrides the original prototype chain. Now <code>userB</code> inherits from <code>userA</code> directly and loses the default <code>Object</code> prototype.</p>
<h2 id="heading-es6-classes-and-constructors">ES6 Classes and Constructors</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744580456743/af71a6dc-ea13-4924-a0d2-45fa40fc1fb0.png" alt class="image--center mx-auto" /></p>
<p>When we use the <code>class</code> keyword and create instances using <code>new</code>, the memory and prototype relationships look something like this:</p>
<ul>
<li><p><code>userA</code> and <code>userB</code> are stored in the <strong>stack</strong>, holding <strong>references</strong> to the actual objects in the <strong>heap</strong>.</p>
</li>
<li><p>The <strong>heap</strong> stores the object instances created using the <code>User</code> class.</p>
</li>
<li><p>These instances have their own properties (<code>fname</code>, <code>lname</code>) and link back to shared methods (like <code>getFullName()</code>).</p>
</li>
<li><p><code>userA.__proto__</code> points to <code>User.prototype</code>.</p>
<p>  You can see this includes the <strong>constructor: class User</strong> and the method <strong>getFullName()</strong>.</p>
</li>
<li><p><code>User.prototype.__proto__</code> points to <strong>Object.prototype</strong>, which includes built-in methods like <code>toString</code>, <code>hasOwnProperty</code>, etc.</p>
</li>
</ul>
<p>Finally, <code>Object.prototype.__proto__</code> is <code>null</code>—this ends the chain.</p>
<pre><code class="lang-plaintext">userA → User.prototype → Object.prototype → null
</code></pre>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Understanding prototypes gives you deep insight into how JavaScript works under the hood. Whether you're debugging tricky inheritance bugs or explaining concepts in an interview, mastering prototypes is a powerful skill.<br />Now, open your browser console and explore the prototype chain yourself — it’s the best way to make it stick! 💻✨</p>
<p><strong><em>Thanks for reading till the end!<br />I hope this helped you truly understand how prototypes work in JavaScript.<br />If you found this useful, feel free to share it or drop your thoughts in the comments — happy coding! 🚀</em></strong></p>
]]></content:encoded></item></channel></rss>