<?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 Khaled Ben Yahya on Medium]]></title>
        <description><![CDATA[Stories by Khaled Ben Yahya on Medium]]></description>
        <link>https://medium.com/@khaledb.yahya?source=rss-1cfe30d80338------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*S-RvK8_gROtoipxMuqUyXQ.jpeg</url>
            <title>Stories by Khaled Ben Yahya on Medium</title>
            <link>https://medium.com/@khaledb.yahya?source=rss-1cfe30d80338------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 21:39:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@khaledb.yahya/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[I Took Anthropic AI Courses… and Realized I Was Already Doing Some of The Best Practices]]></title>
            <link>https://medium.com/@khaledb.yahya/i-took-anthropic-ai-courses-and-realized-i-was-already-doing-some-of-the-best-practices-9f8f2aa29f78?source=rss-1cfe30d80338------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f8f2aa29f78</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[anthropics]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Khaled Ben Yahya]]></dc:creator>
            <pubDate>Wed, 22 Apr 2026 19:22:29 GMT</pubDate>
            <atom:updated>2026-04-22T19:22:29.794Z</atom:updated>
            <content:encoded><![CDATA[<h3>I Took AI Courses… and Realized I Was Already Doing the Right Things</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WCqK6XavZC3o_vWbiDsfxQ.jpeg" /></figure><h3>I Took Anthropic AI Courses… and Realized I Was Already Doing Most of The Best Practices</h3><p>After spending time learning from AI courses and working daily with tools like ChatGPT, Claude, and Grok, I expected to discover completely new ways of using AI.</p><p>Instead, I realized something unexpected:</p><p>I was already using many of the “best practices” they teach.</p><p>Not perfectly. Not intentionally. But consistently.</p><p>The courses didn’t completely change how I use AI — they helped me understand <em>why</em> certain habits actually work.</p><h3>AI loses context faster than you think</h3><p>One of the first patterns I noticed early on:</p><p>AI conversations degrade over time.</p><p>At some point, the model starts drifting — giving generic answers, missing details, or ignoring earlier context.</p><p>Now when that happens, I don’t keep pushing forward.</p><p>I do one of three things:</p><ul><li>Restate the scope clearly</li><li>Reset the conversation</li><li>Or start fresh with a short summary</li></ul><p>That small reset often produces <em>better results instantly</em>.</p><h3>The moment you stop trusting AI blindly</h3><p>Another thing that became clear:</p><p>AI sounds confident… even when it’s wrong.</p><p>So I naturally stopped treating it like an answer machine.</p><p>Instead, I started treating it like a collaborator:</p><ul><li>“Are you sure about this?”</li><li>“What are the trade-offs?”</li><li>“Give me another approach”</li></ul><p>This simple shift changes everything.</p><h3>The underrated skill: challenging the output</h3><p>Most people accept the first answer.</p><p>But the real improvement comes when you push back.</p><p>When something feels slightly off, I ask:</p><ul><li>Why this solution?</li><li>What are the limitations?</li><li>Is there a simpler version?</li></ul><p>And surprisingly, the second or third answer is often much better than the first.</p><h3>The real skill isn’t using AI</h3><p>It’s managing it.</p><p>That includes:</p><ul><li>controlling context</li><li>knowing when to restart</li><li>structuring prompts clearly</li><li>validating outputs instead of trusting them</li></ul><p>Anyone can use AI.</p><p>Very few people use it <em>well</em>.</p><h3>Final thought</h3><p>AI didn’t fundamentally change how I work.</p><p>It made me more intentional about how I already think.</p><p>And I think that’s the real shift:</p><p>Not becoming dependent on AI — <br> but becoming better at working <em>with it</em>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f8f2aa29f78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying the IntersectionObserver API: A Simple Guide]]></title>
            <link>https://medium.com/@khaledb.yahya/demystifying-the-intersectionobserver-api-a-simple-guide-93084a4a4be5?source=rss-1cfe30d80338------2</link>
            <guid isPermaLink="false">https://medium.com/p/93084a4a4be5</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[async]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[intersection-observer]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Khaled Ben Yahya]]></dc:creator>
            <pubDate>Mon, 08 Jul 2024 22:13:22 GMT</pubDate>
            <atom:updated>2024-07-08T22:13:22.461Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yqUWqRLXQUn7F-kxtdlvNw.png" /></figure><p>I’ve heard from some of you that the IntersectionObserver API can be a bit tricky to understand, so I wanted to break it down in simpler terms. Trust me, once you get the hang of it, it’s a powerful tool to have in your web development toolkit.</p><h3>What is the IntersectionObserver API?</h3><p>The IntersectionObserver API lets you know when an element (like an image or a button) enters or exits the viewport (the visible part of the webpage) or another specified element. This is super useful for things like lazy loading images — where images are only loaded when they’re about to be seen — or infinite scrolling, where new content loads as you scroll down.</p><h3>How Does It Work?</h3><p>Here’s a step-by-step breakdown:</p><ol><li><strong>Create an IntersectionObserver:</strong> You start by creating an IntersectionObserver object. This object will keep an eye on (observe) changes to the visibility of a target element.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LHLFymFBNsKRDzZsJtNyyQ.png" /></figure><p>2.<strong> Observe an Element:</strong> Next, you tell the observer which element to watch. For example, if you want to lazy-load an image, you’d observe that image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cAISni-JQZhHrfJxWC4qdA.png" /></figure><p>3.<strong> Handle Visibility Changes:</strong> Inside the observer’s callback function, you get information about visibility changes through entries. Each entry gives details about how much of the target element is visible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KEwlMZQKbU039vBd_C4imw.png" /></figure><h3>Real-Life Example: Lazy Loading Images</h3><p>Imagine you have a webpage with lots of images. Loading them all at once can slow down the page. Instead, you can use the IntersectionObserver API to load images only when they’re about to be seen by the user.</p><p>Here’s how you do it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U2VWVNSno8-V9to17u5Edg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oA0aR6k4gTD_BxfaxHDERg.png" /></figure><h3>Breaking It Down:</h3><ul><li><strong>Create an Observer:</strong> The observer watches for visibility changes.</li><li><strong>Observe an Element:</strong> Tell the observer which element to watch.</li><li><strong>Handle Changes:</strong> When the element becomes visible, load the image and stop observing.</li></ul><h3>Why Use It?</h3><p>The IntersectionObserver API is efficient because it lets the browser handle visibility checks, which is better for performance compared to manually checking visibility using scroll events.</p><p>By using this API, you can make your web applications more efficient and user-friendly. It might seem a bit complex at first, but with practice, it becomes a valuable tool for optimizing web performance.</p><p>Feel free to ask any questions or share your experiences with the IntersectionObserver API!</p><p>#WebDevelopment #JavaScript #PerformanceOptimization #LazyLoading #TechTips</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93084a4a4be5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Supercharge Redux with ‘immer’: Using ‘immer’ to update Redux state in a more readable and safer…]]></title>
            <link>https://medium.com/@khaledb.yahya/supercharge-redux-with-immer-using-immer-to-update-redux-state-in-a-more-readable-and-safer-2d6655086d89?source=rss-1cfe30d80338------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d6655086d89</guid>
            <category><![CDATA[state]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Khaled Ben Yahya]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 12:38:18 GMT</pubDate>
            <atom:updated>2023-08-22T12:38:18.286Z</atom:updated>
            <content:encoded><![CDATA[<h3>Supercharge Redux with ‘immer’: Using ‘immer’ to update Redux state in a more readable and safer way.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*paPOBEWu-xOlQV9fMM9Wzw.png" /></figure><p>Using immer in Redux reducers can significantly improve the readability and maintainability of your code, while also helping to avoid potential issues that can arise when not using it. Here are some reasons why using immer is considered better:</p><ol><li>Immutability Made Simple: One of the core principles of Redux is immutability, which helps ensure predictability and efficient state management. While the old way of updating the state using spread operators `({ ...state, counter: state.counter + 1 })` achieves immutability, it can become cumbersome and error-prone, especially when dealing with nested objects and arrays. immer simplifies the process by allowing you to directly modify a draft state while maintaining immutability.</li><li>Clarity and Readability: With immer, your code becomes more concise and expressive. The syntax closely resembles that of mutable updates, making it easier to understand what changes are being made to the state. This is particularly helpful when dealing with complex state structures or a series of updates.</li><li>No Need for Manual Cloning: When using the traditional approach, you need to manually clone nested objects and arrays to ensure immutability. With immer, you can update nested properties directly within the draft state, saving you from writing repetitive cloning code.</li><li>Avoiding Accidental Mutations: Without immer, it&#39;s possible to accidentally mutate the state, leading to unpredictable behavior in your application. With immer, you work on a draft state that is a copy of the original state, so you don&#39;t have to worry about unintentional mutations.</li><li>Performance Optimization: immer is designed to optimize the performance of updates. It creates a proxy layer over the draft state and applies updates lazily, only modifying the necessary parts of the state when changes are made.</li><li>Simplifying Complex Reducers: Reducers that handle complex state structures or deeply nested objects can become difficult to manage using the traditional approach. immer simplifies these scenarios by allowing you to directly modify the draft state in a natural and intuitive way.</li></ol><p>While not using immer might not cause immediate issues, as your application grows, the codebase becomes more complex, and more developers get involved, the risk of introducing accidental mutations and decreasing code readability increases. Using immer helps mitigate these risks and leads to cleaner, more maintainable Redux code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d6655086d89" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Convert your Existing React js App to Android App Using the Ionic Capacitor]]></title>
            <link>https://medium.com/@khaledb.yahya/convert-your-existing-react-jsapp-to-android-app-using-the-ionic-capacitor-94046389ba53?source=rss-1cfe30d80338------2</link>
            <guid isPermaLink="false">https://medium.com/p/94046389ba53</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[google-play]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Khaled Ben Yahya]]></dc:creator>
            <pubDate>Sun, 09 Jul 2023 15:26:29 GMT</pubDate>
            <atom:updated>2023-07-30T06:40:11.885Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5OMRCgJpFC0muhlnr5IokQ.jpeg" /></figure><p>Today I will show the easiest and simple way I’ve found to convert your existing React js app to an android app using ionic capacitor.</p><p>What is Capacitor? According to documentation:</p><p><em>Capacitor is a cross-platform app runtime that makes it easy to build web apps that run natively on iOS, Android, Electron, </em>and<em> the web. We call these apps “Native Progressive Web Apps” and they represent the next evolution beyond Hybrid apps.</em></p><h3>Requirements:</h3><ul><li><a href="https://medium.com/how-to-react/getting-started-with-reactjs-a2d2c71a2d67">Existing React App</a></li><li><a href="https://ionicframework.com/docs/intro/cli">Ionic</a></li><li><a href="https://developer.android.com/studio">Android Studio</a></li></ul><ol><li>First, go to the root of your existing react app and create a file <strong>capacitor.config.json </strong>and inside that put the below code.</li></ol><pre>{<br>  &quot;appId&quot;: &quot;io.ionic.nameofyourapp&quot;,<br>  &quot;appName&quot;: &quot;nameofyourapp&quot;,<br>  &quot;bundledWebRuntime&quot;: false,<br>  &quot;npmClient&quot;: &quot;npm&quot;,<br>  &quot;webDir&quot;: &quot;build&quot;,<br>  &quot;cordova&quot;: {}<br>}</pre><p>2. Now create another file name <strong>ionic.config.json </strong>and inside that insert the below code.</p><pre>{<br>  &quot;name&quot;: &quot;nameofyourapp&quot;,<br>  &quot;integrations&quot;: {<br>    &quot;capacitor&quot;: {}<br>  },<br>  &quot;type&quot;: &quot;react&quot;<br>}</pre><p><strong><em>Note: replace nameofyourapp in both files with the name of your app.</em></strong></p><p>3. Now we need to build our react project. To build your react app open your terminal to the root of the project and run the below-mentioned command</p><pre>npm run build</pre><p><strong><em>Note: this will create the build folder in your root project and the name of the folder should match the webDir name inside capacitor.config.json file.</em></strong></p><p>4. Now we will install ionic globally in our machine. To install ionic globally in your machine open your terminal and run the below command.</p><pre>npm install -g @ionic/cli</pre><p>5. Now install the capacitor core in our project.</p><pre>npm install @capacitor/core --save</pre><p>6. Now install the capacitor CLI.</p><pre>npm i -D @capacitor/cli</pre><p>7. After that, we will first create an android app with our existing react app.</p><pre>ionic capacitor add android</pre><p>This will create the android folder in your root project and install all the required dependencies.</p><p>8. Now run the below command to launch your android project on Android Studio.</p><pre>npx cap open android</pre><p>Wait some time and then it will ask you to update the Gradle. Just update the Gradle to the latest version and run the project in the emulator. You can also connect your mobile to run the project live on your mobile phone.</p><p>9. Now open the build menu from the android studio and build your apk file.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94046389ba53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to effectively remove .env file from Git repo/history]]></title>
            <link>https://medium.com/@khaledb.yahya/how-to-effectively-remove-env-file-from-git-repo-history-bd5f14b7a322?source=rss-1cfe30d80338------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd5f14b7a322</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Khaled Ben Yahya]]></dc:creator>
            <pubDate>Sun, 12 Mar 2023 18:01:31 GMT</pubDate>
            <atom:updated>2023-03-12T19:05:36.730Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Effectively Remove .env File from Git Repo/History</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OCoBt-Nth9vji_Le" /><figcaption>Photo by <a href="https://unsplash.com/@rubaitulazad?utm_source=medium&amp;utm_medium=referral">Rubaitul Azad</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The .env file is typically located in the root directory of a project and is not committed to version control systems, such as Git. Instead, it is used to store sensitive information, such as database credentials, API keys, and passwords, which should not be publicly visible. By using an .env file, developers can keep their code and configuration separate, making it easier to maintain and deploy applications.</p><p>You can check the Youtube tutorial I created <a href="https://www.youtube.com/watch?v=B3y-eH2Tkp8">here</a></p><p>So if you’ve made a mistake like me and forgot to add “.env” to ‘.gitignore’ before pushing your code to your repository, you can follow these few simple steps to undo the catastrophe. 😅 We’re going to remove it not only from our git repository but most importantly from Git history as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*VE9Yy4HIEwlRZlD44CurOQ.png" /></figure><h3>Removing the file right away</h3><p>The best thing to do now is to remove the file right away and add it to your .gitignore file.</p><pre># Secret<br>.env</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*o86D5as-hZxZaJSKXx4UqA.png" /></figure><p>Yep, the .gitignore file doesn&#39;t untrack already committed changes. So how can we fix this?</p><p>You can remove a file from Git by running the following command.</p><pre>git rm -r --cached .env</pre><p>If we then push this change, you will see that the file is gone in GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*BMowGhkt8ay7lznwV2RM0Q.png" /></figure><p>However, this didn’t completely solve our issue. If we look at our Git history, we can still find the file and expose the secrets!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D0i6Ngtnln1i3Nc5U_VO0g.png" /></figure><p>To remove the file altogether, we can use the following command.</p><pre>git filter-branch --index-filter &quot;git rm -rf --cached --ignore-unmatch .env&quot; HEAD</pre><p>You will get some warnings about this messing up your history as this goes through your whole history and 100% removes its existence. To push this, you have to run the following command.</p><pre>git push --force</pre><p>If we look at our history, we can still see the commits that include this .env file, but the content is empty.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o-qfZKDbt5IX_d8eDoMe4A.png" /></figure><p>Few, thanks for having our back Git!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd5f14b7a322" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Redux for State Management]]></title>
            <link>https://medium.com/@khaledb.yahya/redux-for-state-management-de286cd99270?source=rss-1cfe30d80338------2</link>
            <guid isPermaLink="false">https://medium.com/p/de286cd99270</guid>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Khaled Ben Yahya]]></dc:creator>
            <pubDate>Thu, 09 Mar 2023 20:45:14 GMT</pubDate>
            <atom:updated>2023-03-12T19:34:25.798Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IzXEwuhsVbIuY4vv" /><figcaption>Photo by <a href="https://unsplash.com/@lautaroandreani?utm_source=medium&amp;utm_medium=referral">Lautaro Andreani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Redux is a predictable state container for JavaScript applications that can help you manage your application’s global state in a more organized and maintainable way. The key concepts of Redux are the store, reducers, actions, and dispatch.</p><p>Store: The store is the single source of truth for your application’s state. It’s a plain JavaScript object that holds all of the application’s state data. The store is created using the createStore function from the Redux library, and it&#39;s typically created at the top-level of the application.</p><p>Reducers: Reducers are pure functions that take the current state and an action, and return a new state based on the action. Reducers are responsible for updating the store’s state in response to actions dispatched by the application. The state returned from the reducer must be a new object, and not a mutated version of the previous state. Here’s an example of a simple reducer:</p><pre>function counterReducer(state = { count: 0 }, action) {<br>  switch (action.type) {<br>    case &#39;INCREMENT&#39;:<br>      return { count: state.count + 1 };<br>    case &#39;DECREMENT&#39;:<br>      return { count: state.count - 1 };<br>    default:<br>      return state;<br>  }<br>}</pre><p>In the example above, the reducer updates the state based on two actions: INCREMENT and DECREMENT. When an INCREMENT action is dispatched, the reducer returns a new object with the count property incremented by 1. Similarly, when a DECREMENT action is dispatched, the reducer returns a new object with the count property decremented by 1.</p><p>Actions: Actions are plain JavaScript objects that describe changes to the application’s state. They must have a type property that describes the type of action being performed, and can also include any additional data needed to perform the action. Actions are typically created using action creator functions, which are functions that return the action object. Here&#39;s an example of an action creator function:</p><pre>function increment() {<br>  return { type: &#39;INCREMENT&#39; };<br>}</pre><p>In the example above, the increment function returns an action object with a type of INCREMENT.</p><p>Dispatch: Dispatch is the function used to send actions to the store. When an action is dispatched, the store calls the reducers with the current state and the action, and the reducers return the new state. The store then updates its state with the new state returned by the reducers. Dispatch is typically called from within components or other parts of the application that need to update the state. Here’s an example of how to use dispatch to update the count:</p><pre>import { createStore } from &#39;redux&#39;;<br>import counterReducer from &#39;./counterReducer&#39;;<br><br>const store = createStore(counterReducer);<br>store.dispatch({ type: &#39;INCREMENT&#39; });</pre><p>In the example above, the createStore function creates a new store using the counterReducer. Then, the dispatch function is used to send an INCREMENT action to the store, which updates the count in the store&#39;s state.</p><p>One of the benefits of using Redux is that it can simplify your application’s architecture and make it more testable and maintainable. By keeping all of your state in a single, centralized location, you can easily reason about changes to your data over time. Additionally, because Redux relies on pure functions and plain JavaScript objects, it’s easy to test and debug your code.</p><p>Testability is another sweet key feature of using Redux is that it makes your application more testable. Since your state management is centralized and predictable, it becomes easier to write tests that ensure your application is behaving as expected. By writing tests for your actions and reducers, you can be confident that your state changes are working correctly and that you’re not introducing regressions as you add new features.</p><pre>describe(&#39;incrementCounter&#39;, () =&gt; {<br>  it(&#39;should increment the counter by 1&#39;, () =&gt; {<br>    const initialState = { count: 0 };<br>    const action = { type: &#39;INCREMENT_COUNTER&#39; };<br>    const newState = reducer(initialState, action);<br>    expect(newState.count).toEqual(1);<br>  });</pre><p>The code above defines a test for the incrementCounter action using the Jest testing framework. The test sets up an initial state, dispatches the action, and expects the new state to have a count of 1. This test demonstrates how Redux makes it easy to test individual actions and their effects on the state of the application.</p><p>While Redux is a powerful tool, it may not be the best choice for every project. For example, if you have a small application with simple state management needs, you might be better off using <a href="https://reactjs.org/docs/context.html">React Context</a> or another simpler solution like <a href="https://docs.pmnd.rs/zustand">Zustand</a> which I’m going to using in one of my upcoming projects. It all comes down to your project’s use cases and specificities.</p><p>Finally I highly recommend reading the <a href="https://redux.js.org/tutorials/essentials/part-1-overview-concepts">Redux</a> documentation to get started and gradually go in depth in each concept. It definitely helped me have a better understanding quicker than watching Youtube tutorials about it and also to write this article. I decided to write this to keep it as a reference for me so hopefully you find it useful as well. Have a good read!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de286cd99270" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My way of learning..]]></title>
            <link>https://medium.com/@khaledb.yahya/lately-ive-found-i-ve-been-able-to-successfully-make-whatever-i-m-attempting-in-any-language-i-m-665289b8d254?source=rss-1cfe30d80338------2</link>
            <guid isPermaLink="false">https://medium.com/p/665289b8d254</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[career-change]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[Khaled Ben Yahya]]></dc:creator>
            <pubDate>Fri, 28 Jan 2022 15:50:40 GMT</pubDate>
            <atom:updated>2022-06-29T11:22:59.290Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RzQ3gktrKJKQTr4s" /><figcaption>Photo by <a href="https://unsplash.com/@furtado?utm_source=medium&amp;utm_medium=referral">Felipe Furtado</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Lately, I’ve found I’ve been able to successfully make whatever I’m attempting in any language I’m trying to. Without failure.</p><p>Am I smart? Well, in school I was a C to D average student. F in math. I was a big quitter because most things just seemed too hard for me. I tend to over complicate things.</p><p>Now I’ve never worked on a team, my projects are not hugely scaled yet and I’m not claiming to be an expert in this field.. I’m not, so take my advice with a grain of salt… or try it for yourself risk-free…. but here’s the formula that has been working for me. Any tips, advice or criticism on my simplistic view is welcome… I’d love to hear from some experienced developers:</p><ol><li>Start with a visual reference of your project or at least the scope of what you’re working with.</li><li>Pick one thing at a time to work on in your project. (for a web developer it might be a button, or game developer maybe the player’s jump method) Simple task board might help with this.</li><li>Break that down to one instruction / one step at a time and code it that way. Anyone is capable of understanding a single instruction. And even complexed systems are built piece by piece. Pseudocode is really great, just write what you need to do in plain English</li></ol><p>Now there is much more involved in being a great programmer I’m sure, but I’ve yet to come across a problem I couldn’t solve, or something I couldn’t create while adhering to those 3 principles. Don’t make it too hard for yourself, especially when, you’re just starting out…. or if you’re constantly getting stuck and frustrated. You’ll learn better when you aren’t stressed. Take break, a walk then attack it it again. Eventually your brain will conquer it and you’ll achieve! I also recommend immersing yourself in the environment (watch a random developer video for fun sometimes, not just to make something work!)</p><p>I also left out that after step 3 there will is tons of debugging and tweaking until you get your desired outcome. You’ll always have to debug, but it’s way more often at first, especially as a beginner when you’re forgetting things like semi-colon, what the different operators do, and what code goes in which curly brackets. It’s good to strengthen your brain muscles.</p><p>Hopefully someone finds this useful, and keep working towards your goals! Persistence and perseverance pays off.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=665289b8d254" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>