<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Priyanshu Sahu on Medium]]></title>
        <description><![CDATA[Stories by Priyanshu Sahu on Medium]]></description>
        <link>https://medium.com/@sahupriyanshu2006?source=rss-57d1c33b5173------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YgRXV8pqUhp5GNGTrKOa4w.png</url>
            <title>Stories by Priyanshu Sahu on Medium</title>
            <link>https://medium.com/@sahupriyanshu2006?source=rss-57d1c33b5173------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 15:51:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sahupriyanshu2006/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Top 10 TypeScript Techniques Senior Developers Secretly Use]]></title>
            <link>https://medium.com/@sahupriyanshu2006/top-10-typescript-techniques-senior-developers-secretly-use-564c65ed2088?source=rss-57d1c33b5173------2</link>
            <guid isPermaLink="false">https://medium.com/p/564c65ed2088</guid>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Priyanshu Sahu]]></dc:creator>
            <pubDate>Tue, 07 Jul 2026 05:07:31 GMT</pubDate>
            <atom:updated>2026-07-07T05:07:31.953Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*sgSsoj-6mdFIs3ygFBj1yw.png" /></figure><p><em>Most developers learn TypeScript by adding types to JavaScript and calling it done. Senior developers use TypeScript differently. They use it to make entire categories of bugs impossible at the type level, enforce constraints without writing runtime checks, and communicate intent so clearly that the code becomes self-documenting. Here are the ten techniques that actually separate the two.</em></p><h3>01. Discriminated Unions</h3><p>Make impossible states actually impossible</p><p>This is the single most powerful technique in TypeScript and the one most developers underuse. Instead of using optional properties and hoping consumers check them, you model every valid state as a distinct shape with a shared literal discriminant field. TypeScript then narrows automatically inside conditionals.</p><blockquote>without discriminated unions — bug waiting to happen</blockquote><pre>// nothing stops you from having both data and error at once<br>type ApiResponse = {<br>  data?: User<br>  error?: string<br>  loading?: boolean<br>}<br><br>// consumer has no idea what to check<br>function handleResponse(res: ApiResponse) {<br>  if (res.data) { /* maybe fine */ }<br>  // what if data AND error are both set?<br>}</pre><blockquote>with discriminated unions — correct by construction</blockquote><pre>type ApiResponse =<br>  | { status: &#39;loading&#39; }<br>  | { status: &#39;success&#39;; data: User }<br>  | { status: &#39;error&#39;; message: string }<br><br>function handleResponse(res: ApiResponse) {<br>  switch (res.status) {<br>    case &#39;loading&#39;:<br>      return showSpinner()<br>    case &#39;success&#39;:<br>      // TypeScript KNOWS res.data exists here<br>      return renderUser(res.data)<br>    case &#39;error&#39;:<br>      // TypeScript KNOWS res.message exists here<br>      return showError(res.message)<br>  }<br>}</pre><p>Why seniors love this</p><p>If you add a new state later and forget to handle it in the switch, TypeScript will tell you. The exhaustiveness is enforced at compile time, not at runtime when a user hits the bug.</p><h3>02. The satisfies Operator</h3><p>Validate shape without losing literal types</p><p>Added in TypeScript 4.9, satisfies is one of the most underused operators. The problem it solves: when you annotate a variable with a type, TypeScript widens the value to that type and you lose the more specific information. satisfies validates the type without the widening.</p><pre>type Config = {<br>  theme: &#39;light&#39; | &#39;dark&#39; | &#39;system&#39;<br>  colors: Record&lt;string, string&gt;<br>}<br>// with a normal annotation you lose the literal type<br>const config1: Config = {<br>  theme: &#39;dark&#39;,<br>  colors: { primary: &#39;#3d6fe8&#39; }<br>}<br>// config1.theme is now &#39;light&#39; | &#39;dark&#39; | &#39;system&#39;, not &#39;dark&#39;<br><br>// with satisfies, the shape is validated but types stay narrow<br>const config2 = {<br>  theme: &#39;dark&#39;,<br>  colors: { primary: &#39;#3d6fe8&#39;, secondary: &#39;#7c3aed&#39; }<br>} satisfies Config// config2.theme is still &#39;dark&#39; — the literal type is preserved<br>// config2.colors.primary is still &#39;string&#39; — shape is validated<br>// if you typo a field name, TypeScript still catches it</pre><h3>03. Template Literal Types</h3><p>Build string types programmatically</p><p>TypeScript can construct string types using the same template literal syntax as JavaScript. This is how you type things like event names, route paths, CSS properties, and API endpoints without manually listing every combination.</p><pre>type EventName&lt;T extends string&gt; = `on${Capitalize&lt;T&gt;}`<br>// produces: &#39;onClick&#39; | &#39;onChange&#39; | &#39;onSubmit&#39;<br><br>type DomEvents = EventName&lt;&#39;click&#39; | &#39;change&#39; | &#39;submit&#39;&gt;<br>// type safe CSS properties<br><br>type CSSVar&lt;T extends string&gt; = `--${T}`<br>type AppVars = CSSVar&lt;&#39;primary&#39; | &#39;secondary&#39; | &#39;bg&#39;&gt;<br>// produces: &#39;--primary&#39; | &#39;--secondary&#39; | &#39;--bg&#39;<br>// type safe API routes<br><br>type HttpMethod = &#39;GET&#39; | &#39;POST&#39; | &#39;DELETE&#39;<br>type Route = &#39;/users&#39; | &#39;/orders&#39; | &#39;/products&#39;<br>type ApiEndpoint = `${HttpMethod} ${Route}`<br>// produces: &#39;GET /users&#39; | &#39;GET /orders&#39; | &#39;POST /users&#39; | ...<br><br>function callApi(endpoint: ApiEndpoint) { /* ... */ }<br>callApi(&#39;GET /users&#39;)     // valid<br>callApi(&#39;PATCH /users&#39;)   // TypeScript error: not in the type</pre><h3>04. Branded Types</h3><p>Prevent mixing structurally identical types</p><p>TypeScript uses structural typing. Two types with the same shape are interchangeable, even if they mean completely different things. Branded types attach a phantom marker to a primitive to make them nominally distinct. This is how you prevent passing a userId where an orderId is expected.</p><pre>// without branding — TypeScript cannot tell these apart<br>type UserId = string<br>type OrderId = string<br><br>function deleteOrder(id: OrderId) { /* ... */ }<br>const userId: UserId = &#39;user-42&#39;<br>deleteOrder(userId) // no error - catastrophic bug<br><br>// with branded types - structurally different, enforced<br>type Brand&lt;T, B&gt; = T &amp; { readonly _brand: B }<br>type UserId  = Brand&lt;string, &#39;UserId&#39;&gt;<br>type OrderId = Brand&lt;string, &#39;OrderId&#39;&gt;<br>// constructor functions act as the only way to create these types<br>const UserId  = (id: string) =&gt; id as UserId<br>const OrderId = (id: string) =&gt; id as OrderId<br>const userId  = UserId(&#39;user-42&#39;)<br>const orderId = OrderId(&#39;order-99&#39;)<br>deleteOrder(userId)  // TypeScript error: UserId is not assignable to OrderId<br>deleteOrder(orderId) // works fine</pre><p><em>Real world use cases</em></p><p><em>UserId, OrderId, ProductId, EmailAddress, HashedPassword, ValidatedInput, Milliseconds vs Seconds, Dollars vs Cents. Any primitive that has semantic meaning beyond its raw type.</em></p><h3>05. The infer Keyword advanced</h3><p>Extract types from inside other types</p><p>infer lets you pull a type out from within a conditional type. It is how built-in utility types like ReturnType, Awaited, and Parameters are actually implemented. Once you understand it, you can write your own.</p><pre>// extract the return type of any function<br>type ReturnType&lt;T&gt; = T extends (...args: any[]) =&gt; infer R ? R : never<br><br>function getUser() { return { id: 1, name: &#39;Alice&#39; } }<br>type User = ReturnType&lt;typeof getUser&gt;<br>// User = { id: number, name: string }<br>// extract the resolved value of a Promise<br>type UnwrapPromise&lt;T&gt; = T extends Promise&lt;infer V&gt; ? V : T<br>type Data = UnwrapPromise&lt;Promise&lt;User&gt;&gt;<br>// Data = User<br>// extract the element type of an array<br>type ArrayElement&lt;T&gt; = T extends (infer E)[] ? E : never<br>type Names = ArrayElement&lt;string[]&gt;<br>// Names = string<br>// extract first argument of any function<br>type FirstArg&lt;T&gt; = T extends (first: infer A, ...rest: any[]) =&gt; any ? A : never<br>type Arg = FirstArg&lt;typeof getUser&gt;<br>// Arg = never (no args), try a fn with args:<br>type A2 = FirstArg&lt;(id: string) =&gt; void&gt;<br>// A2 = string</pre><h3><strong>06. Exhaustiveness Checking with </strong><strong>never</strong></h3><p>Let the compiler tell you when a switch is incomplete</p><p>When you add a new case to a union type, you want TypeScript to find every switch statement that needs updating. The trick is to assign the default case to a variable typed as never. If any case is unhandled, TypeScript throws a compile error.</p><pre>type Shape =<br>  | { kind: &#39;circle&#39;;    radius: number }<br>  | { kind: &#39;rectangle&#39;; width: number; height: number }<br>  | { kind: &#39;triangle&#39;;  base: number;  height: number }<br><br>// this helper makes the default case scream at compile time<br>function assertNever(value: never): never {<br>  throw new Error(`Unhandled case: ${JSON.stringify(value)}`)<br>}<br>function getArea(shape: Shape): number {<br>  switch (shape.kind) {<br>    case &#39;circle&#39;:<br>      return Math.PI * shape.radius ** 2<br>    case &#39;rectangle&#39;:<br>      return shape.width * shape.height<br>    case &#39;triangle&#39;:<br>      return 0.5 * shape.base * shape.height<br>    default:<br>      return assertNever(shape)<br>      // if you add &#39;hexagon&#39; to Shape and forget to handle it,<br>      // TypeScript throws an error RIGHT HERE at compile time<br>  }<br>}</pre><h3>07. Mapped Types with Key Remapping</h3><p>Transform the shape of existing types programmatically</p><p>Mapped types let you take an existing type and produce a transformed version of it. Combined with the as clause for key remapping, you can build utilities that would take dozens of manual type definitions otherwise.</p><pre>// make all properties optional but keep their types<br>type DeepPartial&lt;T&gt; = {<br>  [K in keyof T]?: T[K] extends object ? DeepPartial&lt;T[K]&gt; : T[K]<br>}<br><br>// prefix all keys with &#39;get&#39;<br>type Getters&lt;T&gt; = {<br>  [K in keyof T as `get${Capitalize&lt;string &amp; K&gt;}`]: () =&gt; T[K]<br>}<br>type User = { id: string; name: string; email: string }<br>type UserGetters = Getters&lt;User&gt;<br>// { getId: () =&gt; string, getName: () =&gt; string, getEmail: () =&gt; string }<br>// pick only function properties from a type<br>type FunctionKeys&lt;T&gt; = {<br>  [K in keyof T as T[K] extends Function ? K : never]: T[K]<br>}<br>type Service = { id: string; save(): void; delete(): void; name: string }<br>type ServiceMethods = FunctionKeys&lt;Service&gt;<br>// { save: () =&gt; void, delete: () =&gt; void }</pre><h3>08. Type Guards and Assertion Functions</h3><p>Teach TypeScript how to narrow your own types</p><p>TypeScript narrows types in if statements automatically for primitives. For your own complex types, you write a type guard function to tell TypeScript what narrowing to apply.</p><pre>type Cat = { kind: &#39;cat&#39;; meows: boolean }<br>type Dog = { kind: &#39;dog&#39;; barks: boolean }<br>type Animal = Cat | Dog<br><br>// type predicate - return type tells TypeScript what the guard proves<br>function isCat(animal: Animal): animal is Cat {<br>  return animal.kind === &#39;cat&#39;<br>}<br>function speak(animal: Animal) {<br>  if (isCat(animal)) {<br>    console.log(animal.meows) // TypeScript knows animal is Cat here<br>  } else {<br>    console.log(animal.barks) // TypeScript knows animal is Dog here<br>  }<br>}<br>// assertion function - throws if condition not met, narrows after the call<br>function assertDefined&lt;T&gt;(val: T): asserts val is NonNullable&lt;T&gt; {<br>  if (val === null || val === undefined) {<br>    throw new Error(&#39;Value is null or undefined&#39;)<br>  }<br>}<br>const user = getUser() // returns User | null<br>assertDefined(user)    // throws at runtime if null<br>console.log(user.name) // TypeScript knows user is User here, not User | null</pre><h3>09. Const Assertions and as const</h3><p>Preserve literal types all the way through</p><p>By default, TypeScript widens literal values to their base types. as const locks every value down to its most specific literal type and makes all properties read only. This is essential for config objects, lookup tables, and any data you want to derive union types from.</p><pre>// without as const — types are widened<br>const config = {<br>  env: &#39;production&#39;,     // inferred as string, not &#39;production&#39;<br>  port: 3000,             // inferred as number, not 3000<br>  features: [&#39;auth&#39;, &#39;search&#39;] // inferred as string[]<br>}<br><br>// with as const - every value is exactly as written<br>const config = {<br>  env: &#39;production&#39;,<br>  port: 3000,<br>  features: [&#39;auth&#39;, &#39;search&#39;]<br>} as const<br>// config.env is &#39;production&#39;, not string<br>// config.port is 3000, not number<br>// config.features is readonly [&#39;auth&#39;, &#39;search&#39;]<br>// the real power: derive union types from the values<br>const ROLES = [&#39;admin&#39;, &#39;editor&#39;, &#39;viewer&#39;] as const<br>type Role = typeof ROLES[number]<br>// Role = &#39;admin&#39; | &#39;editor&#39; | &#39;viewer&#39;<br>// add a new role to the array and the type updates automatically<br>const ROUTES = {<br>  home:    &#39;/&#39;,<br>  users:   &#39;/users&#39;,<br>  profile: &#39;/profile&#39;<br>} as const<br>type AppRoute = typeof ROUTES[keyof typeof ROUTES]<br>// AppRoute = &#39;/&#39; | &#39;/users&#39; | &#39;/profile&#39;</pre><p>The pattern to remember</p><p>Define data once as a const object or array with as const. Derive all your union types from it using typeof and indexed access. When the data changes, the types update for free. No duplication.</p><h3>10. Conditional Types for API Response Shapes</h3><p>Return different types based on input</p><p>Conditional types let you express that a function returns different types depending on the input it receives. This is how you type overloaded functions cleanly, and how libraries like Prisma type their include and select queries.</p><pre>// function returns different shapes based on a flag<br>type UserResponse&lt;T extends boolean&gt; =<br>  T extends true<br>    ? { user: User; posts: Post[] }   // with posts<br>    : { user: User }                   // without posts<br><br>function fetchUser&lt;T extends boolean&gt;(<br>  id: string,<br>  includePosts: T<br>): Promise&lt;UserResponse&lt;T&gt;&gt; {<br>  /* implementation */<br>}<br>// TypeScript knows exactly what comes back<br>const result1 = await fetchUser(&#39;123&#39;, true)<br>result1.posts   // valid - TypeScript knows posts exists<br>const result2 = await fetchUser(&#39;123&#39;, false)<br>result2.posts   // TypeScript error - posts does not exist on this return type<br>// another real world example: optional fields based on mode<br>type CreateMode = &#39;draft&#39; | &#39;publish&#39;<br>type ArticleInput&lt;M extends CreateMode&gt; =<br>  M extends &#39;publish&#39;<br>    ? { title: string; content: string; publishedAt: Date }<br>    : { title: string; content?: string }<br>function createArticle&lt;M extends CreateMode&gt;(<br>  mode: M,<br>  input: ArticleInput&lt;M&gt;<br>) { /* ... */ }<br>// publishedAt is REQUIRED when mode is &#39;publish&#39;<br>createArticle(&#39;publish&#39;, { title: &#39;Hey&#39;, content: &#39;...&#39;, publishedAt: new Date() })<br>// publishedAt is NOT required when mode is &#39;draft&#39;<br>createArticle(&#39;draft&#39;,   { title: &#39;Hey&#39; })</pre><h3>How These Fit Together</h3><p>These ten techniques are not independent tricks. They form a way of thinking about types as a layer of logic rather than just documentation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*3DvumsWa4_OAQpm9AJ1U-Q.png" /></figure><p><strong><em>“TypeScript’s job is not to describe your code. It is to prevent a category of bugs from ever compiling.”</em></strong></p><h3>The Quick Reference</h3><pre>// 01. Discriminated unions — model every valid state explicitly<br>type State = | { status: &#39;idle&#39; } | { status: &#39;ok&#39;; data: T } | { status: &#39;err&#39;; msg: string }<br>// 02. satisfies - validate shape without widening literal types<br>const x = { mode: &#39;dark&#39; } satisfies Config<br>// 03. Template literal types - build string unions programmatically<br>type Event&lt;T extends string&gt; = `on${Capitalize&lt;T&gt;}`<br>// 04. Branded types - prevent mixing structurally identical primitives<br>type UserId = string &amp; { readonly _brand: &#39;UserId&#39; }<br>// 05. infer - extract types from inside other types<br>type Unwrap&lt;T&gt; = T extends Promise&lt;infer V&gt; ? V : T<br>// 06. assertNever - exhaustiveness check at compile time<br>function assertNever(x: never): never { throw new Error(&#39;Unhandled case&#39;) }<br>// 07. Mapped types - transform type shapes programmatically<br>type Getters&lt;T&gt; = { [K in keyof T as `get${Capitalize&lt;string &amp; K&gt;}`]: () =&gt; T[K] }<br>// 08. Type guards - teach TypeScript how to narrow your types<br>function isCat(a: Animal): a is Cat { return a.kind === &#39;cat&#39; }<br>// 09. as const - lock values to literals, derive union types from data<br>const ROLES = [&#39;admin&#39;, &#39;editor&#39;] as const<br>type Role = typeof ROLES[number]<br>// 10. Conditional types - return different shapes based on input<br>type Res&lt;T extends boolean&gt; = T extends true ? { data: User; posts: Post[] } : { data: User }</pre><blockquote>The difference between beginner and senior TypeScript is not knowing more syntax. It is using the type system to eliminate entire categories of bugs before they ever run, so the things that can go wrong at runtime are genuinely unpredictable, not just unchecked.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=564c65ed2088" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Every AI Side Hustle That Ultimately Failed]]></title>
            <link>https://medium.com/@sahupriyanshu2006/every-ai-side-hustle-that-ultimately-failed-3f5261f21a3d?source=rss-57d1c33b5173------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f5261f21a3d</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[side-hustle]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Priyanshu Sahu]]></dc:creator>
            <pubDate>Mon, 22 Jun 2026 21:44:10 GMT</pubDate>
            <atom:updated>2026-06-22T21:44:10.262Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*W58H2KozlA_hKuZ3v95K8A.png" /></figure><h4>“Make sure you are not doing one of these”</h4><p>For a while, AI side hustles sounded almost unfairly easy.</p><p>Make faceless YouTube videos. Sell prompt packs. Publish AI-generated ebooks. Launch an AI automation agency. Flip AI art on marketplaces. Build a no-code AI app. Start an AI newsletter. Sell chatbot setup to local businesses.</p><p>The pitch was always the same: the old barriers are gone. You do not need a team. You do not need years of skill. You do not even need an original idea. Just use the tool, move fast, and collect the money.</p><p>Then reality arrived.</p><p><strong>The truth is not that every AI side hustle failed.</strong> Some people are making real money with AI. But the low-effort version of almost every AI side hustle failed. The version that relied on volume, templates, copied ideas, and weak distribution collapsed as soon as platforms, audiences, and competitors caught up.</p><h3>1. Faceless AI YouTube Channels</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sjZ3EmQLj2FABMuu2KQ5aA.png" /></figure><p>This was one of the loudest AI side hustles: generate a script, use an AI voice, add stock footage or AI images, upload daily, and wait for ad revenue.</p><p>It sounded simple because it removed the hardest visible part of YouTube: being on camera. But it did not remove the actual hard parts: taste, retention, originality, research, editing, storytelling, and audience trust.</p><p>Many faceless AI channels failed because they became interchangeable. The same voices, the same pacing, the same historical facts, the same recycled visuals, the same thumbnails, and the same low-effort scripts. Viewers could feel the emptiness even when the video looked technically complete.</p><p>Platforms also became less forgiving. YouTube has clarified that mass-produced, repetitive, inauthentic content has problems under monetization rules, especially when it lacks meaningful originality or transformation.</p><p><strong>Why it failed:</strong> AI made video production easier, but it did not create a real point of view. The channels that survived treated AI as part of a production pipeline, not as a replacement for audience understanding.</p><h3>2. AI-Generated Ebooks</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2AoL6zOkEsfEb44b_neP6w.png" /></figure><p>The ebook hustle was tempting: ask AI to write a short book, create a cover, upload it to Amazon, and earn passive income.</p><p>The problem is that readers do not pay for pages. They pay for trust. A book needs insight, structure, accuracy, editing, positioning, and a reason to exist. AI made it easy to create a file, but not easy to create a book people recommend.</p><p>AI-generated ebook spam became a visible problem. Amazon’s KDP guidelines now require publishers to disclose AI-generated text, images, or translations, and publishers remain responsible for quality and intellectual property compliance.</p><p><strong>Why it failed:</strong> The market was flooded with shallow books. Without expertise, editing, distribution, and credibility, most AI ebooks became digital clutter.</p><h3>3. Prompt Pack Marketplaces</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IgUi8ugYEsuN8aWHFnmPag.png" /></figure><p>In the early AI boom, prompts felt like secret keys. People sold prompt packs for writing, marketing, resumes, coding, Midjourney images, business ideas, and productivity.</p><p>But the value of generic prompts fell quickly. Models improved, users learned basic prompting, and free prompt lists spread everywhere. A prompt pack that once felt useful became easy to recreate in minutes.</p><p>Prompt selling did not completely disappear, but the weak version failed: selling generic prompts with no workflow, no examples, no domain knowledge, and no measurable result.</p><p><strong>Why it failed:</strong> Prompts were not a durable product by themselves. The durable product was expertise packaged into a repeatable workflow.</p><h3>4. AI Art Print Shops</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7n93rPFb5C7BcJw41bPdkQ.png" /></figure><p>Another popular idea was to generate beautiful images, upload them to Etsy or print-on-demand platforms, and sell posters, stickers, shirts, or wall art.</p><p>The problem was supply. AI image tools made it easy for everyone to create similar-looking fantasy art, cyberpunk portraits, motivational posters, coloring pages, and abstract prints. When everyone can generate a product instantly, the product stops being rare.</p><p>Many shops also struggled with quality control: strange hands, inconsistent styles, copyright concerns, weak branding, and designs that looked impressive for one second but forgettable after that.</p><p><strong>Why it failed:</strong> The sellers confused image generation with product-market fit. Art that gets a reaction is not automatically art that sells.</p><h3>5. AI Automation Agencies</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Qjzwyj03xLtxppp9eII-Q.png" /></figure><p>The agency version sounded more serious: help businesses automate emails, customer support, lead generation, onboarding, content, and internal workflows using AI tools.</p><p>This one did not fail because the need was fake. It failed for people who had no consulting skill, no technical understanding, and no ability to diagnose business problems. They sold “AI automation” as a magic phrase instead of solving a specific operational pain.</p><p>Businesses do not buy automation because it sounds futuristic. They buy it when it saves money, saves time, reduces errors, or increases revenue. If you cannot prove that, the pitch falls apart.</p><p><strong>Why it failed:</strong> AI did not remove the need to understand business process. It made shallow agencies easier to start and easier to expose.</p><h3>6. AI Chatbot Setup for Local Businesses</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SVlvQHYc0bYSoGWTPZnlcg.png" /></figure><p>For a while, creators pushed the idea that every restaurant, dentist, gym, salon, and real estate agent needed an AI chatbot.</p><p>Some businesses do need better customer support and lead handling. But many did not need a chatbot first. They needed a better website, clearer offers, faster replies, accurate business information, appointment reminders, or a human who actually follows up.</p><p>The weak version of this hustle failed because it sold technology before diagnosing the problem.</p><p><strong>Why it failed:</strong> Local businesses do not care that something uses AI. They care whether it brings customers, reduces missed calls, or saves staff time.</p><h3>7. AI Newsletters and Content Farms</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lEjVoSYq3TU4PEKOF9wIjg.png" /></figure><p>AI newsletters looked easy: summarize trending AI news, add a few tool links, send daily, monetize with ads or affiliates.</p><p>Then inboxes filled with nearly identical newsletters. Same stories, same summaries, same tool lists, same urgency. Readers unsubscribed because the content did not help them think. It only repeated what they had already seen on social media.</p><p><strong>Why it failed:</strong> Curation without judgment is just forwarding. The newsletters that lasted had a clear audience, a distinct voice, and useful interpretation.</p><h3>8. No-Code AI Apps</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iSKFKGTsXtQX-d5H3ww--Q.png" /></figure><p>No-code AI app builders made it easier to launch wrappers around large language models: resume generators, caption writers, business name generators, cover letter tools, chatbots, and tiny productivity apps.</p><p>Many failed because they had no moat. If the app was just a thin interface over a model, users could often get the same answer directly from ChatGPT, Claude, Gemini, or another general-purpose tool.</p><p><strong>Why it failed:</strong> A wrapper is not a business unless it owns distribution, data, workflow, user experience, or a niche problem that general tools do not solve well.</p><p>The AI did not fail. The shortcut failed.</p><h3>The Pattern Behind All These Failures</h3><p>Every failed AI side hustle had a similar weakness: it treated output as value.</p><p>But output is cheap now. Text is cheap. Images are cheap. Videos are getting cheaper. Code is cheaper. Ideas are cheaper. The thing that is still valuable is judgment.</p><h4>1. No distribution</h4><p>People made products before knowing how to reach buyers, readers, viewers, or clients.</p><h4>2. No differentiation</h4><p>Most offers looked identical because everyone used the same prompts and copied the same examples.</p><h4>3. No trust</h4><p>AI can generate content, but trust comes from proof, taste, experience, consistency, and reputation.</p><h4>4. No real problem</h4><p>Many side hustles sold what AI could make, not what customers actually needed.</p><h3>What Still Works</h3><p>AI side hustles are not dead. The lazy ones are. The opportunities that still work usually have three things in common:</p><p><strong>Skill : </strong>The creator knows the domain well enough to judge and improve the AI’s output.</p><p><strong>Specificity : </strong>The offer solves a narrow problem for a clear audience, instead of trying to serve everyone.</p><p><strong>Distribution : </strong>The creator has a way to reach people consistently through content, community, search, partnerships, or sales.</p><p>The better version of an AI side hustle is not “use AI to make more stuff.” It is “use AI to deliver a better result faster than before.”</p><h3>Final Takeaway</h3><p>The AI side hustle boom failed for many people because they misunderstood what AI changed.</p><p>AI reduced the cost of production. It did not remove the need for taste. It did not create demand. It did not build trust. It did not pick the right niche. It did not make customers care.</p><p>That is the real lesson. In a world where everyone can generate content, products, and code, the advantage moves to people who can decide what is worth making, who it is for, and why it matters.</p><p>The future belongs less to people who can press “generate” and more to people who know what to do after the generation is finished.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f5261f21a3d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 5 Websites Every Frontend Developer Must Know (2026)]]></title>
            <link>https://medium.com/@sahupriyanshu2006/top-5-websites-every-frontend-developer-must-know-2026-f5549f03cf05?source=rss-57d1c33b5173------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5549f03cf05</guid>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Priyanshu Sahu]]></dc:creator>
            <pubDate>Sun, 14 Jun 2026 20:32:47 GMT</pubDate>
            <atom:updated>2026-06-14T20:32:47.222Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*lWuE7tXwX5-OsHD9nHJd4g.png" /></figure><p><em>A few months ago I was building a portfolio site and I spent close to four hours trying to get a single button hover effect to look right. Four hours, on one button. That same week a friend sent me a link and what took me four hours took him about four minutes. That link was the first of five websites that completely changed how I build UI.</em></p><p>I am not talking about huge frameworks or anything that needs a course to learn. These are just websites you open in a tab, find what you need, copy it, and move on with your day. Once you know they exist, you genuinely cannot unsee how much time you used to waste.</p><p>Here are the five that live permanently in my browser bookmarks bar now.</p><h4><strong>1. Animista</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*06J0cDVcYMepKPVZw8l4HQ.png" /></figure><p>Pure CSS animations</p><p>This is the one my friend sent me, and it is still the one I use the most. Animista is basically a big visual playground of CSS animations. You pick a category, things like entrance, exit, hover, background, text, and each one has a working preview right there on the page.</p><p>You drag sliders to change the duration, delay, direction, and timing function, watch the preview update live, and when it looks right you hit a button and it gives you the exact CSS class to copy into your project. No JavaScript, no library, nothing to install.</p><p>I use this constantly for the small stuff. A card that fades and slides up when it loads. A button that gently pulses. An icon that wiggles on hover. These tiny details are the ones that make a site feel polished, and they used to be the exact things I would spend way too long hand writing keyframes for.</p><pre>/* example output from animista: fade in + slide up */<br>.fade-in-up {<br>  animation: fade-in-up 0.6s ease-out both;<br>}</pre><pre>@keyframes fade-in-up {<br>  from {<br>    opacity: 0;<br>    transform: translateY(20px);<br>  }<br>  to {<br>    opacity: 1;<br>    transform: translateY(0);<br>  }<br>}</pre><blockquote>When I reach for this</blockquote><blockquote>Whenever I think “this element feels a bit flat” but I do not want to bring in an animation library for one small effect. Two minutes on Animista and it is sorted.</blockquote><h4>2. <strong>CodePen</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lmVZrmaSGFh4mXHIFU1VaA.png" /></figure><p>Inspiration and live demos</p><p>CodePen is the place I go when I genuinely have no idea what I want yet. It is a massive community of frontend developers sharing live, working demos of basically anything you can think of. Buttons, navbars, loaders, full landing pages, weird little CSS experiments, all of it, all running live in the browser so you can see the code and the result side by side.</p><p>The way I use it is simple. I type something like “glassmorphism navbar” or “animated pricing card” into the search bar and just scroll. Within a few minutes I usually find three or four examples that are close to what I had in my head, sometimes better than what I had in my head.</p><p>What makes it genuinely useful and not just a time sink is that every pen is editable. You can fork it, change the colors, change the text, break it on purpose to understand how it works, and then take only the part you need back into your own project.</p><blockquote>When I reach for this</blockquote><blockquote>Early in a project, when I am still figuring out the look and feel and need to see real working examples instead of just imagining things.</blockquote><h4>3. <strong>Uiverse.io</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HOoE7OnFYJ-X_Xnf0Gy9_Q.png" /></figure><p>Free copy paste components</p><p>Uiverse is a community library of free, open source UI elements. Buttons, checkboxes, toggles, loaders, cards, inputs, all built by other developers and shared for anyone to use. Everything is either plain CSS or Tailwind, and every single element has a copy button right there.</p><p>The cards section specifically is where I spend most of my time. There is something about a well designed card component, the right shadow, the right hover lift, the right border radius, that is genuinely hard to get right from scratch, and Uiverse has hundreds of variations already done.</p><p>The part I appreciate most is that these are the small, annoying components nobody wants to design themselves. A nice toggle switch. A loading spinner that does not look like every other loading spinner. A checkbox with a satisfying little animation when you click it. Things that take five minutes to find here and would take an hour to design yourself.</p><blockquote>When I reach for this</blockquote><blockquote>For the small interactive elements, the kind of thing that is everywhere in a UI but nobody ever wants to spend real time designing.</blockquote><h4><strong>4. React Bits</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p78XMDNjSTsF2ACA7Qf-iA.png" /></figure><p>Animated React components</p><p>React Bits is built specifically for React developers and it leans into more involved animated components. Text effects like a blur in or a gradient sweep, scroll triggered animations, animated backgrounds, that kind of thing. You pick a component, see it animate live, then copy the code in either JavaScript or TypeScript, with CSS or Tailwind depending on your setup.</p><p>What surprised me is how fast this one grew. It became one of the fastest growing component libraries in the React ecosystem during 2025, ranking second overall in that year’s JS Rising Stars list, ahead of shadcn/ui. And unlike a lot of similar libraries, it does not force Framer Motion on you. Different components pull in CSS animations, GSAP, or Three.js depending on what the effect actually needs, so you are not adding a huge dependency just to get one text animation.</p><p>I mostly use this for the kind of section that needs to feel a bit more alive than a static layout. A hero heading that animates in letter by letter. A background with floating particles. Stuff that would take real effort to build and tune from scratch.</p><blockquote>When I reach for this</blockquote><blockquote>When a section needs a more involved animation, especially text effects or animated backgrounds, and I want React code I can drop straight in.</blockquote><h4><strong>5. Aceternity UI</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kN6o9OBUHy0z8mK7IzpMHA.png" /></figure><p>Premium landing page blocks</p><p>Aceternity is the one I go to when I want something to look genuinely premium, the kind of polish you usually see on funded startup landing pages. It is built around React, Next.js, Tailwind CSS, and Framer Motion, with over 200 free copy paste components, blocks, and templates.</p><p>The components here are bigger and more opinionated than the other sites on this list. Full hero sections, animated bento grids, card stacks that fan out on hover, navigation bars with smooth blur effects on scroll. It is used widely enough that teams at companies like Google, Microsoft, Cisco, and Zomato have reportedly used components from it, which says a lot about how production ready these actually are.</p><p>The honest reason I love it is that it makes my side projects look like they had a design team behind them. I am one person building something on a weekend, and Aceternity components make that weekend project look like it has a budget.</p><blockquote>When I reach for this</blockquote><blockquote>For landing pages, portfolios, anything where first impressions matter and I want it to look expensive without actually spending a long time on it.</blockquote><h3>How These Five Actually Fit Together</h3><p>I do not use all five every time. They each solve a different stage of building something, and once I figured out where each one fits, my whole process got a lot smoother.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*lNCRQSZyYXUDs9BfskUdgA.png" /></figure><p>In practice a single page usually pulls from two or three of these. A landing page might start with an Aceternity hero section, get a React Bits animated heading, and have a couple of Uiverse buttons scattered through it. Nobody looking at the final result can tell, and honestly, that is the point.</p><p><strong><em>“You are not less of a developer for using these. You are a developer who values their time.”</em></strong></p><h3>The Thing I Had to Get Over</h3><p>For a while I felt like using these sites was somehow cheating. Like a real developer should be writing every animation and every component from scratch, otherwise what are you even doing.</p><p>That feeling did not survive contact with an actual deadline. Nobody who uses your site cares whether you hand wrote the keyframes for a fade in animation. They care whether the site feels good to use and looks like someone cared about it. These five sites let you spend your actual effort on the things that matter, the logic, the structure, the parts that are genuinely yours, while not burning hours on a hover effect that fifty other developers have already solved better than you would in your first attempt.</p><p>The skill is not refusing to use these. The skill is knowing your project well enough to pick the right piece from the right site and make it feel like it was always meant to be there.</p><p>If you only bookmark one from this list today, make it Animista if you are just starting out, or Aceternity if you are building something you want to show off. Either way, the four hours I spent on that one button are still the most useful four hours I wasted, because they sent me looking for a better way, and I found five of them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5549f03cf05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Gave Codex 20 Real Coding Tasks. Here is Where It Helped and Where It Failed.]]></title>
            <link>https://medium.com/@sahupriyanshu2006/i-gave-codex-20-real-coding-tasks-here-is-where-it-helped-and-where-it-failed-bd37ba01d653?source=rss-57d1c33b5173------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd37ba01d653</guid>
            <category><![CDATA[anthropics]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[Priyanshu Sahu]]></dc:creator>
            <pubDate>Wed, 10 Jun 2026 20:32:46 GMT</pubDate>
            <atom:updated>2026-06-10T20:32:46.162Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*q2gAKygfDuo2WGyLg9CDYQ.png" /></figure><p>Most AI coding articles sound too clean. They show one prompt, one impressive answer, and one polished result. Real development does not work like that.</p><p>Real development is messier. You jump between files. You misunderstand requirements. Tests fail for boring reasons. You fix one bug and accidentally notice another. Sometimes the hard part is not writing code, but deciding what code should exist at all.</p><p>So I tried a more practical experiment: I gave Codex 20 real coding tasks in one day and judged it like I would judge any coding assistant. Did it save time? Did it understand the codebase? Did it introduce risk? Did I trust the result after reading the diff?</p><p>The short answer: Codex helped a lot, but not everywhere. It was strongest when the task was narrow, testable, and well explained. It was weakest when I asked it to make broad product or architecture decisions without enough context.</p><blockquote><strong><em>11 tasks where Codex clearly saved time</em></strong></blockquote><blockquote><strong><em>6 tasks where it helped, but needed edits</em></strong></blockquote><blockquote><strong><em>3 tasks where the first answer was not useful</em></strong></blockquote><h3>The Setup</h3><p>I used Codex across the kinds of tasks developers actually face during a normal day. I did not ask it to build an entire app from scratch. I gave it small pieces of work and reviewed the output carefully.</p><p>The 20 tasks fell into four groups:</p><ul><li><strong>Boilerplate:</strong> create predictable code that follows an existing pattern.</li><li><strong>Bug fixes:</strong> investigate an error and propose a small change.</li><li><strong>Refactors:</strong> clean up repeated logic without changing behavior.</li><li><strong>Docs and tests:</strong> explain code, add test cases, and summarize changes.</li></ul><p>The useful pattern was not one huge prompt. It was many small, reviewable tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*gDEc9dnPxKlXp-sFkSzG8A.png" /></figure><h3>Where Codex Helped</h3><h4>1. It removed blank-page friction</h4><p>Codex was excellent when I knew what I wanted but did not want to manually type the first version. Test files, validation helpers, small utility functions, documentation sections, and repeatable component patterns were all good fits.</p><p>This was not glamorous work, but it mattered. A lot of development time disappears into small transitions: opening the right file, remembering the pattern, writing the first rough version, and then cleaning it up. Codex made those transitions faster.</p><h4>2. It was useful for reading unfamiliar code</h4><p>One of the best uses was not generating code at all. It was asking Codex to explain a file before I touched it. A good explanation helped me understand the flow, identify risky areas, and decide where a change should go.</p><p>I still had to verify the explanation, but it gave me a map before I started walking through the code myself.</p><h4>3. It made test writing easier</h4><p>Codex was especially helpful for tests because tests have a clear structure. When I gave it the function, the expected behavior, and the edge cases, it usually produced a strong starting point.</p><p>The biggest benefit was coverage thinking. Codex often suggested failure cases I might have postponed, such as empty input, invalid data, duplicate values, or permission errors.</p><h4>4. It improved code review habits</h4><p>After a change, I asked Codex to summarize the diff and list possible risks. That simple step made the workflow feel more disciplined. Instead of accepting code because it looked right, I had another pass focused on assumptions, missing tests, and side effects.</p><p>The strongest workflow paired code generation with diff review and test verification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aJMksqrOdeMKVlB2edtr1A.png" /></figure><h3>Where Codex Failed</h3><h4>1. It punished vague prompts</h4><p>When I asked vague questions, Codex guessed. Sometimes the guess was reasonable. Sometimes it was wrong in a way that looked convincing.</p><p>For example, “fix this validation issue” was too open. Codex needed to know the expected behavior, where the validation should live, what UI pattern to preserve, and which tests should pass. Without that, it filled in the blanks itself.</p><h4>2. It sometimes solved the local problem but missed the system</h4><p>A few answers worked in isolation but did not fit the project. The code ran, but the style was slightly different. Or it introduced a helper that the codebase did not need. Or it fixed the immediate bug while ignoring a nearby pattern that already existed.</p><p>This is where human review mattered most. Codex could generate a solution, but I still had to decide whether the solution belonged in the codebase.</p><h4>3. It was not good at reading my mind</h4><p>This sounds obvious, but it is the mistake developers will make most often. Codex is powerful enough that you start expecting it to infer intent from a weak prompt. That is when quality drops.</p><p>The better approach was to treat Codex like a fast collaborator, not a mind reader. Give it context. Give it constraints. Give it a definition of done.</p><h3>Best tasks for Codex</h3><ul><li>Small scoped bug fixes</li><li>Unit tests and edge cases</li><li>Boilerplate based on existing patterns</li><li>Code explanation and diff summaries</li><li>Mechanical refactors with clear rules</li></ul><h3>Weak tasks for Codex</h3><ul><li>Broad “improve this” requests</li><li>Architecture decisions without context</li><li>Product judgment and priority calls</li><li>Large changes with unclear constraints</li><li>Code that cannot be tested easily</li></ul><h3>The Prompt That Worked Best</h3><p>The best prompt pattern was simple:</p><ol><li><strong>Context:</strong> what file, feature, or bug I am working on.</li><li><strong>Goal:</strong> the exact change I want.</li><li><strong>Constraints:</strong> what should not change.</li><li><strong>Verification:</strong> how the result should be checked.</li></ol><p>For example, this worked well:</p><pre>In the signup form component, add client-side validation for empty email and password fields.<br>Keep the existing layout and styling unchanged.<br>Use the same error message pattern already used in this component.<br>Add or update tests for empty fields and successful input.<br>After editing, explain the diff and mention any edge cases.</pre><p>This worked poorly:</p><pre>Fix signup validation.</pre><p>The first prompt gives Codex a job. The second prompt gives it a mystery.</p><h3>The Real Lesson</h3><p>After 20 tasks, I do not think the best use of Codex is “write my code for me.” That framing is too shallow.</p><p>The better use is this: Codex helps turn development into a faster loop.</p><ul><li>Describe the task.</li><li>Generate a first pass.</li><li>Read the diff.</li><li>Run tests.</li><li>Ask for risks.</li><li>Refine or reject.</li></ul><p>That loop is where Codex becomes useful. Not because it is always right, but because it helps you reach a reviewable state faster.</p><h3><strong>My takeaway</strong></h3><p>Codex made me faster, but only when I managed it well. It helped with repetitive work, tests, explanations, and small changes. It failed when I gave it vague instructions or expected it to understand hidden context. The more specific I was, the better it became. The less specific I was, the more cleanup I created for myself.</p><p>So the real skill is not just learning how to use Codex. The real skill is learning how to break development work into clear, testable, reviewable tasks.</p><p>Codex is not a replacement for developer judgment. It is a multiplier for developers who can define the work clearly and review the result carefully.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd37ba01d653" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vibe Coding is Over! Here’s What Comes Next.]]></title>
            <link>https://medium.com/@sahupriyanshu2006/vibe-coding-is-over-heres-what-comes-next-f718fd438e83?source=rss-57d1c33b5173------2</link>
            <guid isPermaLink="false">https://medium.com/p/f718fd438e83</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <dc:creator><![CDATA[Priyanshu Sahu]]></dc:creator>
            <pubDate>Tue, 19 May 2026 21:15:05 GMT</pubDate>
            <atom:updated>2026-05-19T21:18:32.327Z</atom:updated>
            <content:encoded><![CDATA[<h4>“I Was a Vibe Coder. Here Is What Broke Me Out of It.”</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tervMZbEaXtM3IIGWZT4AQ.png" /></figure><blockquote>Six months ago, I thought I had finally cracked it. AI writes the code, I ship the product. Fast, clean, effortless. I felt like the smartest person in the room. Then my team lead asked me one simple question about a feature I had built, and I had absolutely nothing to say.</blockquote><h3>How It Started</h3><p>When ChatGPT blew up, I was maybe eight months into learning web development. I was struggling with JavaScript, barely understanding async/await, constantly googling the same things over and over. Then suddenly there was this tool that could just… write it for me.</p><p>I remember the first time I asked it to build a full login system. It gave me auth middleware, JWT handling, password hashing, the whole thing. I copy-pasted it into my project. It worked on the first try. I felt like a god.</p><p>That was the beginning of a very bad habit.</p><h3>What “Vibe Coding” Actually Looks Like</h3><p>If you’ve used AI tools to write code, you’ve probably vibe coded at least a little. Most of us have. The pattern is seductive because it works — until it doesn’t.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*KfQk1Bnq6V-o56rpSauOKw.png" /></figure><p>The trap isn’t that you used AI. The trap is that you skipped the step where you <em>understand what was built</em>. That missing step compounds. Every new feature added to code you don’t understand makes the next feature harder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dcMHy8dwKdUuUZatb49zqA.png" /></figure><h3>Why It’s Breaking Down</h3><p>Vibe coding has three failure modes that developers hit in sequence, usually in this order: <strong>the debugging wall, the maintenance trap, and the credibility problem</strong>. All three flow from the same root cause: building on a foundation you don’t understand.</p><p>When AI-generated code breaks, you have two options: understand it and fix it, or prompt your way out. Prompting your way out works maybe 60% of the time. The other 40%, you’re stuck, because you can’t explain the problem clearly enough for the AI to solve it. You don’t know the problem. You just know <em>something’s wrong</em>.</p><p>Code you don’t understand is code you can’t safely change. Adding a new feature to a codebase you vibe-coded six months ago feels like defusing a bomb blindfolded. And if you’re working professionally, someone will eventually ask you to explain a decision. “The AI did it” is not an answer that builds trust.</p><h3>So What Comes Next?</h3><p>The developers thriving right now aren’t the ones who learned to prompt the hardest. They’re the ones who figured out a better collaboration model — one where AI is a powerful tool in skilled hands, not a replacement for skill itself.</p><p>Call it intentional AI development. The developers who are winning right now don’t write less code, they write code they actually understand. AI does the heavy lifting on the typing. The human does the thinking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*AbWTQshYwgnjzIWp-Jmqlg.png" /></figure><h3>Practical: How to Prompt Better Starting Today</h3><p>The biggest single upgrade you can make right now is learning to write more specific prompts. Here’s the difference:</p><pre>// Vibe coding prompt (vague → low quality output)<br>&quot;Write me a login function&quot;<br><br>// Intentional prompt (specific → high quality output)<br>&quot;Write a login function in Node.js/Express that:<br>- Accepts email and password in the request body<br>- Validates that both fields are non-empty strings<br>- Queries a PostgreSQL users table using parameterized queries<br>- Compares the password using bcrypt.compare()<br>- Returns a signed JWT on success (expiry: 24h)<br>- Returns a 401 with a generic message on failure<br>- Does NOT return the password hash in any response&quot;</pre><p>The second prompt takes 45 extra seconds to write but the output quality difference is enormous and you’ll spend far less time fixing things afterward.</p><blockquote>Before using any AI-generated function in production, explain it to an imaginary colleague. If you stumble, ask the AI: “Can you explain what this function does line by line?” You’ll often discover assumptions you didn’t know were there.</blockquote><h3>The Real Opportunity</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7E3c5pzZa8buUvg5bxQPmQ.png" /></figure><p>Developers who combine genuine understanding with skillful AI use are going to be <em>extraordinarily</em> productive. Not 10% more. Possibly 5–10x on certain tasks. The ceiling has been raised dramatically.</p><p><strong><em>The question to ask yourself right now isn’t “am I using AI enough?” It’s “do I understand everything I’ve shipped this week?” If the answer is no, that’s where to start.</em></strong></p><p>Vibe coding was a phase — a first contact with what’s possible when AI enters the development loop. The developers who figure out intentional AI collaboration first are going to have a very good few years.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f718fd438e83" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build Apps That Feel Native But Are Secretly Web]]></title>
            <link>https://medium.com/@sahupriyanshu2006/how-to-build-apps-that-feel-native-but-are-secretly-web-66cc5bede6d6?source=rss-57d1c33b5173------2</link>
            <guid isPermaLink="false">https://medium.com/p/66cc5bede6d6</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[website]]></category>
            <dc:creator><![CDATA[Priyanshu Sahu]]></dc:creator>
            <pubDate>Thu, 14 May 2026 18:13:09 GMT</pubDate>
            <atom:updated>2026-05-14T18:13:47.454Z</atom:updated>
            <content:encoded><![CDATA[<h4>“The trick millions of apps use” and how you can too, starting today.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*T26gwdrp6Fm_JIQVlceWwg.png" /></figure><blockquote>Spotify, VS Code, WhatsApp, Discord etc. are apps you use every day — they sit in your dock, they open instantly, they feel completely native. They&#39;re also, quietly, built with the same HTML, CSS, and JavaScript as a website.</blockquote><p>This is one of the best-kept secrets in software development: you don&#39;t need to learn Swift, Kotlin, or C++ to ship a polished, installable app. If you can build a webpage, you can build an app.</p><p>In this article, we&#39;ll break down exactly how this works, walk through your options, and give you the knowledge to start building your own native-feeling web app — no magic required.</p><h3>Wait! How Is That Even Possible?</h3><p>Every modern operating system — Windows, macOS, iOS, Android — ships with a built-in browser engine. Think of it as a tiny web browser that apps can borrow. When developers want to ship a “native app” using web technologies, they simply wrap their website inside this engine and give it a native shell.</p><p>From the user’s perspective, it looks and behaves like any other app. From the developer’s perspective, it’s just a webpage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*kzwZyp6aEaC_w96EjnOsng.png" /></figure><p>The browser engine does all the heavy lifting — parsing HTML, applying CSS, running JavaScript — just like it does on a website. The native shell is what gives it an app icon, a window frame, access to system features like notifications, and a spot in the app store.</p><h3>Two Main Paths</h3><p>There are two broad strategies for building native-feeling web apps. Which one you pick depends on your goal — let’s understand both before diving into the details.</p><h4>Path 1: Progressive Web Apps (PWAs)</h4><p>A Progressive Web App is a website that browsers can install on a user’s device. Once installed, it gets its own icon, can work offline, can send push notifications, and launches without a browser bar — just like a real app.</p><p>The magic ingredient is something called a Service Worker. It’s a small JavaScript file that runs in the background, intercepting network requests and caching files so your app loads instantly — even without internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*UUqaMmtm0xqx0ofFArXvfw.png" /></figure><h4>Path 2: WebView Apps (Electron, Capacitor &amp; Tauri)</h4><p>PWAs are great, but they have limits — iOS restricts what they can do, and some users simply expect to download an app. WebView apps solve this by bundling a browser engine directly into a distributable app package.</p><p>Here’s what the architecture looks like under the hood:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*cGTDM9-VqDGkNrmcASEDUg.png" /></figure><p>The JS Bridge is the key — it lets your web code call native functions. Want to access the camera? Your JS calls a bridge function, the native code opens the camera, and the result comes back to JavaScript. From your perspective as a developer, it looks like a regular function call.</p><h3>Choosing the Right Approach</h3><p>Not sure which path to take? This decision tree will help you narrow it down:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*kZgm_j08sRC-Hxnl1OBFJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*puiL_nFRHzSo89gEJRJu5w.png" /></figure><h3>Wrapping Up</h3><p>The line between “web” and “native” has never been thinner. Spotify, Linear, Notion, VS Code — these apps prove every day that web technologies can deliver experiences that feel indistinguishable from platform-native code.</p><p>The process is simpler than it looks: your HTML/CSS/JS runs inside a browser engine, which lives inside a native shell, which appears on a user’s home screen. Add a service worker for offline support, follow a handful of CSS best practices for that native feel, and pick the right wrapper for your target platform.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66cc5bede6d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Network Programming 1.3 | Low-Level Nonsense — How Networks Really Work]]></title>
            <link>https://medium.com/@sahupriyanshu2006/network-programming-1-3-low-level-nonsense-how-networks-really-work-d8dcc479c6be?source=rss-57d1c33b5173------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8dcc479c6be</guid>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[ip]]></category>
            <dc:creator><![CDATA[Priyanshu Sahu]]></dc:creator>
            <pubDate>Wed, 11 Mar 2026 14:16:02 GMT</pubDate>
            <atom:updated>2026-03-11T14:16:02.803Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s dive into data encapsulation, the OSI model, and why you should be grateful you don’t have to build packets by hand.</p><h3>Data Encapsulation: The Gift wrap of Networking</h3><p>Imagine you’re sending a birthday present to a friend in another country. You don’t just hand the bare gift to a postal worker. Here’s what actually happens:</p><ol><li>You put the gift in a box (your data)</li><li>You wrap the box in festive paper (your application header, like TFTP)</li><li>You put that wrapped box into a shipping box with your friend’s address (the UDP header)</li><li>The shipping company puts your box into a larger container with other boxes (the IP header)</li><li>That container goes onto a truck or plane (the Ethernet header)</li><li>The truck drives to the airport (the physical layer)</li></ol><p>By the time your gift arrives, the reverse happens:</p><ol><li>The truck unloads the container</li><li>Someone removes your box from the container</li><li>The shipping label confirms it’s for your friend</li><li>Your friend opens the shipping box</li><li>They remove the festive wrapping paper</li><li>They open the gift box</li><li>Finally, they see the actual gift</li></ol><p>This is exactly how network data travels across the internet.</p><p>When your program sends a message, it gets wrapped in multiple layers of headers — each added by a different protocol. The receiving computer unwraps these layers in reverse order until it reaches your original data.</p><h3><strong>Here’s what that looks like in practice:</strong></h3><blockquote>[ Your Data ]<br> ↓<br>[ TFTP Header | Your Data ] (Added by your TFTP program)<br> ↓<br>[ UDP Header | TFTP Header | Your Data ] (Added by the kernel)<br> ↓<br>[ IP Header | UDP Header | TFTP Header | Your Data ] (Added by the kernel)<br> ↓<br>[ Ethernet Header | IP Header | UDP Header | TFTP Header | Your Data | Ethernet Footer ] (Added by hardware)</blockquote><p>Each layer only understands its own header. The IP layer doesn’t care what’s inside the UDP header. The UDP layer doesn’t care what’s inside the TFTP header. Each just does its job and passes the rest along.</p><h3>The Unix Model: Four Layers of Practical Reality</h3><p>For actual Unix programmers, a simpler 4-layer model is more useful. It maps directly to how we write code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a4ImAc86ue0tF6FBQaNhLQ.png" /></figure><p>See how this aligns with the encapsulation process?</p><ul><li>Your code lives at the Application Layer</li><li>The kernel handles Transport (TCP/UDP) and Internet (IP)</li><li>The hardware handles Network Access (Ethernet, Wi-Fi)</li></ul><h3>The Best News: You Don’t Build Packets by Hand</h3><blockquote><em>“See how much work there is in building a simple packet? Jeez! And you have to type in the packet headers yourself using </em><em>cat! Just kidding.&quot;</em></blockquote><p>Imagine if every time you wanted to send data over the network, you had to manually construct the Ethernet header, the IP header, the TCP header, and then your actual data — all as raw bytes. One wrong bit and nothing works.</p><p>Thankfully, the operating system does almost all of this for you.</p><ul><li>For stream sockets, you just call send() with your data. The kernel builds the TCP and IP headers automatically. The hardware adds the Ethernet header.</li><li>For datagram sockets, you just call sendto() with your data. The kernel builds the UDP and IP headers. The hardware adds the Ethernet header.</li></ul><p>The only headers you might need to add yourself are application-level headers. For example, if you’re implementing TFTP on top of UDP, you need to add a TFTP header so the receiving program knows what to do with your data. But the lower-level headers? Handled for you.</p><h3>What About Routing?</h3><blockquote><em>“The router strips the packet to the IP header, consults its routing table, blah blah blah. Check out the IP RFC if you really really care. If you never learn about it, well, you’ll live.”</em></blockquote><p>Routers are magical boxes that exist somewhere in the cloud. They look at the destination IP address, consult their tables, and forward your packet toward its destination. How they do that is fascinating, but you can write perfectly good network code without knowing the details.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8dcc479c6be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Network Programming 1.2 | TCP vs. UDP — The Battle of Reliability vs. Speed]]></title>
            <link>https://medium.com/@sahupriyanshu2006/network-programming-1-2-tcp-vs-udp-the-battle-of-reliability-vs-speed-07f1b2dac7f8?source=rss-57d1c33b5173------2</link>
            <guid isPermaLink="false">https://medium.com/p/07f1b2dac7f8</guid>
            <category><![CDATA[ip]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[internet]]></category>
            <dc:creator><![CDATA[Priyanshu Sahu]]></dc:creator>
            <pubDate>Sat, 07 Mar 2026 21:52:06 GMT</pubDate>
            <atom:updated>2026-03-22T13:04:20.278Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Magic Behind Stream Sockets: TCP</h3><p>Stream sockets (SOCK_STREAM) achieve their near-perfect reliability through a protocol called TCP (<strong>Transmission Control Protocol</strong>). Think of TCP as the world&#39;s most obsessive mail carrier.</p><p>Here’s what TCP does behind the scenes:</p><p>1. It numbers everything. Before sending data, TCP breaks it into chunks and assigns sequence numbers. Packet #1, Packet #2, Packet #3, and so on.</p><p>2. It waits for receipts. After sending Packet #1, TCP expects the recipient to send back a tiny message saying “Got #1!” (This is called an ACK — short for acknowledgment.)</p><p>3. It re-sends lost items. If TCP doesn’t get that receipt within a certain time, it assumes Packet #1 got lost and sends it again. And again. Until it gets that ACK.</p><p>4. It reassembles in order. On the receiving end, TCP collects all the packets and puts them back in the correct order before handing the data to your application. If Packet #3 arrives before Packet #2, TCP holds onto #3 until #2 shows up.</p><p>5. It checks for damage. Every packet includes a mathematical checksum. If the receiving TCP calculates a different number, it knows the packet was corrupted and throws it away, asking for a fresh copy.</p><p>This is why stream sockets feel like a phone conversation. Everything flows smoothly, in order, without gaps or errors.</p><h3>The Other Half: IP (Internet Protocol)</h3><p>You’ve probably heard the term TCP/IP thrown around. If TCP is the obsessive mail carrier, IP (Internet Protocol) is the global postal routing system.</p><p><strong>IP’s job is simple: figure out how to get a packet from point A to point B. Which trucks? Which roads? Which planes? Which undersea cables? IP handles the navigation.</strong></p><p>But here’s the key: IP doesn’t care about quality. It doesn’t check if packets arrive. It doesn’t re-send lost items. It doesn’t put things in order. IP just routes and hopes for the best.</p><p>So in the TCP/IP pair:</p><ul><li>IP = The navigation system (gets it there somehow)</li><li>TCP = The quality control (makes sure it arrives correctly)</li></ul><h3>The Wild West of UDP</h3><p>Now let’s look at the other side: datagram sockets (SOCK_DGRAM). These use a completely different protocol called UDP (User Datagram Protocol).</p><p>If TCP is an obsessive mail carrier, UDP is a kid with a slingshot shooting paper airplanes.</p><p>Here’s how UDP works:</p><ul><li>You write a message.</li><li>You fold it into a paper airplane.</li><li>You launch it in the general direction of your target.</li><li>You immediately move on to the next airplane, without waiting to see if the first one arrived.</li></ul><p>That’s it. No numbers. No receipts. No re-sending. No reassembly.</p><p>The consequences: Packets can:</p><ul><li>Get lost entirely (the airplane hits a tree)</li><li>Arrive out of order (airplane #5 lands before airplane #2)</li><li>Arrive multiple times (someone found airplane #2 and threw it again)</li><li>Never arrive at all (it landed in a river)</li></ul><p>This is why UDP sockets are “connectionless.” You don’t need to establish a connection first. You don’t need to maintain anything. You just build a packet, slap a destination address on it, and fire it into the void.</p><h3>The Obvious Question: Why Would Anyone Use UDP?</h3><p>If UDP is so unreliable, why does it exist? Why would any sane programmer choose it? There are 2 reasons behind this : Speed and Speed 😂. TCP is like having a conversation where every sentence must be acknowledged. UDP is like screaming into the wind and hoping someone hears you.</p><p>This speed matters for certain applications:</p><ul><li>Online gaming: A first-person shooter might send 40 updates per second about player positions. If one update gets lost, the game can guess where you moved. But if TCP stopped to re-send that lost packet, everything would freeze — that’s LAG. Gamers have a technical term for this effect: “accursed lag,” usually followed by profanity.</li><li>Video streaming: A Zoom call can lose a few frames and you’ll barely notice. But if it stopped to re-send every lost packet, the call would stutter constantly.</li><li>Voice chat: Same principle. A tiny glitch in audio is annoying but acceptable. A long pause while the system waits for re-transmission is unbearable.</li><li>DNS lookups: When your browser needs to find a website’s address, it sends a tiny UDP packet asking for directions. If that packet gets lost, your browser just asks again after a second. Speed matters more than guaranteed delivery.</li></ul><h3>The Dark Magic: Reliable UDP</h3><p>At this point, a smart reader might object:</p><blockquote><em>“Wait a minute! I mentioned </em><em>tftp (Trivial File Transfer Protocol) and </em><em>dhcpcd (a DHCP client) use UDP. But these transfer files and network. Yes In deed! You can&#39;t lose data in a file transfer! What kind of dark magic is this?&quot;</em></blockquote><p>Excellent question. Here’s the secret: They build reliability on top of UDP themselves.</p><p>Think of it this way: TCP gives you reliability built-in, like a car with airbags and seatbelts included. UDP gives you a go-kart with no safety features — but you can bolt on your own airbags if you want.</p><p>How TFTP <strong><em>(Trivial File Transfer Protocol)</em></strong><em> </em>does it:</p><ol><li>The sender sends UDP packet #1 containing file chunk #1</li><li>The receiver, upon receiving it, sends back a UDP packet saying “Got #1!” (this is an ACK)</li><li>If the sender doesn’t get that ACK within 5 seconds, it sends packet #1 again</li><li>Only after receiving the ACK does the sender move on to packet #2</li></ol><p><strong>This is exactly what TCP does, but implemented at the <em>application level</em> rather than inside the operating system. It’s slower than raw UDP, but gives developers more control.</strong></p><p>Why do this instead of just using TCP? Sometimes you want the speed of UDP for most things but need reliability for certain critical messages. Building your own reliability layer gives you fine-grained control that TCP doesn’t offer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07f1b2dac7f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Network Programming 1.1 | What is a Socket, Really? (The Unix Secret)]]></title>
            <link>https://medium.com/@sahupriyanshu2006/network-programming-1-1-1-what-is-a-socket-really-the-unix-secret-6d93c80ccd60?source=rss-57d1c33b5173------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d93c80ccd60</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[ip]]></category>
            <dc:creator><![CDATA[Priyanshu Sahu]]></dc:creator>
            <pubDate>Fri, 06 Mar 2026 18:09:30 GMT</pubDate>
            <atom:updated>2026-03-06T21:04:20.220Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re starting to learn about network programming, you’ll trip over the word “socket” approximately one million times. Guides will talk about “creating a socket,” “binding a socket,” and “listening on a socket.” It’s easy to get lost in the jargon.</p><p>So, let’s hit the brakes and answer the most basic question: What even is it? A socket is a way to speak to other programs using standard Unix file descriptors. If your brain just said, “Huh?” don’t worry, let’s unpack that sentence because it holds the key to everything.</p><h3>The Golden Rule: Everything is a File</h3><p>Imagine you’re in a massive office building. This is your computer’s operating system (Unix, Linux, macOS). Now, there’s a strange but powerful rule in this building: Every conversation happens the same way.</p><p>Whether you’re:</p><ul><li>Typing on your keyboard</li><li>Writing text to your screen</li><li>Saving a document to your hard drive</li><li>Reading a file from a USB stick</li></ul><p>everything is treated as a file and can be controlled using a pass, that pass is called a file descriptor.</p><h3>So What’s a “file descriptor”?</h3><p>Think of it as a numbered ticket or a library card. When a program wants to access one of these “files” (like your keyboard), the operating system gives it a ticket.</p><ul><li>The number on the ticket might be 0 for the keyboard.</li><li>It might be 1 for the screen.</li><li>It might be 42 for a specific document you opened.<br>The program doesn&#39;t need to know the complex details of <em>how</em> to talk to the screen. It just shows its ticket (the number) and says, &quot;Write this message to the thing associated with this ticket.&quot;</li></ul><p>Now, what if you want to talk to someone in the office building across town (another computer on the internet)? You can’t just shout out the window. You need a dedicated communication line.</p><blockquote><strong>This is your socket : A socket is simply a special kind of pass — a file descriptor — that is specifically for internet communication. It’s your program’s direct line to the outside world.</strong></blockquote><h3>How Do You Get One?</h3><p>You can’t just invent this pass yourself. You have to go to the building’s management (the operating system) and ask for it. In the C programming language, you do this with a function literally called socket(). You call it, the OS does some magic behind the scenes to prepare a communication line, and then it hands you back a shiny new number. That number is your socket descriptor. Now you have a pass that’s linked not to a file on your disk, but to a connection with another program on the internet.</p><h3>So, Can I Use It Like a Normal File?</h3><p>Since a socket is just another type of “file” in the system’s eyes, you technically <em>could</em> use the normal, everyday commands for reading and writing files on your new network connection. And it would sort of work.</p><p>But here’s the thing: talking over the internet is way more complicated than reading a document on your hard drive. Data can get lost, show up in the wrong order, or arrive broken.</p><p>That’s why, alongside the regular file commands, there are special ones built just for sockets. Commands like send() (to push your data out) and recv() (to receive data coming in) give you much more control. They are the heavy-duty tools designed for the wild world of networking.</p><h3>Two Types of Internet Sockets (And Why You Already Use Both)</h3><p>We have discovered that a socket is really just a special file descriptor — a passport to the internet that lets programs talk to each other. But here’s the thing: not all passports are the same. Some are for business trips where everything must be perfect. Others are for quick visits where speed matters more than precision.</p><h3>Stream Sockets (SOCK_STREAM)</h3><p>Imagine you’re negotiating a business deal over the phone. Every word matters. You need to hear the other person clearly, in the right order, without anything getting lost. If the connection drops, you call back and pick up where you left off.</p><p>That’s a stream socket. What makes them special:</p><ul><li>Reliable delivery: The data will get there. Period. If it doesn’t, the socket throws a fit and tries again.</li><li>Perfect ordering: Send “1, 2, 3” and they arrive as “1, 2, 3”. Always. No exceptions.</li><li>Error checking: Every piece of data is examined for corruption. If something looks wrong, it’s re-sent.</li><li>Two-way communication: Both sides can talk and listen simultaneously.</li></ul><h3>Datagram Sockets (SOCK_DGRAM)</h3><p>If stream sockets are a phone call, datagram sockets are sending postcards. You write a message, drop it in a mailbox, and hope for the best. You don’t get a delivery confirmation. Postcards might arrive out of order. Some might even get lost entirely. But they’re fast, cheap, and don’t require you to establish a connection first. This is why they are also called “connectionless sockets.”</p><p>Where you use them:</p><ul><li>Online gaming: When you’re playing a fast-paced shooter, your computer is constantly sending “I’m here! I shot!” packets. If one packet gets lost, it’s not a big deal — the game keeps moving. You wouldn’t want to pause the action to wait for a lost packet to be re-sent (that’s called “lag”).</li><li>Video streaming: Services like Zoom or Netflix sometimes use datagram sockets because a tiny glitch in video is better than a long pause while the system waits to re-send lost data.</li><li>DNS lookups: When your browser needs to find a website’s address, it sends a tiny datagram asking for directions. Speed matters more than perfection.</li></ul><blockquote>The Sneaky connect( ) Trick</blockquote><p>Datagram sockets can use a function called connect() if you really want. This might sound confusing—how can a &quot;connectionless&quot; socket connect? Think of it this way: Normally, when you send postcards, you write the address on each one individually. But if you’re sending 100 postcards to the same person, you might get tired of writing the address over and over. So you tell the post office, “Hey, all my postcards for the next hour are going to this address.” That’s what connect() does for datagram sockets—it sets a default destination so you don&#39;t have to specify it every time. The socket is still &quot;connectionless&quot; underneath, but you&#39;ve saved yourself some typing.</p><blockquote>There’s actually a third type called Raw Sockets. These are like giving a programmer direct access to the plumbing — powerful, dangerous, and definitely not for beginners.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d93c80ccd60" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>