<?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 Farhan Mahmood on Medium]]></title>
        <description><![CDATA[Stories by Farhan Mahmood on Medium]]></description>
        <link>https://medium.com/@farhanmahmoodny?source=rss-9db380806bda------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*91LntIFgs9IW_o3l.jpg</url>
            <title>Stories by Farhan Mahmood on Medium</title>
            <link>https://medium.com/@farhanmahmoodny?source=rss-9db380806bda------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 07:39:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@farhanmahmoodny/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[What to remember when designing an app]]></title>
            <link>https://medium.com/@farhanmahmoodny/what-to-remember-when-designing-an-app-673a8f68ca0d?source=rss-9db380806bda------2</link>
            <guid isPermaLink="false">https://medium.com/p/673a8f68ca0d</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[app-development]]></category>
            <dc:creator><![CDATA[Farhan Mahmood]]></dc:creator>
            <pubDate>Wed, 14 Aug 2019 01:40:56 GMT</pubDate>
            <atom:updated>2019-08-14T01:40:56.845Z</atom:updated>
            <content:encoded><![CDATA[<p>As a coder, I have realized and felt that often times, when creating an app or working on a project, I am more concerned about all the functionality of the app, and never too concerned about how it will look when completed. The end look of any app, in my opinion, is just as important as it’s purpose. Especially, if this app is going to be, or already is, available publicly, the appearance of the app is one of the most important features for a good user experience.</p><p>If the landing page of an app or is not pleasant to the user, then most likely, this will be the first and last time that this user will be visiting there. At the same time, if the landing page is not designed relevantly to the purpose of the site or app, that can also result in the user’s last visit. Therefore, I will discuss the basic ways to using CSS to designing your web app and I hope that they will help when you start to design your current or next app.</p><p>First, when you start designing your app, you should have a theme that will be persistent throughout. Meaning, if you have a color scheme that you are using, then those colors should be the same in all of your app. For example, if you have the background color of your landing page a specific color, then the background color of all of the other pages within this app should be the same color. Also, when choosing a color for a background, it is best to pick lighter duller shades, because they are less likely to put a strain on the user’s eyes.</p><p>Next, let’s discuss fonts. Often we will get carried away using many different fonts for different headings, titles, paragraphs, etc. Most of the times this is ok, but keep in mind that you want to make your app look professional. And in doing so, you should keep your count of different font styles to as low as possible. My advice would be to use at most two different fonts within an app. I say two, because, I feel that the navigation bar can have a different font style from the rest of the app’s text. An important thing to remember when choosing your font, is to make sure that it is easily legible; meaning, you should check the character height, spacing, and width, as well as the correct font size to make sure that the user will be able to easily read the text.</p><p>Another thing to keep in mind, when designing your app, is the layout of your app. They layout on your landing page sets the standard for the rest of your app. Therefore, if you have you navigation bar on the top of the screen in your app, then it should be at the same location throughout the app and not move around like to the side of the screen. The only time the navigation bar should move is if it’s designed to float on the screen, meaning, that you can scroll any which way, and the navigation bar will float along remaining on the same location on the screen.</p><p>Finally, one of the critical things to remember is not to go overboard when designing. At some point, you will want to show off your designing skill, but it is very easy to do too much; thus, you will add too much CSS and it can take away from the purpose of the app itself. You should always remember, when it comes to designing, keep it as clean as possible. You want to make your app look presentable, readable, and understandable. A users should not get confused when using your app. They should be able to navigate through and use you app with ease and not have any visual issues, concerns, or problems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=673a8f68ca0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Functional Component vs. Class Component]]></title>
            <link>https://medium.com/@farhanmahmoodny/functional-component-vs-class-component-9a2a67b2d062?source=rss-9db380806bda------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a2a67b2d062</guid>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Farhan Mahmood]]></dc:creator>
            <pubDate>Thu, 11 Apr 2019 17:19:01 GMT</pubDate>
            <atom:updated>2019-04-11T17:19:01.901Z</atom:updated>
            <content:encoded><![CDATA[<p>React allows the developer to define components in one of two ways: functional component or class component. And sometimes it can be hard to decipher which one to use in the app. In this blog, it is my intention to help you see the differences in the two types of components and obtain a better understanding of when to use which one.</p><p><strong>Functional Component</strong></p><p>Functional components’, also referred to as stateless components, main difference from class components is the lack of state and lifecycle methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*eWcC0Z7nKZy-FWDbBxlFxQ.png" /></figure><p>But what are the benefits of using functional components over class components? Mosh Hamedani, a software engineer from the age of seven and now a teacher, states, “Functional components are easier read in large part because you already know what they can’t do…”. This can be interpreted as since there is no state, lifecycle methods, it is easier to read the code within a functional component and understand what is going on.</p><p><strong>Class Component</strong></p><p>Class components are used whenever there is a need for a state, and/or lifecycle methods. Also, here is where you mount your data to save it in the state and pass class methods to child components. Also, class components need to be rendered in order to function properly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*C59THIMM6YNvA1tbBAeOtQ.png" /></figure><p>A class component, that does not need to have a state or any methods, can be converted into functional component, and vice versa, if a functional component needs to have a state or a method, it can be converted into a class component.</p><p><strong>Converting Components</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*41GSsKSjvQ88wDR2TLCsUA.png" /></figure><p>To convert functional component to a class component, as seen above, you have to first make it a class, declare a state, insert a render function and move the return inside of the render.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a2a67b2d062" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[selfCodingSkills]]></title>
            <link>https://medium.com/@farhanmahmoodny/selfcodingskills-1ec87d0fcfa5?source=rss-9db380806bda------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ec87d0fcfa5</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Farhan Mahmood]]></dc:creator>
            <pubDate>Thu, 21 Mar 2019 17:04:52 GMT</pubDate>
            <atom:updated>2019-03-21T17:04:52.679Z</atom:updated>
            <content:encoded><![CDATA[<p>As we get closer to graduating from FlatIron, it feels like I should have some ways of showing what I have learned and what my newly gained capabilities are. But how can I test my new skills?</p><p><strong>Confirming You Skills</strong></p><p>In the following blog, I will show some of the places, where you can test your newly acquired skill set. First, you might want to test your knowledge in a learning environment to see if everything that you’ve learned has really stuck with you. For that you can join <a href="http://theodinproject.com/">theodinproject.com</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*10Xeb2EMkpx1UfAEp28s-g.png" /></figure><p>This is a free learning environment, where you can sign-up and “relearn” or fully establish all that you have learned, here at FlatIron. But since we are fresh graduates, you can skip the readme and just go to the practicals and practice solving the problems that they provide.</p><p>Another learning environment is <a href="http://freecodecamp.org/">freecodecamp.org</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*QyFUmkgRs2q7JRab4bh3iw.jpeg" /></figure><p>This is another website where you can, again relearn or just skip to the practicals to work on your problem solving skills.</p><p><strong>Testing Your Skills</strong></p><p>If your confident in everything you have learned, and just want to practice without having to filter through the readme and other readings, you can join <a href="http://hackerrank.com/">hackerrank.com</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*ojyymiudWMXPYUTn4KQa6w.png" /></figure><p>Hacker rank is a problem solving environment, where you can sign up and pick a language and it will give you challenges to solve. It starts off on an easy level, testing from the basics, and gradually increases in difficulty. Here you can not just test you abilities, but you can see what your weak points are, and with some amount of work make them stronger.</p><p>Another website where you can test your skills is by joining <a href="http://codewars.com/">codewars.com</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*JKnTVQpjUXPvLd0SELatTg.png" /></figure><p>Here again you can see where you may or may not need help in your coding skills. As a plus, after each challenge, you can see how other people solved the same problems. The benefit of this is that you can learn to refactor your code in a better “cleaner” way, or just a whole different way all together, because theres often different ways to get to the same end result.</p><p><strong>Showing Your Skills</strong></p><p>The best part of all of the websites offering different learning environment is that you can sign-up for all of them with your GitHub account. This is a beneficial factor because you can save all the work that you have done under your profile there and be able to show your skills through this one profile, and you can put that one profile in your resume.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ec87d0fcfa5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Renaming in Rails]]></title>
            <link>https://medium.com/@farhanmahmoodny/renaming-in-rails-489d5256e536?source=rss-9db380806bda------2</link>
            <guid isPermaLink="false">https://medium.com/p/489d5256e536</guid>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[mvc]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Farhan Mahmood]]></dc:creator>
            <pubDate>Wed, 06 Mar 2019 02:46:49 GMT</pubDate>
            <atom:updated>2019-03-06T02:46:49.531Z</atom:updated>
            <content:encoded><![CDATA[<p>Any and everyone is capable of mistakes. Often, while we are coding, we don’t check the minor details. When we are writing multiple lines of code at a time, one of the most common mistakes we make is misspelling. Even one letter in a code can throw a monkey wrench in the code as a whole.</p><p>Whether you are creating a variable, method, class, module, etc. a misspell in creating or calling it can be very problematic. Often we don’t realize the mistake until we test our code, but by then you have completed pages of code. Or even worst, is when you are creating an app and realized that you want to change the name of one or all of your MVC.</p><p>Your first judgement will be to start from scratch and re-code everything. But the problem with that is that you have spent hours coding in all of your controllers, models, and views, and it would be very troublesome to restart and have to re-spend all that time to do it again. Instead, wouldn’t it be easier just to rename your MVC to what ever you decided to change them to? Yes!</p><p>This is when a ruby gem called “rails_refactor” becomes your new best-friend. Simply install it in your terminal by entering: “gem install rails_refactor”. Once installed, just restart your terminal and you are ready to rename any or all of your MVC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*6PncMOVBh0fBXhZte8po7Q.png" /></figure><p>Now, you don’t have to worry about trashing your app and starting all over again, or having to delete the MVC to recreate them as well as recreating your routes. By using the instructions above, its that easy to rename your MVC, and update your routes. But, sadly, it does not do all the work for you…</p><p>Even though, rails_refactor has renamed your model, controller, views directory, and updated your routes, there is still some work that you must do. When you look inside your controller, you will notice that the methods that you have coded are still the same. In the example below, you will notice that even though I changed the controller name from “PersonsController” to “UsersController”, the methods and variables with the controller are still the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*O-FxRytuJYcy9aXOdcFy_w.png" /></figure><p>But with the short-cut “cmd + d”, we can highlight all the places where we see the “Person”, “person”, and “persons”, and easily rewrite all of them without a problem. But we must make sure to do check for that in each controller that we renamed, as well as, any methods that we have coded in the model, change any association, and the codes on all the view files. Next, we will have to fix the schema.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*e0T9CLVtqAxlAXkomNMbjQ.png" /></figure><p>The table in the schema still says “persons”. We can easily fix that with a migration, but first, lets check the migration file. The migration filename, itself, can stay the same, without causing a problem, but the table-name has to be changed to “users”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*dIFA0EOzM3TWb6Dj8SuLIw.png" /></figure><p>Before running migration in your terminal, the easy thing to do would be to just delete the schema file, this way the migration will create a new schema with proper tables and databases.</p><p>Finally, if you have a seed file, we would have to change the code there as well. Here, again, we can use the short-cut “cmd + d” to highlight all the “Person” and rewrite them as “User”, as seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*OWu1Xy8pR7z-I3AeBZt1pg.png" /></figure><p>It may seem a bit troublesome to have to do all of that, but it can still save some time over having to redo all the work from beginning especially if you’ve spent hours coding, creating, testing, and debugging pages of code.</p><p>Resources: <a href="https://github.com/farhanmahmoodny/rails_refactor">https://github.com/farhanmahmoodny/rails_refactor</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=489d5256e536" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Basics of Writing “Clean” Code]]></title>
            <link>https://medium.com/@farhanmahmoodny/the-basics-of-writing-clean-code-502b5bb54816?source=rss-9db380806bda------2</link>
            <guid isPermaLink="false">https://medium.com/p/502b5bb54816</guid>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Farhan Mahmood]]></dc:creator>
            <pubDate>Wed, 13 Feb 2019 02:39:12 GMT</pubDate>
            <atom:updated>2019-02-13T02:39:12.847Z</atom:updated>
            <content:encoded><![CDATA[<p>Learning to code can be hard, but reading badly written code can be just as hard and aggravating. There are many different factors that can go into writing easily readable and understandable code, because majority of the time, the code we write is for someone else to read; therefore, the code that you write will reflect on your coding capabilities as well as elegance.</p><p>As you may have heard, we, as programmers, are lazy; thus, the code that we write will often look and reflect that statement. But even though, we may be called lazy, that does not mean that we do not know how to properly write executable code. One of my issues, when coding, is to write clean code, where anyone can read it and understand what it does. So here, I will talk about some steps I took to make my code clean.</p><h3><strong>Naming Convention</strong></h3><p>When writing your methods, you should always name your methods in an explanatory way; meaning, they should explain what that method does. This way when you are going through your code, you don’t have to run it in the terminal to remind you what that method does.</p><pre>#Bad coding</pre><pre>def a<br>  puts &quot;Hello, how are you?&quot;<br>end</pre><pre>def b<br>  puts &quot;Goodbye, and have a nice day!&quot;<br>end</pre><pre>#Good coding</pre><pre>def hello<br>  puts &quot;Hello, how are you?&quot;<br>end</pre><pre>def goodbye<br>  puts &quot;Goodbye, and have a nice day!&quot;<br>end</pre><p>Also, when naming your methods, you should use underscores(or snake-case) to separate the words. We cannot use space there, and camel-case is usually only used when defining classes or modules.</p><pre>#Bad coding</pre><pre>def putsagreeting<br>  puts &quot;Hello, how are you?<br>end</pre><pre>#Good coding</pre><pre>def puts_a_greeting<br>  puts &quot;Hello, how are you?<br>end</pre><h3><strong>Indentation inside the methods</strong></h3><p>This was one of my biggest downfalls, and it also made my code look sloppy. Indenting inside the method shows where one method starts and finishes. If you use iterators or enumerators in or outside your methods, they should also be indented properly so it can easily be read where it starts and ends.</p><pre>#Bad coding</pre><pre>array = [1, 2, 3, 4, 5]</pre><pre>def numbered_hello(array)<br>array.each do |num|<br>puts &quot;#{num}. Hello!&quot;<br>end<br>end</pre><pre>#Good coding</pre><pre>def numbered_hello(array)<br>  array.each do |num|<br>    puts &quot;#{num}. Hello!&quot;<br>  end<br>end</pre><h3>Testing your code</h3><p>Finally, if you are not working in an TDD, or Test Driven Development, it is your responsibility to make sure that your code is working properly, and is returning, or putting out, the results that are expected of it. It is always good practice to do so by running your code in the terminal with your own tests to be confirmed that there are no errors. Often times, it can be the simplest thing that can cause an error: misspelling somewhere, or calling wrong type of iterator, wrong number of parameters, or even not closing your method with an “end”.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=502b5bb54816" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>