<?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 Anum Siddiqui on Medium]]></title>
        <description><![CDATA[Stories by Anum Siddiqui on Medium]]></description>
        <link>https://medium.com/@asiddiqui0692?source=rss-75c6291d11e7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QH8wVmzLetfROFAfXRfwvg.jpeg</url>
            <title>Stories by Anum Siddiqui on Medium</title>
            <link>https://medium.com/@asiddiqui0692?source=rss-75c6291d11e7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 21:59:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@asiddiqui0692/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[Agents All the Way Down: Building LLM-Powered Systems the OTP Way]]></title>
            <link>https://medium.com/@asiddiqui0692/agents-all-the-way-down-building-llm-powered-systems-the-otp-way-10bfd1bfcc69?source=rss-75c6291d11e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/10bfd1bfcc69</guid>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Anum Siddiqui]]></dc:creator>
            <pubDate>Wed, 17 Jun 2026 17:41:17 GMT</pubDate>
            <atom:updated>2026-06-17T17:41:17.601Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wSEcWhPb4iHs4JVJ.jpg" /></figure><p>I want to start with a question I kept asking myself about two years ago, when I started building systems seriously with large language models.</p><p>The question was not about prompts. It was not about which model to use. It was not about RAG or embeddings or context windows.</p><p>The question was much simpler than that.</p><p>When this LLM call hangs, and it will hang, what does my system do?</p><p>Does it wait? Does it crash? Does it drop the request silently and pretend nothing happened? Does it retry, and if so, how many times, and what happens to the twenty other requests that piled up while it was deciding?</p><p>I have looked at a lot of LLM systems over the last two years. Systems in production, at real companies, serving real users. And I can tell you that most of them have a very clear answer to that question.</p><p>The answer is: they have not thought about it.</p><p>They have thought deeply about the model. They have thought about the prompt architecture and the retrieval pipeline and the evaluation framework. They have put enormous care into making the AI part intelligent. And then they bolted all of that onto a thread pool and called it a production system.</p><p>The hardest problems in LLM systems are distributed systems problems. They were always distributed systems problems. We just got distracted by how impressive the AI part was. And if you want to solve distributed systems problems well, Elixir and the OTP framework is one of the finest tools our industry has ever produced for exactly this class of work.</p><p>Here is why.</p><h3>The Problem You Did Not Know You Signed Up For</h3><p>Here is how most LLM projects start. You write a function. It takes user input, calls a model API, returns a response. You run it. It works. It is honestly kind of magical the first time. You ship it.</p><p>And then real users hit it. And the magic gets complicated.</p><p>The first thing you notice is that latency is not what you are used to. A database query has variance, but it has bounded variance. You learn your p95 over time and you build around it. An LLM API does not work like that. The same prompt, the same model, the same parameters, you might get three hundred milliseconds or you might get nine seconds. Not because something is broken. Because the model generates tokens sequentially and longer outputs simply take longer to produce. Every time. By design.</p><p>Your timeouts, your retry logic, your user-facing loading states, all of it needs to be rethought for a dependency where latency is fundamentally tied to output length.</p><p>The second thing you discover is that a real LLM application is not one call. It is a pipeline. You are retrieving context. You are embedding documents. You are generating a response. You are grading that response. You are routing based on what the model decided. Each of those steps is I/O. Each of them can fail independently. And the relationship between them, what runs in sequence, what can run in parallel, what gets retried and what gets abandoned, that relationship has to live somewhere.</p><p>In most systems I have seen, it lives in business logic. In conditionals and try/catch blocks and a lot of wishful thinking. That is not a pipeline. That is a script with anxiety.</p><p>The third thing, and this is where it gets genuinely complex, is that you eventually start building agents. An agent is a system where the model does not just respond. It reasons and acts. It has tools: functions it can call, APIs it can invoke, data it can read and write. Given a goal, it decides which tools to use, in what order, interprets the results, and decides what to do next. It loops until it believes the task is complete.</p><p>This is a fundamentally different architecture from a request/response system. An agent has state that persists across multiple model calls. It has long-running behavior, seconds, minutes, sometimes longer. It needs to be able to pause and wait for a human to approve an action before it proceeds. It needs to survive failures mid-task without losing all its work. And in serious applications, you need to run many of them simultaneously.</p><p>Read that list back. Durable stateful processes. Long-running behavior. Suspendable, resumable workflows. Fault tolerance. Massive concurrency.</p><p>That is a distributed systems problem. A well-understood one, with well-understood solutions. And the engineering community that has been solving it with the most elegance, for the longest time, is the Erlang and Elixir community.</p><p>We just were not calling it AI at the time.</p><h3>Why Elixir: The Honest Case</h3><p>Let me talk about the runtime underneath Elixir, because understanding it is what makes everything else make sense.</p><p>The BEAM, the Erlang virtual machine, was designed in the 1980s by engineers at Ericsson who had a very specific mandate: build telecom infrastructure that could not go down. Not rarely goes down. Cannot go down. Systems that need to handle thousands of simultaneous phone calls, where a crash in one call cannot affect another, where maintenance can happen while the system is live, and where a hardware failure in one node cannot take out the network.</p><p>The design decisions they made to meet that mandate have turned out to be an almost perfect fit for building AI systems today. Not because anyone predicted this. Because the shape of the problems is the same.</p><p>The fundamental unit of computation on the BEAM is the process. Not an OS thread. Not a green thread. An Erlang process. These are extraordinarily lightweight, microseconds to spawn, kilobytes of memory. A system running tens of thousands of concurrent processes is normal. Hundreds of thousands is not unusual. They do not share memory. They communicate by passing messages. And they can fail, this is the crucial part, without affecting any other process.</p><p>When you are building an LLM agent, you can model that agent as a process. Its entire working memory, the conversation history, the tool results, the current step in its plan, lives inside that process. If that agent crashes, it crashes alone. Its neighbors keep running. The supervisor above it decides whether and how to restart it. Clean slate. No corrupted shared state. No cascading failure.</p><p>Which brings me to supervision trees, and the philosophy they embody: let it crash.</p><p>This phrase makes people uncomfortable the first time they hear it. Let it crash sounds irresponsible. But here is what it actually means in practice. Instead of writing defensive code that tries to anticipate every possible failure, which is genuinely impossible when your core dependency is an LLM that can return malformed JSON, hang indefinitely, or hit a content filter on a perfectly reasonable input, you write clean clear code that handles the happy path. And you define your recovery strategy structurally, at the supervision level.</p><p>A supervisor is a process whose only job is to watch other processes and restart them when they fail. You declare: if this worker crashes, restart it. If it crashes three times in five seconds, something is wrong, escalate up the tree. These recovery strategies are configured declaratively, once, and they apply everywhere.</p><p>For LLM pipelines, this is transformative. A model call that hangs until timeout? The process restarts. A response that cannot be parsed and throws an error? The worker crashes, the job returns to the queue, a fresh worker picks it up. You write that behavior once. It is structural, not imperative.</p><p>Fault tolerance is not something you add to your code. It is something you design into your system’s architecture. The supervision tree is your error handling strategy. And it is one of the most elegant ideas in all of systems engineering.</p><p>The third primitive worth naming is the GenServer. A GenServer is a behavior in OTP that gives you a structured way to build a stateful, long-running process. An LLM agent needs to hold state across many interactions. It receives messages: a new user input, a tool result returning from a remote API, a human approval after a long wait, a cancellation signal. It needs to respond synchronously in some cases and fire-and-forget in others. And all of that state management needs to be safe. No race conditions, no data corruption, no two things accidentally writing to the same memory at the same time.</p><p>A GenServer handles all of that by design. State is explicit, immutable between message handlers, and owned entirely by one process. Concurrency is safe by construction, not by locks you remembered to acquire. And the process is supervised automatically.</p><p>This is not just a convenient abstraction. It is a precise semantic match for what an AI agent is: a stateful, long-lived, message-driven process. The alignment between the problem and the tool is not a coincidence. It is why Elixir keeps showing up as the right answer when you look at this seriously.</p><h3>Four Architecture Patterns for AI Systems</h3><p>Here are four patterns that I think every engineer building serious LLM systems should understand. For each one, the naive approach, the failure mode it creates, and the OTP-native solution.</p><h3>Pattern One: The Supervised Pipeline</h3><p>The most common LLM architecture is a linear pipeline. Retrieve relevant context, format a prompt, call the model, parse the output, return a result. In sequence.</p><p>The naive implementation runs this as a single synchronous chain inside a request handler. The entire chain either succeeds or fails as a unit. If step three fails after step one and two succeeded, you have thrown away that work and the user gets an error.</p><p>The OTP pattern is to model each stage as a supervised worker connected through a message queue. Each stage is independently restartable. When the model call fails, and it will, only that stage fails. The supervisor restarts it. The upstream stages keep running. The in-flight job waits and a fresh worker picks it up.</p><p>You stop thinking about error handling as something you add to application code and start thinking about it as a structural property of the system topology. The shape of your supervision tree expresses your resilience strategy.</p><h3>Pattern Two: Concurrent Fan-Out</h3><p>Many LLM tasks are naturally parallelizable. Retrieving from three different data sources simultaneously. Running a prompt against two different models and taking the better answer. Grading a response on five different criteria at once.</p><p>The instinct is to do this sequentially because it is simpler to reason about. But sequential execution means the total latency is the sum of all steps. Parallel execution means the latency is the longest step. For retrieval-heavy or multi-model workflows, that difference is significant.</p><p>On the BEAM, distributing work across processes and collecting results as they arrive is idiomatic. There is no ceremony, no event loop management, no careful exception propagation across async boundaries. And partial failure is composable. If you are retrieving context from five sources and two of them time out, you can proceed with the three that responded. The timeout handling is declarative and configured once at the task level, not scattered through retrieval logic.</p><h3>Pattern Three: The Agent as a Process</h3><p>The dominant approach treats an agent as a function. Something you call, it runs its loop, it returns. State is serialized to a database between steps. Human-in-the-loop pauses require stopping execution, storing everything, and reconstructing state when the human responds.</p><p>The OTP approach is fundamentally different. The agent is a process. A supervised, stateful, long-lived process that persists for the duration of the task. Its working memory, conversation history, tool results, current step, accumulated context, lives inside the process. There is no serialization overhead on the hot path. No round-trip to a cache to read state before every model call. The state is there, in memory, immediately, because the process never left.</p><p>When the agent needs to pause for human approval, it does not shut down. It sends a notification and waits. The process is suspended, holding all its context, for as long as it needs to. When the human responds, the process resumes exactly where it left off. When the agent crashes, a supervisor restarts it, restores the last checkpointed state, and the task continues.</p><p>An agent is not a function you call. It is an entity that lives. It has a lifecycle. It has state. It can be observed, messaged, paused, resumed, and gracefully terminated. The process model is not just an implementation detail. It is the right conceptual model for what an agent is.</p><h3>Pattern Four: Fleet Management and Observability</h3><p>Real applications do not run one agent. They run dozens or hundreds. Customer support agents, document processing agents, research agents, all running simultaneously, each with its own state and lifecycle.</p><p>OTP’s dynamic supervisor gives you fleet management at the infrastructure level. Agents are started on demand, supervised independently, and restarted on failure. The process registry gives every agent an addressable identity so any part of your application can locate any running agent and send it a message, without a database lookup, without shared global state.</p><p>PubSub gives every agent a real-time broadcast channel. Every significant state transition, starting a new reasoning step, calling a tool, waiting for a human, finishing, can be broadcast as a message. Your UI subscribes and updates in real time. Your monitoring system subscribes and tracks fleet health. Your logging pipeline subscribes and builds a complete audit trail.</p><p>The full lifecycle of every agent is observable, addressable, and resilient by construction. Not by instrumentation bolted on after the fact. By the architecture itself.</p><p>The through-line across all four patterns is worth naming explicitly. In each case the OTP-native solution is not more complex than the naive approach. In most cases it is simpler. What it requires is a different way of thinking about the system, not as a collection of functions that call each other, but as a community of processes that communicate, fail, restart, and collaborate.</p><h3>Multi-Agent Systems</h3><p>Everything above involves one agent interacting with tools. But where AI systems are heading involves agents collaborating with other agents.</p><p>An orchestrator agent receives a complex goal, something too large or multifaceted for a single reasoning loop. It breaks the goal into subtasks and delegates each one to a specialist agent. The specialists work in parallel, each one an independent supervised process running its own reasoning loop. When they complete, they report back. The orchestrator receives their results, synthesizes them, and either delivers a final answer or kicks off another round of delegation.</p><p>This maps so naturally onto OTP it is almost disorienting. The orchestrator is a GenServer. Each specialist is a GenServer. The orchestrator spawns specialists through the dynamic supervisor, the same fleet management already in place. It discovers their completion through PubSub, the same broadcast mechanism already in use. It synthesizes their results in its own message handlers using the same stateful process model. No new primitives. No new framework. The architecture built for one agent scales to a team of agents using tools you already understand.</p><p>When you run five specialist agents simultaneously on the BEAM, you are running five isolated processes preemptively scheduled by a virtual machine designed for exactly this. A slow agent does not starve a fast one. A crashed agent does not threaten its neighbors. The garbage collection of one process does not affect the latency of another. The wall clock time for a five-agent parallel workflow is the time of the slowest agent, not the sum. Starting a new agent process costs a few microseconds and kilobytes of memory. Running a hundred concurrent agents on the BEAM is not a heroic infrastructure feat. It is a Tuesday.</p><h3>Honest Tradeoffs</h3><p>I have been making a case, and I want to close that case honestly.</p><p>The first tradeoff is context window management. Everything above is about running agents reliably. But the hardest problem in building agents that actually work well is not infrastructure. It is deciding what to keep in the model’s context window and what to discard. Conversation histories grow. Models have hard limits. Deciding what to summarize, what to retain verbatim, and what to drop entirely is a problem the process model helps you manage but does not solve for you. It is part engineering, part heuristic, and currently more art than science.</p><p>The second is tooling maturity. The LLM tooling ecosystem has years of accumulated work in other languages: prompt management libraries, structured output parsers, evaluation frameworks, agent scaffolding. Elixir is catching up and the core libraries are solid, but you will build more of the surrounding infrastructure yourself. For some engineers that is exciting. You are closer to the metal and you understand exactly what your system is doing. For others it is friction. Know which kind of engineer you are before you commit.</p><p>The third is the learning curve. The process model, supervision trees, message-passing design, these require a real shift in how you think about systems. It is not a weekend investment. It pays back richly over time, but the ramp matters for teams evaluating whether to invest.</p><p>Elixir is not always the answer. It is the right answer for a specific and important class of problem: systems that need to be concurrent, resilient, and observable, running AI agents as first-class entities. If that is what you are building, the investment is real and the payoff is real.</p><h3>Closing Thoughts</h3><p>There is a concept in engineering called impedance mismatch. It describes the friction that exists when two systems that need to work together have fundamentally different shapes. The classic example is object-oriented code and relational databases. The mismatch is so common we invented entire frameworks just to bridge it.</p><p>The argument I have been making here is for the opposite: an impedance match. A case where the shape of the problem and the shape of the tool align so naturally that working with them together feels like the tool was designed for exactly this.</p><p>Erlang was built by engineers who asked: what does a system look like if we take failure seriously from the beginning? If we do not pretend the network is reliable, or that hardware never fails, or that processes never crash? The answer they arrived at, isolated processes, message passing, supervision trees, let it crash, describes a computation model where every unit of work is autonomous, stateful, and independently resilient.</p><p>An AI agent is autonomous, stateful, and needs to be independently resilient. The shapes match.</p><p>We do not need a new framework. We do not need to retrofit these ideas onto the BEAM. We need to look clearly at what we already have, what this community has been refining for decades, and recognize that it was designed for exactly this problem shape, long before agent was an AI term.</p><p>Every agent is a process. Every pipeline is a supervision tree. Every status update is a PubSub broadcast. Every failure is a restart.</p><p>The infrastructure for building serious AI systems has been sitting in the Elixir ecosystem for years. We just needed a reason compelling enough to use it.</p><p>I think we have that reason now.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10bfd1bfcc69" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agents All the Way Down: Building LLM-Powered Systems the OTP Way]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">I want to start with a question I kept asking myself about two years ago, when I started building systems seriously with large language&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@asiddiqui0692/agents-all-the-way-down-building-llm-powered-systems-the-otp-way-6c9e32b77346?source=rss-75c6291d11e7------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@asiddiqui0692/agents-all-the-way-down-building-llm-powered-systems-the-otp-way-6c9e32b77346?source=rss-75c6291d11e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c9e32b77346</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Anum Siddiqui]]></dc:creator>
            <pubDate>Mon, 15 Jun 2026 19:44:15 GMT</pubDate>
            <atom:updated>2026-06-15T19:44:15.557Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[From BEAM to Browser: Why Elixir Developers Are Basically Full-Stack Engineers]]></title>
            <link>https://medium.com/@asiddiqui0692/from-beam-to-browser-why-elixir-developers-are-basically-full-stack-engineers-d494c134a1d4?source=rss-75c6291d11e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/d494c134a1d4</guid>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[erlang]]></category>
            <category><![CDATA[phoenix-framework]]></category>
            <category><![CDATA[elixirlang]]></category>
            <category><![CDATA[elixir]]></category>
            <dc:creator><![CDATA[Anum Siddiqui]]></dc:creator>
            <pubDate>Tue, 18 Nov 2025 18:49:19 GMT</pubDate>
            <atom:updated>2025-11-18T20:16:34.077Z</atom:updated>
            <content:encoded><![CDATA[<p>When people hear “Elixir,” they think backend. Distributed systems. Telecom-level reliability. Petabyte-scale fault tolerance.</p><p>But the truth?</p><p>Elixir engineers are basically full-stack engineers and the rest of the industry just hasn’t caught up yet.</p><p>Let’s break down why.</p><ol><li><strong>Elixir’s Superpower: Stability Across Distributed Systems</strong></li></ol><p>Modern businesses don’t just need apps that work, they need apps that survive chaos. Elixir runs on the legendary BEAM VM (the same virtual machine powering Erlang), known for:</p><ul><li>Unmatched stability in distributed systems</li><li>True fault tolerance with self-healing processes</li><li>Horizontal scalability baked directly into the runtime</li></ul><p>These aren’t features you “set up.”</p><p>They’re not AWS add-ons.</p><p>They’re not optional.</p><p>They are core to how Elixir works.</p><p>Other languages force you to assemble these benefits by duct-taping together message queues, supervisors, restart strategies, and complex cloud infra. With Elixir, resilience is not an upgrade, it’s the default!</p><p>Example: A Simple Self-Healing Process (GenServer + Supervisor)</p><pre>defmodule Worker do<br>  use GenServer<br><br>  def start_link(_opts), do: GenServer.start_link(__MODULE__, :ok)<br><br>  def init(:ok) do<br>    Process.flag(:trap_exit, true)<br>    {:ok, %{count: 0}}<br>  end<br><br>  def handle_cast(:crash, state) do<br>    raise &quot;Boom!&quot;<br>    {:noreply, state}<br>  end<br>end<br><br>defmodule WorkerSupervisor do<br>  use Supervisor<br><br>  def start_link(_), do: Supervisor.start_link(__MODULE__, :ok)<br><br>  def init(:ok) do<br>    children = [<br>      {Worker, []}<br>    ]<br><br>    Supervisor.init(children, strategy: :one_for_one)<br>  end<br>end</pre><p>If Worker crashes, the supervisor silently restarts it. That’s fault-tolerance in the runtime.</p><p><strong>2. Functional, But Without the Math PhD</strong></p><p>Elixir gives you all the power of functional programming, minus the scary math class flashbacks.</p><ul><li>No lambda calculus degrees required</li><li>Tail-call optimization is automatic</li><li>Pattern matching makes code self-documenting</li><li>Atoms act as lightweight self-describing types</li><li>Lazy execution where it matters</li><li>Clean, elegant syntax inspired by Ruby</li><li>You get the beauty of Ruby and the power of Erlang, without needing to learn 40 years of telecom theory.</li></ul><p>Example: Pattern Matching That Feels Like Magic</p><pre>def greet(%{name: name, role: :admin}) do<br>  &quot;Welcome back, admin #{name}!&quot;<br>end<br><br>def greet(%{name: name}) do<br>  &quot;Hello, #{name}!&quot;<br>end<br><br>greet(%{name: &quot;Gold&quot;})       <br># &quot;Hello, Gold!&quot;<br><br>greet(%{name: &quot;Gold&quot;, role: :admin})<br># &quot;Welcome back, admin Gold!&quot;</pre><p>Pattern-matching makes branching logic elegant.</p><p>3. <strong>Phoenix: The Full-Stack Framework That Makes Elixir a Web Powerhouse</strong></p><p>Full-stack isn’t just React + Node + database. Full-stack means controlling: server, real-time layer, state, events, rendering, and data flow.</p><p>Enter Phoenix, Elixir’s server-side fullstack framework inspired by Rails but built for real-time, modern, concurrent apps.</p><p>Phoenix gives you:</p><ul><li>Rendering + templating</li><li>Built-in auth</li><li>Live reload</li><li>Real-time events</li><li>Phoenix LiveView (yes, server-rendered reactive UI)</li><li>Channels for websockets</li><li>REST, GraphQL, or whatever API structure you want</li></ul><p>Frameworks like Next.js, Nuxt, and SvelteKit dominate web development, but Phoenix competes on their level with a completely different paradigm:</p><p>Everything is reactive, real-time, and powered by the BEAM. You get front-end reactivity with no front-end JavaScript framework. And yes, that makes Elixir engineers fullstack by default.</p><p>Example: A Phoenix LiveView Interactive Counter</p><pre>defmodule DemoWeb.CounterLive do<br>  use Phoenix.LiveView<br><br>  def mount(_params, _session, socket) do<br>    {:ok, assign(socket, :count, 0)}<br>  end<br><br>  def render(assigns) do<br>    ~H&quot;&quot;&quot;<br>    &lt;div&gt;<br>      &lt;h1&gt;&lt;%= @count %&gt;&lt;/h1&gt;<br>      &lt;button phx-click=&quot;inc&quot;&gt;+&lt;/button&gt;<br>    &lt;/div&gt;<br>    &quot;&quot;&quot;<br>  end<br><br>  def handle_event(&quot;inc&quot;, _params, socket) do<br>    {:noreply, update(socket, :count, &amp;(&amp;1 + 1))}<br>  end<br>end</pre><p>A fully interactive UI with zero JavaScript.</p><p><strong>4. The Elixir Ecosystem is Larger Than You Think</strong></p><p>Because Elixir shares the BEAM with Erlang, developers instantly gain access to an ecosystem that has existed and matured for decades:</p><ul><li>Cowboy → Rock-solid web server</li><li>Ecto → Elegant data mapper + database toolkit</li><li>Thousands of BEAM packages → battle-tested and production-ready</li><li>HEX → A modern package manager and central repository</li></ul><p>These aren’t obscure community plugins that may or may not work.These are trusted, stable, deeply integrated tools.</p><p>When people say “Elixir is young,” they forget: Elixir stands on Erlang’s 35+ years of engineering excellence.</p><p>Example: Ecto Query That Reads Like English</p><pre>query =<br>  from u in User,<br>    where: u.active == true,<br>    order_by: [desc: u.inserted_at],<br>    limit: 10<br><br>Repo.all(query)</pre><p>Clean, readable, and powerful.</p><p><strong>5. Mix: A Build Tool That Actually Feels Modern</strong></p><p>Every Elixir project comes with Mix, which feels like npm + cargo + make but without the headaches.</p><p>Mix gives you:</p><ul><li>Dependency management</li><li>Compiling</li><li>Testing (built-in test framework!)</li><li>Documentation generation</li><li>Release building</li><li>Task automation</li></ul><p>No Makefiles.</p><p>No fragmented tools.</p><p>No brittle scripts.</p><p>Just clean commands that work.</p><p>Throw in Elixir’s concurrency model and the beloved pipe operator, and developers suddenly get a workflow that is smooth, fast, and joyful.</p><p>Example: A Custom Mix Task</p><pre><br>defmodule Mix.Tasks.Hello do<br>  use Mix.Task<br><br>  def run(_) do<br>    IO.puts(&quot;Hello from Mix!&quot;)<br>  end<br>end</pre><p>Run it:</p><pre>mix hello</pre><p><strong>6. Fault Tolerance Means Peace of Mind Especially On-Call</strong></p><p>If you know, you know. Being on-call in most languages means stress and prayer.</p><p>Being on-call in Elixir means your system:</p><ul><li>isolates failures</li><li>restarts broken processes</li><li>auto-heals</li><li>keeps running even if parts crash</li><li>It’s like having Kubernetes-level resilience inside the runtime itself.</li><li>Businesses love it.</li><li>Engineers love it more.</li></ul><p>Example: Supervisors Prevent On-Call Nightmares</p><pre>children = [<br>  {MyApp.Worker, []},<br>  {MyApp.AnotherWorker, []}<br>]<br><br>Supervisor.start_link(children, strategy: :one_for_one)</pre><p>If one worker dies, only that worker restarts and the system keeps running.</p><p><strong>7. So… Why Are Elixir Engineers Full-Stack?</strong></p><p><strong>Because Elixir gives you:</strong></p><ul><li>Backend power through the BEAM</li><li>Web development through Phoenix</li><li>Real-time UI through LiveView</li><li>Database layer through Ecto</li><li>Deployment simplicity through Mix</li><li>Access to a massive ecosystem</li><li>Extreme reliability and scalability as defaults</li></ul><p>An Elixir engineer doesn’t just build APIs, they build:</p><ul><li>scalable systems</li><li>real-time services</li><li>interactive UIs</li><li>distributed architectures</li><li>resilient workflows</li><li>fault-tolerant applications</li><li>fullstack end-to-end products</li></ul><p>Elixir turns backend developers into distributed systems fullstack engineers.</p><p>There’s truly nothing else like it.</p><p>Conclusion: Elixir Is More Than a Language! It’s a Full-Stack Mindset! If you’re building modern, reactive, scalable applications, Elixir doesn’t just make you productive, it makes you unstoppable! And whether or not you set out to become a full-stack engineer? Elixir makes you one anyway.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d494c134a1d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Docker?]]></title>
            <link>https://medium.datadriveninvestor.com/what-is-docker-f08543108d4?source=rss-75c6291d11e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f08543108d4</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Anum Siddiqui]]></dc:creator>
            <pubDate>Sat, 06 Oct 2018 21:35:34 GMT</pubDate>
            <atom:updated>2018-10-06T21:36:12.967Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xZU6-TM0brbVQLyS" /></figure><p>Lately in my web development career, I have been hearing a lot about docker and how a lot of companies are wanting software engineers to explore and learn more about it. So I decided to do some research on my own, and see what is all the craziness and hype behind Docker.</p><p>Docker is a tool that is designed to make it easier to create, deploy, and run applications by using containers. So what purpose does the container serve? Well containers allow a developer to package up an application with all of the necessary parts such as libraries and other dependencies and ship it all out as one package. Using containers, allow developers to have a peace of mind that an application will run on any other Linux machine despite any customized settings that machine might have that could possibly differ from the machine that was used for writing and testing the code. Now doesn’t this sound pretty cool?! I mean who wouldn’t love this, having a peace of mind means having more time to get creative and solve more world problems one bug at a time!</p><p>One can presume, that Docker is a bit like a virtual machine. However, unlike a virtual machine, instead of creating a whole virtual operating system, Docker allows applications to use the same Linux kernel as the system that they’re running on and only requires be shipped with things not already running on the host computer. WOW! I don’t think I see any cons to this! Therefore, a huge advantage to this is that it gives a significant performance boost and reduces the size of the application. And if you thought all that was great, well it gets better! Docker is open source!!! This means that anyone can contribute to Docker and extend it to meet their own needs like if they need additional features that aren’t available out of the box. IMPRESSIVE MUCH?! I think so!</p><p>So who can benefit from using Docker? Well Docker is a tool that is designed to benefit both developers and administrators, making it an essential part of many DevOps toolchains. For developers, it means they can ultimately focus on writing code without having to worry abut the system that it will be running on. In addition, it allows developers to get a heard start by using one of thousands of programs already designed run in a Docker container as part of their application. From a operations staff’s point of view, Docker allows flexibility and potentially reduced the number of systems needed because of its small footprint and lower overhead.</p><p>In regards to security, Docker does bring security to applications running in a shared environment, however containers by themselves are not an alternative to taking proper security measures. I believe this is one disadvantage to Docker, and what us developers should aim to improve on.</p><p><a href="https://opensource.com/resources/what-docker">What is Docker?</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f08543108d4" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/what-is-docker-f08543108d4">What is Docker?</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Authentication vs Authorization]]></title>
            <link>https://medium.datadriveninvestor.com/authentication-vs-authorization-716fea914d55?source=rss-75c6291d11e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/716fea914d55</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Anum Siddiqui]]></dc:creator>
            <pubDate>Sun, 30 Sep 2018 21:10:57 GMT</pubDate>
            <atom:updated>2019-02-20T13:58:49.518Z</atom:updated>
            <content:encoded><![CDATA[<figure><a href="http://www.track.datadriveninvestor.com/1B9E"><img alt="" src="https://cdn-images-1.medium.com/max/700/0*QiSfnyyOa20Lxi0O" /></a></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nRKKVJEt9lU3VsXr" /></figure><p>Today I’m going to discuss two topics that most people tend to confuse. Both the terms are often used in conjunction with each other when it comes to security and gaining access to the system. Both terms very key topics that are often associated with the web as key pieces of its service infrastructure. However, both these terms are quite different with completely different concepts. Now you’re wondering what these terms are, well they are known as authentication and authorization. Authentication means confirming your own identity, whereas authorization means being allowed access to the system. In even more simpler terms authentication is the process of verifying oneself, while authorization is the process of verifying what you have access to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*EGe-sdGsXYBtlmkW.png" /></figure><h4>Authentication</h4><p>Authentication is about validating your credentials such as Username/User ID and password to verify your identity. The system then checks whether you are what you say you are using your credentials. Whether in public or private networks, the system authenticates the user identity through login passwords. Usually authentication is done by a username and password, although there are other various ways to be authenticated.</p><p>Authentication factors determine the many different elements the system uses to verify one’s identity before granting the individual access to anything. An individual’s identity can be determined by what the person knows, and when it comes to security at least two or all the three authentication factors must be verified in order to grant someone permission to the system. Based on the security level, authentication factors can vary from one of the following:</p><ul><li><strong>Single- Factor Authentication: </strong>This is the simplest form of authentication method which requires a password to grant user access to a particular system such as a website or a network. The person can request access to the system using only one of the credentials to verify one’s identity. For example, only requiring a password against a username would be a way to verify a login credential using single- factor authentication.</li><li><strong>Two- Factor Authentication: </strong>This authentication requires a two- step verification process which not only requires a username and password, but also a piece of information only the user knows. Using a username and password along with a confidential information makes it that much harder for hackers to steal valuable and personal data.</li><li><strong>Multi- Factor Authentication: </strong>This is the most advanced method of authentication which requires two or more levels of security from independent categories of authentication to grant user access to the system. This form of authentication utilizes factors that are independent of each other in order to eliminate any data exposure. It is common for financial organizations, banks, and law enforcement agencies to use multiple- factor authentication.</li></ul><h4>Authorization</h4><p>Authorization occurs after your identity is successfully authenticated by the system, which therefore gives you full access to resources such as information, files, databases, funds, etc. However authorization verifies your rights to grant you access to resources only after determining your ability to access the system and up to what extent. In other words, authorization is the process to determine whether the authenticated user has access to the particular resources. A good example of this is, once verifying and confirming employee ID and passwords through authentication, the next step would be determining which employee has access to which floor and that is done through authorization.</p><p>Access to a system is protected by authentication and authorization, and they are frequently used in conjunction with each other. Although both have different concepts behind then, they are critical to the web service infrastructure, especially when it comes to being granted access to a system. Understanding each term is very important and a key aspect of security.</p><p><a href="http://www.differencebetween.net/technology/difference-between-authentication-and-authorization/">Difference between Authentication and Authorization</a></p><h3><strong>DDI Recommended Resources</strong></h3><ul><li><a href="http://go.datadriveninvestor.com/authb/mb/mp000001/t"><strong><em>OAuth 2 In Action by Justin Richer and Antonio Sanso</em></strong></a></li></ul><figure><a href="http://go.datadriveninvestor.com/authb/mb/mp000001"><img alt="" src="https://cdn-images-1.medium.com/max/200/1*fWmvpVWci409HMzsVRYuDg.jpeg" /></a></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fb2a0d6%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2Fb2a0d6%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/0707f5c806284d01a4a13c7b13a91ce3/href">https://medium.com/media/0707f5c806284d01a4a13c7b13a91ce3/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=716fea914d55" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/authentication-vs-authorization-716fea914d55">Authentication vs Authorization</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cookies vs localStorage]]></title>
            <link>https://medium.datadriveninvestor.com/cookies-vs-local-storage-2f3732c7d977?source=rss-75c6291d11e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f3732c7d977</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Anum Siddiqui]]></dc:creator>
            <pubDate>Sun, 23 Sep 2018 21:38:19 GMT</pubDate>
            <atom:updated>2018-09-26T14:48:37.794Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vqpy7JNtwsVSIeeR" /></figure><p>Recently, I was tasked with a question during an interview with a big company. The question was, “Tell me the difference between cookies and localStorage?” And although I had a very broad idea of what the differences might be, I thought I’d dive into this topic a bit more.</p><h4>Introduction to Cookies</h4><p>So what are cookies? Well, I can most certainly tell you they’re not what you might find in your snack stash when you’re craving some sugary sweets. In fact, cookies are small files which are located on a user’s computer. They are designed to hold a generous amount of data specific to a client and website, and they can accessed either by the web server or the client computer. The reason behind this is to allow the server to deliver a page tailored to a particular user, or the page itself can contain some script which knows of the data in the cookie, and therefore it is able to carry information from one visit to the website to the next.</p><p>So what does a cookie contain? Well each cookie is effectively a small lookup table containing pairs of key, data values. Once the cookie has been read by the code on the server or the client computer, the data can be retrieved and used to customize the web the web page appropriately.</p><p>Cookies are pretty much a convenient way to carry information from one session on a website to another, or between sessions on related websites, without having to burden a server machine with massive amounts of data storage. If we were to store data on the server without using cookies, then it would be difficult to retrieve a particular user’s information without requiring a login on each visit to the website. Therefore, a cookie can simply be used if there is a large amount of information to store. In addition a cookie can be made to persist for an arbitrary length of time.</p><h4>Introduction to localStorage</h4><p>localStorage is a way to store data on the client’s computer. It allows the saving of key/value pairs in a web browser and it stores data with no expiration date. localStorage can only be accessed via JavaScript, and HTML5. However, the user has the ability to clear the browser data/cache to erase all localStorage data. Web storage can be viewed simplistically as an improvement on cookies, providing much greater storage capacity The available size is 5MB, which is more space to work with than a typical 4KB cookie. In addition with localStorage, the data is not sent back to the server for every HTTP request (HTML, images, JavaScript, CSS, etc.), which thus reduces the amount of traffic between client and server. Lastly, it works on same-origin policy, so the data stored will only be available on the same origin.</p><h4>Differences between cookies and localStorage</h4><p>Cookies and local storage serve different purposes. Cookies are mainly for reading server-side, whereas local storage can only be read by the client-side. Apart from saving data, a big technical difference is the size of data you can store, and as I mentioned earlier localStorage gives you more to work with. In conclusion, the question when dealing with the two, one should ask is, in your application who needs this data- the client or the server?</p><p><a href="https://stackoverflow.com/questions/3220660/local-storage-vs-cookies">Local Storage vs Cookies</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f3732c7d977" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/cookies-vs-local-storage-2f3732c7d977">Cookies vs localStorage</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serializers in Ruby]]></title>
            <link>https://medium.com/@asiddiqui0692/serializers-in-ruby-c076b83a34e9?source=rss-75c6291d11e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c076b83a34e9</guid>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Anum Siddiqui]]></dc:creator>
            <pubDate>Sun, 16 Sep 2018 19:06:09 GMT</pubDate>
            <atom:updated>2018-09-17T18:40:47.423Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DmlTemWcWC2E8rUV" /></figure><p>Let’s talk about serializers in Ruby. Most people build wonderful applications in Ruby without having to use serializers. It’s definitely one of those things you can do without, until you really need it! In this blog we will talk about how to create and manage serializers.</p><h4>Introduction to ActiveModel::Serializer</h4><p>So what exactly is ActiveModel::Serializer? Well ActiveModel::Serializer provides a way of creating custom JavaScript Object Notation, otherwise known as JSON. It manages to do this by representing each resource as a class that inherits from ActiveModel::Serializer. This is very helpful when you want to build JSON API’s through serializer objects as this allows you to fully customize the JSON output. This way we can select only the information we want, as well as get access to our relationships (OOP).</p><h4><strong>Installation</strong></h4><p>In order to install ActiveModel::Serializer, add the following gem to your</p><p>Gemfile:</p><pre>gem &#39;active_model_serializers&#39;, &#39;0.9.3&#39;</pre><p>Once the gem is added, you can install it using bundle:</p><pre>bundle install</pre><p>After the installation has been complete, in order to generate a serializer, you must decide what model to generate the serializer for.</p><pre>rails g serializer product</pre><p>For example the above will create a serializer for the model Product. When the serializer is generated it will show up as<strong> app/serializers/product_serializer.rb </strong>with the following content:</p><pre># app/serializers/product_serializer.rb</pre><p>Lets say our Product model had all these attribrutes:</p><pre>class Product &lt; ApplicationRecord  <br>  has_many :reviews  <br>  has_many :users, through: :reviews   </pre><pre>  validates :title, presence: true  <br>  validates :description, presence: true      <br>  validates :category, presence: true  <br>  validates :price, presence: true    <br>  validates :lightURL, presence: true  <br>  validates :medURL, presence: true   <br>  validates :darkURL, presence: true  <br>  validates :vidURL, presence: true<br>end</pre><p>But if we didn’t need all this information being rendered from our ProductSerializer, what we can do is once our product serializer has been generated, we can chose what attributes we want our JSON API to contain.</p><pre>class ProductSerializer &lt; ActiveModel::Serializer  <br>  attributes :id, :title, :description, :category, :price<br>end  </pre><p>So now when we load <a href="http://localhost:3000/api/v1/products">http://localhost:3000/api/v1/products</a>, we should see our API composed of custom data that we wanted to display by allowing it in our serializer.</p><pre> <a href="http://localhost:3000/api/v1/products">http://localhost:3000/api/v1/products</a></pre><pre>[<br>  {<br>    &quot;id&quot;: 16,<br>    &quot;title&quot;: &quot;Plum&quot;,<br>    &quot;description&quot;: &quot;Size: 3 g / 0.1 US oz&quot;,<br>    &quot;category&quot;: &quot;Lipstick&quot;,<br>    &quot;price&quot;: &quot;$18.50&quot;<br>  },<br>  {<br>    &quot;id&quot;: 17,<br>    &quot;title&quot;: &quot;Red&quot;,<br>    &quot;description&quot;: &quot;Size: 3 g / 0.1 US oz&quot;,<br>    &quot;category&quot;: &quot;Lipstick&quot;,<br>    &quot;price&quot;: &quot;$18.50&quot;<br>  },<br>  {<br>    &quot;id&quot;: 18,<br>    &quot;title&quot;: &quot;Pink&quot;,<br>    &quot;description&quot;: &quot;Size: 3 g / 0.1 US oz&quot;,<br>    &quot;category&quot;: &quot;Lipstick&quot;,<br>    &quot;price&quot;: &quot;$18.50&quot;<br>  },<br>  {<br>    &quot;id&quot;: 19,<br>    &quot;title&quot;: &quot;Nude&quot;,<br>    &quot;description&quot;: &quot;Size: 3 g / 0.1 US oz&quot;,<br>    &quot;category&quot;: &quot;Lipstick&quot;,<br>    &quot;price&quot;: &quot;$18.50&quot;,<br>    &quot;imgURL&quot;: &quot;/image<br>  },<br>  {<br>    &quot;id&quot;: 20,<br>    &quot;title&quot;: &quot;Coral&quot;,<br>    &quot;description&quot;: &quot;Size: 3 g / 0.1 US oz&quot;,<br>    &quot;category&quot;: &quot;Lipstick&quot;,<br>    &quot;price&quot;: &quot;$18.50&quot;<br>  }<br>]</pre><p>As you can see, in my ProductSerializer I was able to omit attributes I didn’t need to be displayed and instead only add the ones I want and formatted into JSON. In this way, AMS(ActiveModel::Serializer) is a powerful way to compose an API with explicit, easy-to-maintain serializers, as opposed to keeping track of what things you do and don’t want to render at the controller or view level.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c076b83a34e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React’s Rising Popularity]]></title>
            <link>https://medium.com/@asiddiqui0692/reacts-rising-popularity-e3cdc747f527?source=rss-75c6291d11e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3cdc747f527</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Anum Siddiqui]]></dc:creator>
            <pubDate>Mon, 25 Jun 2018 21:02:59 GMT</pubDate>
            <atom:updated>2018-06-26T21:46:29.545Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RJBiXaUiJSk_cTzc" /><figcaption>Photo by <a href="https://unsplash.com/@driver202?utm_source=medium&amp;utm_medium=referral">Tigran Newman</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Intro to React:</p><p>The first time React appeared to be in use was in the Facebook News Feed in 2011, and it was developed by a Facebook engineer. After it was open sourced in 2013, it quickly gained popularity. It became somewhat a standard library for front-end developers building user interfaces. One of the reasons that lead to the success of React is its versatility, as it can be used with other libraries and doesn’t assume anything about what else is being used in your stack. Therefore it is indeed very flexible, and that means your application can use whatever system to manage state that feels right for you.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fft2C2l1bBuXyo%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fft2C2l1bBuXyo%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fft2C2l1bBuXyo%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/31430a47659693939bceb5a08dbdba64/href">https://medium.com/media/31430a47659693939bceb5a08dbdba64/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*ak3fhweR1rLCdp53.png" /></figure><p>Main Design Concepts of React That Drive It’s Popularity:</p><h4>1) The use of reusable, composable, and stateful components</h4><p>React describes User Interfaces using components. Components can be thought of as simple functions. They can reuse a single component in multiple User Interfaces, and components can contain other components. However unlike pure function, a full React component can have a private state to hold data that may change over time.</p><h4>2)The nature of reactive updates</h4><p>When the state of a component(the input) changes, the User Interface it represents(the output) changes as well. In a browser, we would need to regenerate the HTML views in the Document Object Model(DOM). However, with React, we do not need to worry about how to reflect these changes. React will simply “<em>react” </em>to<em> </em>the state changes and automatically update the DOM when needed.</p><h4>3)The virtual representation of views in memory</h4><p>As we all know React uses The Virtual DOM to render a HTML tree virtually first, and consequently every time a state changes, we get a new HTML Tree that needs to be taken to the browser’s DOM. Instead of writing a whole new tree React will only write the difference between the new tree and the previous tree. This process is known as <em>Tree Reconciliation.</em></p><h4>4)Testability</h4><p>When using react to develop mobile applications, you can easily test the features of your applications. This is one of the reasons why React applications are so easy to test because its views can be treated as functions of a specific state. Thus allowing developers to easily and efficiently test each part of their application with little effort.</p><h4>BONUS</h4><p>One of React’s best features is that it can run on the client side as well as it can be rendered on the server side. This allows for faster load times and better SEO (search engine optimisation) performance.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F1IpLdZcjoWkAE%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F1IpLdZcjoWkAE%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F1IpLdZcjoWkAE%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="348" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca067ab9f72d7f5e59eb10e0a98eecb9/href">https://medium.com/media/ca067ab9f72d7f5e59eb10e0a98eecb9/href</a></iframe><h3>What is the difference between ReactJS and React-Native?</h3><p>React-Native is a framework and ReactJS is javascript library that which you can use for your website. Upon starting a new project with ReactJS, a bundler like Webpack is usually chosen in order to figure out which bundling modules you need for your project. React-Native comes with everything you need, and it is quite simple to set up. It only takes you one command line to run in the terminal.</p><p>React-Native doesn’t use HTML to render the app, but provides alternative components that work in a very similar manner. Since your code doesn’t get rendered in an HTML page, this also means that you won’t be able to reuse any libraries that you had used before with ReactJS that renders any kind of HTML SVG, or Canvas. In addition React- Native is not made from web elements and can be styled in the same way as ReactJS.</p><h3>What do Studies Say?</h3><p>In a 2016 StackOverflow developer survey, the data showed that React’s popularity increased by over 300%. In addition in 2017, React still held its position as among the most popular.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*rMdNXWVIOj7I-LVZ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*XKJokKyWBzwqNgG2Nzckiw.png" /></figure><p>In job listing, React took off and went ahead jQuery. It is actually the first library to pass jQuery in job popularity in a decade.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FLXBU25Ep1yXgcyKuRs%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FLXBU25Ep1yXgcyKuRs%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FLXBU25Ep1yXgcyKuRs%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/bf6154588a59710dc86678a7389a7daf/href">https://medium.com/media/bf6154588a59710dc86678a7389a7daf/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zsfr-vAuQXc95A7j1ebyEg.png" /><figcaption>React Rising — the first library to unseat jQuery this decade (source: Indeed.com)</figcaption></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FDIYrvml3LZ9F6%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FDIYrvml3LZ9F6%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FDIYrvml3LZ9F6%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="177" frameborder="0" scrolling="no"><a href="https://medium.com/media/8291fcea6053812ab052d6dac97dd7c3/href">https://medium.com/media/8291fcea6053812ab052d6dac97dd7c3/href</a></iframe><ul><li><a href="https://medium.com/@alexmngn/from-reactjs-to-react-native-what-are-the-main-differences-between-both-d6e8e88ebf24">What are the main differences between ReactJS and React-Native?</a></li><li><a href="https://envato.com/blog/rise-react-learn/">The Rise of ReactJS - and Why You Should Learn It - Envato</a></li><li><a href="https://medium.freecodecamp.org/yes-react-is-taking-over-front-end-development-the-question-is-why-40837af8ab76">Yes, React is taking over front-end development. The question is why.</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3cdc747f527" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JIT Compilers]]></title>
            <link>https://medium.com/@asiddiqui0692/just-in-time-jit-compilers-56e445eb448e?source=rss-75c6291d11e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/56e445eb448e</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Anum Siddiqui]]></dc:creator>
            <pubDate>Tue, 05 Jun 2018 17:03:22 GMT</pubDate>
            <atom:updated>2018-06-05T17:20:30.060Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CgGdrxKckLZ2GJzc" /><figcaption>Photo by <a href="https://unsplash.com/@trommelkopf?utm_source=medium&amp;utm_medium=referral">Steve Harvey</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*KV4uyOrXAsl9R73V.png" /></figure><p>So speaking of languages, we know in the coding world there are many. But how exactly, do these languages communicate with the computer. The goal generally is that we want to tell the computer what to do and the issue with that is that simply put that humans and computer speak different languages. However, we’re in luck because JavaScript and other programming languages are designed for human cognition, not for machine cognition. So the goal of the JavaScript engine is to take your human language and turn it into something the machine understands. You may ask how does this go about? Well in programming, this translation generally happens in two ways by using either an interpreter or a compiler. The difference is with an interpreter the translation happens line-by-line, on the other hand a compiler works ahead of time to create the translation and writes it down.</p><p>As almost with anything in the programming world, there are pros and cons to each of these way of handling the translation.</p><p><strong>Interpreter pros and cons:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*OKmH2dtY1j0KmYjQ.png" /></figure><p>Interpreters are fairly quick, in a sense that you can skip the compilation step, and just go straight to translating the first line and running it. Due to this reason, it may seem as if an interpreter would be a better fit for JavaScript. Therefore, browsers in the beginning <em>used</em> to use interpreters.</p><p>However the disadvantage of working with an interpreter is when you’re running the same code more than once, such as in when you’re in a loop. This would lead to the same translation over and over again.</p><p>Compliler pros and cons:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*0R4fipEYLqAqfyd9.png" /></figure><p>The compiler as opposed to interpreters take a bit more time to start up because it has to go through that compilation step at the beginning. However after that step, the code in the loops run faster because it doesn&#39;t need to repeat the translation for each pass through the loop.</p><p>Compilers are also different than interpreters whereby that it has more time to look at the code and make edits so that it will run faster. The edits done by compilers are known as <strong><em>optimizations</em></strong>. Interpreters do work during runtime, so it is unable to take much time during the translation phase to figure out these optimizations.</p><p>Just- in- time compilers:</p><p>Browsers started mixing compilers in as a way of getting rid of the interpreter’s inefficiency. Browsers mix in compilers but adding a new part to the JavaScript engine called monitor, or otherwise known as a profiler. What the monitor does is that it watches the code as it run, and makes a note of how many times it is run and what types are used. In the beginning, the monitor just runs everything through the interpreter. The same lines of code that are run a few times are segments of code that is called warm, and if they’re ran a lot, they’re called hot.</p><p>Baseline compiler :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*nEEwkd57B-9UDUi2.png" /></figure><p>When a function starts to get warm, the just- in- time (JIT) will send it off to be compiled and then store that compilation. Each line of the function is compiled to what is known as a “stub”. The stubs are indexed by line number and variable type. The monitor comes into play when it sees that the execution is hitting the same code again with the same variable types, it will just go ahead and make life easier by pulling out its compiled version.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3o7TKFe8xHMzUoNqg0%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3o7TKFe8xHMzUoNqg0%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3o7TKFe8xHMzUoNqg0%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/1958a581edf691d0e63690276c0b109d/href">https://medium.com/media/1958a581edf691d0e63690276c0b109d/href</a></iframe><p>The baseline compiler will make some of these optimizations and not all for the sake that it does not want to take too much time, and hold up the execution.</p><p>Optimizing compiler:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*QOM4BrZjYsxv9zBv.png" /></figure><p>When a part of the code is hot the monitor will send it off to the optimizing compiler. The role of the optimizing compiler is that it will create another, even faster version of the function that will be stored. To make a faster version of the code, the optimizing compiler has to make some assumptions. An example of assumption it can make is objects created by a particular constructor have the same shape, and that they always have the same property names, and those properties are added in the same order, this way it can cut some corners based on that guess. The optimizing compiler uses the information the monitor gathered by watching code execution to make these assumptions. If for instance, something has been true for previous passed through a loop, the optimizing compiler will then assume it will proceed to be true.</p><p>However in JavaScript, nothing can be for sure, so the compiled code needs to do a check before it runs to see whether the assumptions are valid. If it is valid, then the compiled code runs, otherwise JIT assumes that it made the wrong assumptions and trashes the optimized code. In that case the executions goes back to the interpreter or baseline compiled version. The going back process is known is <strong><em>deoptimization</em></strong> or “bailing out”.</p><p>Optimizing compilers make code faster, but there are instances where they can cause unexpected performance problems. For example, if a code keeps getting optimized and then deoptimized, it ends up being slower compared to just executing the baseline compiled version.</p><p>Example of optimization: Type specialization:</p><p>There are a lot of kinds of optimizations, one in particular is known as type specialization. The dynamic type system that JavaScript uses requires extra work at runtime.</p><pre>function arraySum(arr) {<br>  var sum = 0;<br>  for (var i = 0; i &lt; arr.length; i++) {<br>    sum += arr[i];<br>  }<br>}</pre><p>In this example, the <strong>+=</strong> in the loop looks simple, and it sees that you can calculate this in one single step, but because of dynamic typic, it takes more steps than you would think. If we assume that the <strong>arr</strong> in this example is an array of 100 integers, once the code warms up, the baseline compiler will go ahead and create a stub for each operation in the function. So there is going to be a stub for <strong>sum+= arr[i]</strong> that will take care of the <strong>+=</strong> operation as integer addition.</p><p>However, <strong>sum</strong> and<strong> arr[i]</strong> aren’t guaranteed to be integers. Since types are dynamic in JavaScript, there is a possibility that in later iteration of the loop <strong>arr[i] </strong>will be a string. Integer addition and string concatenation are different operations , therefore they would compile to different machine code.</p><p>The way JIT take care of this is by compiling multiple baseline studs. If a piece of code is <strong>monomorphic</strong>, meaning that its always called with the same types, then it will get one stub. But, it is <strong>polymorphic</strong>, where it is called with different types from one pass through the code to another, then it will get a stub for each combination type that passes through that operation. So for JIT, this will result it to ask a lot of questions before it chooses a stub. Since each line of code has its own set of stubs in the baseline compiler the JIT needs to keep checking the types each time the line of code is executed. So it will ask the same questions for each iteration through the loop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*HianQZ8UPiYNCU2P.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*X82C9OFyw1LtkYFV.png" /></figure><p>The code would execute a lot faster if the JIT didn’t need to repeat those check, and that’s one of the things the optimizing compiler takes care of. In the optimizing compiler, the whole function is compiled together. The type checks are moved so they happen before the loop. Some JIT optimize this even further. For example, in Firefox there’s a special classification for arrays thats only contain integers. So if <strong>arr</strong> is one of these arrays, then JIT doesn’t need to check <strong>arr[i]</strong> is an integer. This means that the JIT can do all of the type checks before it enters the loop.</p><h3>Takeaways:</h3><p>In conclusion, JIT helps JavaScript run faster by monitoring the code as it’s running it and sending hot code paths to be optimized. This leads to many performance improvements for JavaScript applications. In addition, to make things faster, the JIT has overhead that it adds during runtime:</p><ul><li>optimization and deoptimization</li><li>memory which is used for monitor to referenceand recovery information for when bailouts happen.</li><li>memory used in order to store baseline and optimizing versions of a function</li></ul><p>Although even with these improvements, the performance of JavaScript can be unpredictable.</p><p><a href="https://hacks.mozilla.org/2017/02/a-crash-course-in-just-in-time-jit-compilers/">A crash course in just-in-time (JIT) compilers - Mozilla Hacks - the Web developer blog</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56e445eb448e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Developers Should Appreciate Test- Driven Development and Not Shy Away From It!]]></title>
            <link>https://medium.com/@asiddiqui0692/why-developers-should-appreciate-test-driven-development-and-not-shy-away-from-it-68d6f1feeec3?source=rss-75c6291d11e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/68d6f1feeec3</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[tdd]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Anum Siddiqui]]></dc:creator>
            <pubDate>Sun, 13 May 2018 23:49:16 GMT</pubDate>
            <atom:updated>2018-05-14T01:24:18.938Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iE5Bj-JKzJQsl1kf." /><figcaption>Photo by <a href="https://unsplash.com/@jontyson?utm_source=medium&amp;utm_medium=referral">Jon Tyson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As programmers we are continuously reminded that the world of coding is not too far from the real world, and that is why sometimes as developers we need this point of reference for things in the tech world to make sense. So I’m going to jump right into this topic called Test- Driven Development (TDD) and its shared similarity with antiseptics in surgery. Both TDD in programming and antiseptics in surgery are able to confront their opponents before introducing to the public their positive effects. Okay…so what does all this mean and where am I going with this?</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FSqmkZ5IdwzTP2%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FSqmkZ5IdwzTP2%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExbGxrYzR0OHI3eXF3cnRtYnEzeDU0ODV6dzJzNGViempubXJuMnR6NyZlcD12MV9naWZzX2dpZklkJmN0PWc%2FSqmkZ5IdwzTP2%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="357" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc11370755351d3c12b11c0e376accf7/href">https://medium.com/media/dc11370755351d3c12b11c0e376accf7/href</a></iframe><p>Well one thing to realize is that the goal of antiseptics is to kill germs and bacteria in order to avoid spreading them between live tissues, which would ultimately lead to the development of diseases. TDD works like antiseptics, in which it works to deliver “clean code” with less bugs.</p><p>Testing is a key component when it comes to software development. Besides debugging, reading and writing test allows developers to gain clarity on what they are building, it simply lets you focus on the goal and eliminates anything that might be extra. TDD was introduced/rediscovered in 2003 by American software engineer Kent Beck. There are various aspects to using test- driven development and some principles that apply to are “keep it simple, stupid” (KISS) and “You aren’t gonna need it” (YAGNI). By focusing on writing the code that is necessary to pass the tests can result in clearer and cleaner designs.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FaJlKIh8Kh0NLa%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FaJlKIh8Kh0NLa%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FaJlKIh8Kh0NLa%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/d738f0f650347f52a27c39fe7f2daea8/href">https://medium.com/media/d738f0f650347f52a27c39fe7f2daea8/href</a></iframe><p>So now that we know what Test- Driven Development can accomplish, how can we go about creating our own. Well, the general process of TDD is:</p><ol><li>Write a test that fails</li><li>Write code to pass the test</li><li>Refactor the code to make it “clean”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*hO6gXLCoDr5i_T5l_lW_Hw.png" /><figcaption>TDD Cycle</figcaption></figure><p>In test- driven development, each new feature begins with writing a test. Write a test that defines a function or improvements of a function. The first step is to run the test and to see it failing because there isn’t any adequate code to make it pass.</p><p>The next step is to write the code that will cause the test to pass. The important take away from this stage is that the new code may not be perfect but just sufficient enough to get the tests to pass.</p><p>The last step is to refactor the code. This means that the code must be cleaned up such that duplication must be removed in order for the code to be concise and efficient. This should lead to improving design and readability of your code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*2QwenNTYFLMjZ0VJ-AYgGw.png" /></figure><p>Lets go ahead and implement how we can create a test using Test-Driven Development for our example: calculating password strength.</p><p>Step 1: Decide the inputs and outputs</p><p>Right now our goal is to calculate the password strength. The input for this is simple which is that it has to be the password. The output is also easy since it has to be some value describing the strength of the password. This can be accomplished by using a boolean, where the password is either strong or it isn’t.</p><p>Step 2: Choose function signature</p><p>Now that we know what our input is and what the output is, we need to decide on what parameter the function takes, and whether it returns something. In our example our parameter is the password.</p><pre><strong>var</strong> strong = isStrongPassword(&#39;password string goes here&#39;);</pre><p>Step 3: Decide on one aspect of the functionality</p><p>In this stage, we want to think of what is the simplest possible behavior that we need to get closer to our goal? Or in another words, what lines of code can we add to bring the function closer to working. So for our example, the simplest rules for password strength would be having an empty string and for that the output should always be false when the password is empty.</p><p>Step 4: Implement test</p><p>In this step we want to focus on testing how the function behaves. We decided upon the function taking a password as its only parameter. We also decided that it returns a boolean to indicate whether the password was strong or not. In addition, we chose that for an empty password the result should always be false — to show that an empty password is weak. Now lets go ahead and plug everything we have done so far into a test:</p><pre>describe(&#39;isPasswordStrong&#39;, <strong>function</strong>() {<br>  it(&#39;should give negative result for empty string&#39;, <strong>function</strong>() {<br>    <strong>var</strong> password = &#39;&#39;;<br> <br>    <strong>var</strong> result = isPasswordStrong(password);<br> <br>    expect(result).to.be.<strong>false</strong>;<br>  });<br>});</pre><p>The syntax when creating tests are pretty simple. We start with “describe” and pass in the function we want to test. Followed by “describe” should come “it” where will begin to pass information about how our function should behave. Lastly we go ahead with “expect” which is pretty self-explanatory in which it shows what exactly our outcome should equal to, and in this case false if we have an empty string or no password.</p><p>Step 5: Implement Code</p><p>This step is where we’ll just add the smallest amount of code to make the test we created pass.</p><pre><strong>function</strong> isPasswordStrong(password) {<br>  <strong>if</strong>(!password) {<br>    <strong>return</strong> <strong>false</strong>;<br>  }<br>}</pre><p>If we wanted to continue developing the password strength function all we would do is go back to step 3, and chose the next small step to take. Then we would go ahead with Step 4 — add test, Step 5 — implement and Repeat!</p><h4>Pro tips for TDD</h4><p>☺Test Isolation — Test methods should be dependent upon one another. So when one of your tests breaks, then you know where to trace back to perform the fixes.</p><p>☺Test Scope — Choosing the proper scope of testing is important — it should be smaller than the whole application and it should test in the context of a class or package.</p><p>☺Put assertions first — Knowing what your tests is expected to do is very important.</p><p>☺Form a story behind the test — Try to define the story behind the tested functionality, for example what is the input/output and what is the purpose of this functionality?</p><h4><strong>Advantages of TDD</strong></h4><p>☺TDD deals with the human aspects of coding — Carelessness and forgetfulness. For example if we were to write all logic directly by line 200 we might forget why we are multiplying a variable with 10 at line 30. However by doing it incrementally, we are able to build our understanding. If you were to delete line 30, you can see which is test is failing and you would instantly know why.</p><p>☺ TDD will result in better coding practice — Focusing on the goal and what the function it set out to do, meanwhile making slight changes to make the the tests pass will allow you to refactor and create “cleaner” code.</p><p>☺With TDD, you’ll hardly miss things — When your create a requirement for your test to pass, you see it fail when you run it initially. When you add logic, you see it passing. But seeing it fail is important, so you know what broke your code.</p><p>☺ TDD saves you a lot of time(in the future) — Writing good tests with more and more conditions for your code will save you a lot of time of debugging in the future.</p><h3>Conclusion:</h3><p>Test- Driven Development just like antiseptics allow for less bacteria or in the coding world it allows for less bugs, higher quality software, and a razor focus. In addition TDD is about ensuring that the software’s internals are well designed, reusable and decoupled. TDD is not set out to write tests in a different way, however it is about design and thinking small, building incrementally and being critical about all possibilities.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F1gVl1hyKdTK22f4kuy%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F1gVl1hyKdTK22f4kuy%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F1gVl1hyKdTK22f4kuy%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/8f670919ec327d01b6f41a031aa787f5/href">https://medium.com/media/8f670919ec327d01b6f41a031aa787f5/href</a></iframe><h4>Resources:</h4><ul><li><a href="https://medium.com/@ronaaa/test-driven-development-i-hated-it-now-i-cant-live-without-it-4a10b7ce7ed6">Lesson Learned: Test Driven Development</a></li><li><a href="https://10clouds.com/blog/test-driven-development/">Why Test-driven Development is Like Surgery - 10Clouds Blog</a></li><li><a href="https://codeutopia.net/blog/2016/10/10/5-step-method-to-make-test-driven-development-and-unit-testing-easy/">5 step method to make test-driven development and unit testing easy</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68d6f1feeec3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>