<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Codingbrah Blog]]></title><description><![CDATA[Learn how to write sexy code lines 🤓
Discover new things 🤯
Develop your dev skills 🧐
Expand your love for Web Development 💜]]></description><link>https://blog.codingbrah.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1598564521116/jLaiwTV22.png</url><title>Codingbrah Blog</title><link>https://blog.codingbrah.com</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 20:40:32 GMT</lastBuildDate><atom:link href="https://blog.codingbrah.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[What Is Blockchain?]]></title><description><![CDATA[Hi, how is it going? 🤙
Today we're going to explore the topic of blockchain. If you're interested in cryptocurrencies you've probably heard of the word Blockchain, but what is it? Let me explain it to you in a nutshell. 🤓
Blockchain is a distribute...]]></description><link>https://blog.codingbrah.com/what-is-blockchain</link><guid isPermaLink="true">https://blog.codingbrah.com/what-is-blockchain</guid><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[Web3]]></category><dc:creator><![CDATA[Codingbrah]]></dc:creator><pubDate>Thu, 23 Jun 2022 11:58:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1655930774242/dNi2QoxhZ.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi, how is it going? 🤙</p>
<p>Today we're going to explore the topic of blockchain. If you're interested in cryptocurrencies you've probably heard of the word Blockchain, but what is it? Let me explain it to you in a nutshell. 🤓</p>
<p>Blockchain is a distributed database/state machine. This means that each network user holds a copy of this database locally - meaning the database is on more than one device. This database consists of records arranged in chronological order. This list consists of multiple data blocks, each block is linked to the previous and next block. The blocks document the time and order of transactions and they are linked in a way that makes it impossible to change the data or insert a new block between existing ones.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1655985410954/MtiUDX69m.png" alt="undraw_crypto_flowers_re_dyqo 1.png" /></p>
<h2 id="heading-who-participates-in-the-blockchain-network">Who participates in the Blockchain network?</h2>
<p>Anyone can join public networks such as Bitcoin or Ethereum and become part of them. This network is based on peer-to-peer (P2P). It connects users, transfers transactions ( which will be discussed later in the article ), and blocks of verified transactions. The network is always based on the standardized Gossip protocol.</p>
<h2 id="heading-blockchain-security">Blockchain security</h2>
<p>All blocks are secured by cryptographic evidence (e.g.: signatures) and blockchain data synchronization security is ensured by consensus algorithms such as Proof of Work (e.g.: ethash). Many people believe that Blockchain is safer than banks because there is no central actor to control your money.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1655985297693/FzkLYIL5f.png" alt="Group 8.png" /></p>
<h2 id="heading-but-what-is-held-in-these-blocks">But what is held in these blocks?</h2>
<p>The blocks hold the transactions that make up the current state of the entire blockchain. What are transactions? They have verified changes in the state of the main state machine/database ( ie: the main ETH blockchain, for example). The transactions that are in the blockchain are verified by other users of the blockchain network.</p>
<p>Blockchain usually also has a reward system implemented based on providing its computing power for computations so-called: mining.</p>
<h2 id="heading-summary">Summary</h2>
<ul>
<li>blockchain is a database distributed among the users of the network</li>
<li>it consists of blocks that are arranged chronologically and each block has one preceding and one following</li>
<li>any user may introduce a change to the blockchain, through transactions</li>
<li>for a chance to be introduced to the blockchain, it must be verified</li>
<li>by participating in the blockchain network we can share computing power, that is, to do so-called mining</li>
</ul>
<p>And that in a nutshell is blockchain, in the next posts of the #IntroToCrypto series on the #codingbrah blog we will go much deeper into this topic.</p>
<p>Farewell 👋</p>
<p><strong>Bonus</strong>: A very good demo on how blockchain works can be found here → <a target="_blank" href="https://andersbrownworth.com/blockchain/blockchain">https://andersbrownworth.com/blockchain/blockchain</a></p>
<p>~ <a target="_blank" href="https://www.linkedin.com/in/kacperszarkiewicz/">Kacper</a></p>
]]></content:encoded></item><item><title><![CDATA[Create React App vs Next.js - THE BIG CLASH]]></title><description><![CDATA[Introduction 🤓
Yo, yo, yo! Guess who's back?! 🤙 I've not been posting here for some long amount of time 😅. However, it's time to change that! I won't be able to post here daily as I've got a lot of side projects, but I'll try my best to be more ac...]]></description><link>https://blog.codingbrah.com/create-react-app-vs-nextjs-the-big-clash</link><guid isPermaLink="true">https://blog.codingbrah.com/create-react-app-vs-nextjs-the-big-clash</guid><category><![CDATA[React]]></category><category><![CDATA[Next.js]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[coding]]></category><dc:creator><![CDATA[Codingbrah]]></dc:creator><pubDate>Tue, 23 Mar 2021 13:45:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1616506247845/SQwJaMY5R.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="introduction">Introduction 🤓</h2>
<p>Yo, yo, yo! Guess who's back?! 🤙 I've not been posting here for some long amount of time 😅. However, it's time to change that! I won't be able to post here daily as I've got a lot of side projects, but I'll try my best to be more active! This post is quite short, but it should be enough to cover the subject. If not, then let me know in the comments what else you want to know 😃. Ok, let's get back to the topic! 🔥</p>
<p><img src="https://media.giphy.com/media/StoeNoDkYuum8cj8MV/giphy.gif" alt="I'm back baby GIF" /></p>
<h2 id="create-react-app-vs-nextjs">Create React App vs NextJS</h2>
<p>Many developers are questioning themselves if they should use either Create React App (CRA) or NextJS to create a project. In this post, I’ll give you a quick overview of Create React App and NextJS, show some pros and cons of each, and then I’ll point out in which case I would use them. However, you should know that they are kind of different technologies, so I won’t strictly compare them.<br />Also, you must remember that there are no bad or good technologies (except PHP - it’s bad 😝 ). Everything depends on the need of the project. </p>
<h2 id="create-react-app">Create React App</h2>
<p><strong>Create React App</strong> is a standalone command-line tool used to generate a new React project. Project created with Create React App is using client-side rendering (CSR) solution. That means the browser gets mostly an empty HTML document with just links to your CSS and JavaScript bundles. In this case, the user will need to wait for all bundles to load and then have the virtual DOM moved to the browser DOM for the page to be viewable.</p>
<h2 id="nextjs">NextJS</h2>
<p><strong>NextJS</strong> is a framework that is built on top of React library. It was developed by Vercel (formerly Zeit). It uses a server-side rendering (SSR) solution to render the project in the browser. In this case, the browser will receive from the server’s response a ready-to-be rendered HTML document of the page. That means the user can start viewing the page while the process of building a virtual DOM and attaching events is in progress. Also, there is a command-line tool called Create Next App, which bootstraps a Next.js app.</p>
<h2 id="create-react-app-pros">Create React App - Pros</h2>
<p><strong>Pros</strong></p>
<ul>
<li>You can host your app on any file host as it’s rendered on client-side</li>
<li>Website is rendered pretty fast after the initial slow load</li>
<li>Avoids constant full page reloads</li>
<li>Only one build dependency - react-scripts</li>
<li>Supports TypeScript out of the box</li>
<li>It’s very well maintained</li>
</ul>
<h2 id="create-react-app-cons">Create React App - Cons</h2>
<p><strong>Cons</strong></p>
<ul>
<li>Initial load time can be slow due to the requirement of rendering the JS bundles</li>
<li>It has a negative impact on SEO, which can be solved using pre-renderer</li>
<li>Client-side rendering causes higher memory consumption on client-side devices</li>
<li>It’s quite hard to add custom build configs</li>
</ul>
<h2 id="nextjs-pros">NextJS - Pros</h2>
<p><strong>Pros</strong></p>
<ul>
<li>SEO is not impacted due to HTML being rendered on the server-side and directly passed to the browser</li>
<li>It provides an easy-to-use routing system out of the box</li>
<li>Initial page load is crazy fast - the advantage of SSR</li>
<li>It’s kind of easy to deploy when using the Vercel platform (CI/CD provided)</li>
<li>Easy to add custom build configs</li>
<li>Supports TypeScript out of the box</li>
<li>It’s very well maintained</li>
</ul>
<h2 id="nextjs-cons">NextJS - Cons</h2>
<p><strong>Cons</strong></p>
<ul>
<li>Higher server consumption as every page load is rendered on the server-side. However, this can be reduced by cache implementation.</li>
<li>Higher server consumption increase its cost</li>
<li>It’s hard to customize provided routing system if there is such a need</li>
</ul>
<h2 id="when-to-use-each">When to use each?</h2>
<p><strong>React</strong></p>
<p>When building web applications or gated web applications (the ones that can be accessed only after login).</p>
<p><strong>NextJS</strong></p>
<p>When building a landing page, eCommerce shop, marketing website, or another website where we care about SEO.</p>
<h2 id="meme-for-today">Meme for today</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1616506075740/pCFh5fPGr.png" alt="image.png" /></p>
]]></content:encoded></item><item><title><![CDATA[What Is Service Worker?]]></title><description><![CDATA[What is a Service Worker? 🤔
Service Worker is just a fancy Web Worker. The difference is, it’s actually placed between your application and the third party services. You can consider it as a kind of middleware function that can parse all requests an...]]></description><link>https://blog.codingbrah.com/what-is-service-worker</link><guid isPermaLink="true">https://blog.codingbrah.com/what-is-service-worker</guid><category><![CDATA[2Articles1Week]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Service Workers]]></category><category><![CDATA[General Programming]]></category><dc:creator><![CDATA[Codingbrah]]></dc:creator><pubDate>Mon, 28 Sep 2020 15:01:05 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1601305041498/SzTviYAVE.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="what-is-a-service-worker">What is a Service Worker? 🤔</h2>
<p><strong>Service Worker</strong> is just a fancy <strong>Web Worker</strong>. The difference is, it’s actually placed between your application and the third party services. You can consider it as a kind of middleware function that can parse all requests and do something with data.</p>
<p><strong>Service Workers</strong> are a concept a lot more complicated than regular <strong>Web Workers</strong>. That’s why today we’ll focus just on understanding the base concepts and use cases. In the following posts, we’ll dive deeper into implementation details.</p>
<h2 id="difference-between-service-workers-and-web-workers">Difference between Service Workers and Web Workers 🧐</h2>
<p>The major difference between <strong>Service Workers</strong> and <strong>Web Workers</strong> is that <strong>Service Workers</strong> are persistent. They don’t erase when you close tabs. They’re not even cleared up when you close your browser. When you think about it, it’s a really powerful concept that allows you to use your creativity in a completely different way.</p>
<p>The most important thing you have to remember is that the <strong>Service Worker</strong> is just a JavaScript application that is running on the browser. This way we have the ability to use some native browser APIs to handle different use cases in our application.</p>
<h2 id="push-notification">Push Notification 🔥</h2>
<p>Thanks to <strong>Notification API</strong>, <strong>Service Worker</strong> can send messages from the browser even if the page isn’t opened. It can be super useful when we want to notify the user about some new activities on his profile, new blog posts, or maybe new discounts in our shop.</p>
<p>One thing we have to remember, the user has to grant the application the right to send notifications. It’s really important from the UX point of view, to not throw these request permission alerts directly when a user shows on our page. We should do this more intelligent after the user is engaged in some activities and he understands the benefits from this feature.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1601301636292/tTRPnVwjM.png" alt="image.png" /></p>
<h2 id="offline-app">Offline App 🤯</h2>
<p>Probably the most widely used use case is to create the ability to use your application without an internet connection. That sounds ridiculous (🤯) at first, but when you think about it, it totally makes sense. Using <strong>Cache API</strong> you can store necessary files from your application, for example, HTML, CSS, and JS. </p>
<p>We can even indicate to the user that he is in the offline mode and provide some user-friendly alerts telling that he can’t use any POST requests. </p>
<p>But what if the user wants to prepare POST request being offline? 🤔</p>
<h2 id="temporarily-storing-data">Temporarily storing data 🤓</h2>
<p>Imagine the following scenario. After writing a long post you want to publish it to the page. Unfortunately, when we clicked the submit button, it turns out we haven’t had an internet connection 😱</p>
<p>In most cases, you’d seen this cool but also unproductive dinosaur 🦖 mini-game or some other browser indicators when you wanted to get access to the page without the proper internet connection.</p>
<p>Thanks to <strong>Service Workers</strong> you can avoid this issue. Imagine this scenario in a different way: you click the button and then you see an elegant, clean message that your data has been successfully saved in a browser but, because you don’t have access to the internet right now it can’t be sent. It also informs you that as soon as you reconnect your data will be immediately sent to the server. This way sounds much cooler, right? 😎</p>
<h2 id="summary">Summary 🥺</h2>
<p>That’s it for now 🤓. As I mentioned at the beginning, <strong>Service Workers</strong> are a much more complex concept. </p>
<p>Right now, we’ve just scratched the surface, soon we’ll learn the implementation details and how to turn these brilliant ideas into products 😉.
Stay tuned and have a nice day! 🤙</p>
]]></content:encoded></item><item><title><![CDATA[5 React Good Practices]]></title><description><![CDATA[What's up, everyone!? 🤙
Recently, I'm not that active here, but this is due to a lot of work that I have 🤓 I'm working on a couple of projects on which I will share more in near future (one of the projects is a game build with React Native - siiiic...]]></description><link>https://blog.codingbrah.com/5-react-good-practices</link><guid isPermaLink="true">https://blog.codingbrah.com/5-react-good-practices</guid><category><![CDATA[2Articles1Week]]></category><category><![CDATA[React]]></category><category><![CDATA[Programming Tips]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Codingbrah]]></dc:creator><pubDate>Mon, 21 Sep 2020 10:59:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1600686243615/95QmKgJql.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="whats-up-everyone">What's up, everyone!? 🤙</h2>
<p>Recently, I'm not that active here, but this is due to a lot of work that I have 🤓 I'm working on a couple of projects on which I will share more in near future (one of the projects is a game build with React Native - siiiick! 🤯). </p>
<p>Ok, let's get back to the topic! <strong>5 React good practices!</strong> 🔥</p>
<h2 id="1-remember-to-keep-your-components-small-and-function-specific">#1 Remember to keep your components small and function-specific</h2>
<p>I think we all have been at least once in a project that is a total mess when it comes to its file and folder structure. 
This uncontrolled mess can be changed by keeping your components small and dividing them by a logic/function that they handle. A single component should render just a specific element of your page or handle particular behavior. This approach will help you in keeping your code fresh and clean! </p>
<p>Also, it will help in better maintaining your tests, so it’ll be easier to catch a bug and most importantly it will help you and your co-workers to understand easier the code you wrote (especially when you go back to it after some long period 😜 ). As <strong>John Wood</strong> once said:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1600617706857/PdbF37bYZ.png" alt="image.png" /></p>
<h2 id="2-consider-using-or-not-dry-principle-when-creating-methods">#2 Consider using (or not 🤔 ) <strong>DRY</strong> principle when creating methods</h2>
<p>One of the popular principles out there is <strong>DRY</strong>. It is recommended to use everywhere, like literally everywhere. Even if you ask your neighbor Steven, he’ll also recommend it to you. If you’re not familiar with <strong>DRY</strong>, then let me quickly explain it. As you have already seen in the title <strong>DRY</strong> means <strong>Don’t Repeat Yourself</strong>. Simply said it’s a principle that encourages us to create reusable functions, so they’ll be not repeated within our code. The opposite of the <strong>DRY</strong> principle is WET (Write Everything Twice or also known as Waste Everyone’s Time). It is usually trashed, by others, because it encourages you to write duplicated code. </p>
<p>Also, some time ago Kent C. Dodds presented a new “principal” (it’s more like philosophy) called <strong>AHA</strong> (<strong>Avoid Hasty Abstractions</strong>). This “principle” states that “you shouldn’t be dogmatic about when you start writing abstractions but instead write the abstraction when it feels right and don’t be afraid to duplicate code until you get there”. I think it’s worth checking it out. Link below:
https://kentcdodds.com/blog/aha-programming</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1600685791432/fnxcl7cE4.png" alt="image.png" /></p>
<h2 id="3-in-most-cases-try-to-use-controlled-components-instead-of-uncontrolled-ones">#3 In most cases try to use controlled components instead of uncontrolled ones.</h2>
<p>I’m going to start with a quick explanation, as maybe some of you are wondering now "<em>what the hell are controlled and uncontrolled components?</em> 🤔" Ok, so both are used only in a form element, and being more specific they are used in the input, textarea, and select elements. Controlled components are the ones that value is maintained by React’s local state, so in this case, we’re achieving a “single source of truth”. On the other hand, uncontrolled components are components that DOM uses itself to handle data from a form. Both solutions give you the possibility to have one-time value retrieval and validation on submit. However, only controlled components are the ones that should be used in the case when you need instant field validation, conditionally disabling the submit button, enforcing specific input format, or for example creating dynamic inputs. The only case where usage of uncontrolled components is a must is an input element with a “file” type. In this element, the value can be only set by a user, and not programmatically.</p>
<h2 id="4-write-tests-for-your-components">#4 Write tests for your components</h2>
<p>You’ve got an error and don’t know where it comes from? 
I think that’s a good reason to start writing tests for your components 😜 .</p>
<p>Well written tests are not only preventing you from having bugs but also improves the quality of the code. Moreover, it will provide you documentation as you will have every functionality of the method described. Also, it will simplify the debugging process as if a test fails, then only the latest changes made in the code will need to be debugged. I can keep writing more and more advantages of writing tests, but this is not the case here. Just remember to not be lazy and start writing those tests! 😜</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1600619657179/N-7NeF4Vq.png" alt="image.png" /></p>
<h2 id="5-use-react-proptypes-or-typescript">#5 Use React PropTypes or TypeScript</h2>
<p>Type checking alongside tests is very useful to keep your code out of bugs 🐛 . It is used to make sure that data you receive is valid (ex. method that should take as an argument a string value, didn’t receive an object instead). Also, using type checkers you create some kind of documentation for you as you’re defining what type of data the function takes as input and what type of data it returns as output. That helps later on for example when doing refactoring or just to help other co-workers to understand your code better! For type checking, you can use PropTypes, which is a small library for checking React props and similar objects, but if you want to go total badass 🤟, you can use TypeScript, which is an open-source programming language. </p>
<p>I will do a separate article on those two, but the difference that you should know for now is that PropTypes is type checking at runtime and Typescript validate the types at the time of compilation.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1600619792141/tGKbW-oMO.png" alt="image.png" /></p>
<h2 id="the-end">The End 🥺</h2>
<p>That's it for today! 🤓 Feel free to drop a comment or like if you found this post useful! 😊 Also, let me know if you would add something else to this list! 🤙</p>
]]></content:encoded></item><item><title><![CDATA[5 Tips On How To Improve Accessibility On Your Website]]></title><description><![CDATA[5 Tips On How To Improve Accessibility On Your Website
What's up, everyone!? 🤙 I haven't posted for a while, but... I'm back! 🤟 Today I'm going to give you 5 tips on how to easily improve accessibility on your website! 🤓
#1 Use semantic HTML tags
...]]></description><link>https://blog.codingbrah.com/5-tips-on-how-to-improve-accessibility-on-your-website</link><guid isPermaLink="true">https://blog.codingbrah.com/5-tips-on-how-to-improve-accessibility-on-your-website</guid><category><![CDATA[programming]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[2Articles1Week]]></category><category><![CDATA[HTML]]></category><category><![CDATA[Developer]]></category><dc:creator><![CDATA[Codingbrah]]></dc:creator><pubDate>Tue, 15 Sep 2020 10:04:05 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1600120085153/kVTUTQOdx.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="5-tips-on-how-to-improve-accessibility-on-your-website">5 Tips On How To Improve Accessibility On Your Website</h1>
<p>What's up, everyone!? 🤙 I haven't posted for a while, but... I'm back! 🤟 Today I'm going to give you 5 tips on how to easily improve accessibility on your website! 🤓</p>
<h2 id="1-use-semantic-html-tags">#1 Use semantic HTML tags</h2>
<p>Semantic HTML tags are very essential because when a screen reader or any other sort of assistive device scans a web page, it gets information about the Document Object Model (DOM), or the HTML structure of the page. </p>
<p>HTML elements that you should consider using when creating any page are <strong>header</strong>, <strong>nav</strong>, <strong>main</strong>, <strong>article</strong>, <strong>aside</strong>, <strong>footer</strong>. Elements like <strong>div</strong> or <strong>span</strong> are recommended to be used only for layout purpose.</p>
<p>When it comes to the headings, it’s recommended to use one <strong>h1</strong> tag per page, and it should match the page title. Other headings should logically represent the page content for screen readers, so they will read the website like kind of a book.</p>
<h2 id="2-include-alt-attribute-in-img-elements">#2 Include alt attribute in img elements</h2>
<p>Let’s start with what is alt attribute. When it comes to accessibility, alt text is used in screen readers to better understand an on-page image. However, it also helps in other cases. For example, it will show up in place of an image when the image can’t be loaded and it is also used to provide better image descriptions to search engine crawlers, which helps them to index an image properly.</p>
<p><strong>How to write good alt text?</strong></p>
<ul>
<li><p>Describe the image as precisely as you can</p>
</li>
<li><p>Keep it short (let’s say around 125 characters)</p>
</li>
<li><p>Avoid keyword stuffing</p>
</li>
<li><p>Don’t include “photo of”, “image of” etc.,</p>
</li>
<li><p>Use longdesc=“” when you need to describe more complex images, which require a longer description</p>
</li>
<li><p>Image buttons should have an alt attribute that describes the function of the button i.e.: “sign up”.   </p>
</li>
</ul>
<h2 id="3-use-aria-for-non-standard-interactive-elements">#3 Use ARIA for non-standard interactive elements</h2>
<p>Accessible Rich Internet Applications (ARIA) is a set of attributes, which define ways to make content and web apps more accessible to people with disabilities. It gives HTML the possibility so that interactions and widgets commonly used in applications can be passed to assistive technologies when there is not otherwise a mechanism.</p>
<p>HTML5 semantic elements already have built-in ARIA elements, so you don’t need to worry about it in case of them! </p>
<p>Example of ARIA properly used:</p>
<pre><code><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">“percent-loaded”</span> <span class="hljs-attr">role</span>=<span class="hljs-string">“progressbar”</span> <span class="hljs-attr">aria-valuenow</span>=<span class="hljs-string">“75”</span> 
     <span class="hljs-attr">aria-valuemin</span>=<span class="hljs-string">“0”</span> <span class="hljs-attr">aria-valuemax</span>=<span class="hljs-string">“100”</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre><h2 id="4-try-to-avoid-the-captcha">#4 Try to avoid the CAPTCHA</h2>
<p>Probably all of us were accused of being a robot more than a once. I’m not risking to say that we all love CAPTCHA as much as we love PHP 💜. However, when it comes to accessibility, it’s good to not implement CAPTCHA at all 🤓.</p>
<p>In case if you really, really need it then have in mind to make it simple to understand and to include alternatives for users with disabilities, such as: </p>
<ul>
<li>Providing more than two ways to solve the CAPTCHAs</li>
<li>Providing access to a human representative who can bypass CAPTCHA</li>
<li>Not requiring CAPTCHAs for authorized users</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1600119713238/-zvk9NIR1.png" alt="image.png" /></p>
<h2 id="5-associate-labels-with-form-controls">#5 Associate labels with form controls</h2>
<p>Labels ale really important when it comes to the forms. They’re describing the purpose of the form control. Therefore you should provide labels to identify all form controls, including text fields, checkboxes, radio buttons, and drop-down menus. In most cases, this is done by using the <strong>label</strong> element.</p>
<p>Example:</p>
<pre><code><span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">“firstname”</span>&gt;</span>First name:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">“text”</span> <span class="hljs-attr">name</span>=<span class="hljs-string">“firstname”</span> <span class="hljs-attr">id</span>=<span class="hljs-string">“firstname”</span>&gt;</span>
</code></pre><p>However, if you want to hide the label as its purpose is clear from the surrounding content, then it’s recommended to use aria-label or aria-labelledby, so the form controls could be easily described by screen readers and other assistive technology. </p>
<p>Example:</p>
<pre><code><span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">“text”</span> <span class="hljs-attr">name</span>=<span class="hljs-string">“search”</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">“Search”</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">“submit”</span>&gt;</span>Search<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">“text”</span> <span class="hljs-attr">name</span>=<span class="hljs-string">“search”</span> <span class="hljs-attr">aria-labelledby</span>=<span class="hljs-string">“searchbutton”</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">“searchbutton”</span> <span class="hljs-attr">type</span>=<span class="hljs-string">“submit”</span>&gt;</span>Search<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
</code></pre><h3 id="would-you-add-something-to-this-list">Would you add something to this list? 🧐</h3>
<h3 id="feel-free-to-share-your-tips-in-the-comments">Feel free to share your tips in the comments! 😄</h3>
]]></content:encoded></item><item><title><![CDATA[6 Tips On How To Improve SEO On Your Website]]></title><description><![CDATA[6 Tips On How To Improve SEO On Your Website
What's up, everyone!? 🤙 Today I'm going to give you 6 tips on how to easily improve SEO on your website! 🤓
#1 Use Title tag
The HTML title tag is probably the most important (if not the most important) e...]]></description><link>https://blog.codingbrah.com/6-tips-on-how-to-improve-seo-on-your-website</link><guid isPermaLink="true">https://blog.codingbrah.com/6-tips-on-how-to-improve-seo-on-your-website</guid><category><![CDATA[SEO]]></category><category><![CDATA[programming]]></category><category><![CDATA[2Articles1Week]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[100DaysOfCode]]></category><dc:creator><![CDATA[Codingbrah]]></dc:creator><pubDate>Mon, 31 Aug 2020 12:34:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1598820764807/bqeL3P1Sb.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="6-tips-on-how-to-improve-seo-on-your-website">6 Tips On How To Improve SEO On Your Website</h1>
<p>What's up, everyone!? 🤙 Today I'm going to give you 6 tips on how to easily improve SEO on your website! 🤓</p>
<h2 id="1-use-title-tag">#1 Use Title tag</h2>
<p>The HTML title tag is probably the most important (if not the most important) element on any web page. Title tags are displayed on search engine results pages as the clickable headline for a given result and are important for usability, SEO, and social sharing.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1598815254812/va_V3GMhP.png" alt="image.png" /></p>
<p>What to consider to write a <strong>good title</strong>?</p>
<ul>
<li><strong>Title length</strong> - if the title is too long it may be cut off by the search engine (“…” will be added at the end). This could possibly impact your title as important words may be omitted. It’s hard to define the exact limit of characters but based on my research it's about 50-60.</li>
<li><strong>Avoid stuffing keywords</strong> - titles with just a list of keywords are bad for search users and can be bad for search engines</li>
<li><strong>Create a unique title for every page</strong> - this helps search engines to understand that content on our web page is unique and valuable, and also drive higher click-through rates. You can use this example format for your titles:</li>
</ul>
<p><strong>Primary keyword - Secondary keyword | Brand name</strong></p>
<p><strong>Sexy black sandals - Shoes | Urban Clothing</strong></p>
<h2 id="2-use-open-graph-protocol">#2 Use <strong>Open Graph</strong> protocol</h2>
<p><strong>Open Graph</strong> meta tags are helping to control how the URL of your website is displayed when shared on social media. They need to be placed in  of your web page.</p>
<p>Why they are so important?</p>
<ul>
<li><p>They make content more eye-catching, which can improve click-through rates on your site.</p>
</li>
<li><p>They help you to provide more information about the content on the web page</p>
</li>
<li><p>They help to understand Facebook and other social platforms what the content is about, which may help you to increase your brand visibility</p>
</li>
</ul>
<p>Basic <strong>Open Graph</strong> meta tags:</p>
<ul>
<li><p>og:title - Title of your web page. It shouldn’t be too long (stick to 50-60 characters as in title tag).</p>
</li>
<li><p>og:type - The type of your object i.e. article, video, etc.</p>
</li>
<li><p>og:image - An image URL, which should represent your object within the graph. For optimal clarity across all devices use 1200x630 dimensions.</p>
</li>
<li><p>og:url - The canonical URL of your web page   </p>
</li>
</ul>
<p>For more tags see official Open Graph protocol docs:
https://ogp.me/</p>
<h2 id="3-use-meta-description-tag">#3 Use meta description tag</h2>
<p>The <strong>meta description</strong> is the second thing that you see underneath the title tag in any search engine result. This element can have an effect on whether someone clicks on your link to check your content. Keep it meaningful and don’t stuff keywords - it should describe what can be found on the web page. Also, remember to have different descriptions on every page.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1598819580065/oUmPMakGz.png" alt="image.png" /></p>
<h2 id="4-keep-your-url-structure-simple">#4 Keep your URL structure simple</h2>
<p>The <strong>URL structure</strong> of your site should be as simple as possible. URLs should be constructed logically and they should be easily understandable for humans (when it’s possible to use the readable word rather than long ID numbers). Also, it’s recommended by Google to use hyphens instead of 
 underscores.</p>
<p>Example:<br />
https://www.example.com/blog/first-blog-post.html</p>
<h2 id="5-use-noreferrer-nofollow-and-canonical-for-anchor-tag-rel-attribute">#5 Use noreferrer, nofollow and canonical for anchor tag rel attribute</h2>
<p><strong>noreferrer</strong> has no direct impact on SEO, but it does have an indirect effect on your link building and promotion efforts. It prevents passing the referrer information to the target website by removing the referral info from the HTTP header. Explaining further, that means if someone arrives at your site from a link that uses this link type, your analytics won’t show who referred that link. Also, noreferrer prevents a JavaScript exploit involving window.opener. However, remember to not use it on internal links as it can mess up with your analytics reports.</p>
<p><strong>nofollow </strong> tells search engines not to follow the link to the next page and therefore shouldn’t pass any link authority to the link target. It’s recommended to use it for: links in comments or on forums, advertisements, and sponsored links, paid links.</p>
<p><strong>cannonical</strong> helps to prevent duplicate content issues. What that means is, if you have several versions of the same content, you pick one canonical and point the search engines at it. It improves SEO because the search engine knows which version is canonical and can count all the links pointing at the different versions as links to the canonical version. </p>
<h2 id="6-use-alt-tag-in-the-img-element">#6 Use alt tag in the img element</h2>
<p>I’ve already mentioned that alt tags improve accessibility on your site in the previous post. However, it can also impact the SEO of your website! Using an alt tag helps search crawlers to understand what is shown on the image. </p>
<p>When it comes to writing good alt text, the rules are the same as described in the accessibility post: </p>
<ul>
<li>Describe the image as precisely as you can</li>
<li>Keep it short (let’s say around 125 characters)</li>
<li>Avoid keyword stuffing</li>
<li>Don’t include “photo of”, “image of” etc.,</li>
<li>Use longdesc=“” when you need to describe more complex images, which require a longer description</li>
<li>Image buttons should have an alt attribute that describes the function of the button i.e.: “sign up”</li>
</ul>
<h2 id="summary">Summary</h2>
<p>That's it for this post! 🤙 
Let me know in the comments if you liked it and if you already use those basic tips in your daily job 🤓</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1598877122947/k4riNZKo7.png" alt="image.png" /></p>
]]></content:encoded></item><item><title><![CDATA[What Is Big O?]]></title><description><![CDATA[What is big O?
What's up, everyone!? 🤙
Today we’ll dive deeper into time complexity and the big O notation. There are a number of factors that have an impact on the time complexity, in other words how fast our application would be.
There is one impo...]]></description><link>https://blog.codingbrah.com/what-is-big-o</link><guid isPermaLink="true">https://blog.codingbrah.com/what-is-big-o</guid><category><![CDATA[2Articles1Week]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Node.js]]></category><category><![CDATA[React]]></category><category><![CDATA[100DaysOfCode]]></category><dc:creator><![CDATA[Codingbrah]]></dc:creator><pubDate>Fri, 28 Aug 2020 16:07:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1598630064619/TNbtjf_Ce.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="what-is-big-o">What is big O?</h1>
<p>What's up, everyone!? 🤙
Today we’ll dive deeper into time complexity and the big O notation. There are a number of factors that have an impact on the time complexity, in other words how fast our application would be.</p>
<p>There is one important thing we have to keep in mind. There are two different types of complexity: <strong>Space</strong> and <strong>Time</strong>. The first one is related to how much memory our application uses, the second one describes how many operations our application executes (we must keep in mind, that JavaScript as a language is single-threaded so the overall number of operations is important but also the time complexity of particular operation matters).</p>
<p>Today we’ll talk about Time Complexity. Or, rather, something more, that can effectively describe our Time Complexity - big O notation.</p>
<p>Easily speaking, the big O notation allows us to estimate if our code is fast or slow. Well, “fast” and “slow” are not enough, in most cases, we should look at how our algorithm will behave on the scale.</p>
<p>What if 1000000000 users will open our website (ok, probably even 
Netflix isn’t prepared for those types of numbers 😂 ).
<br />
What if our loop has to handle 1000000000 elements in our array?
<br />
What if this array would have 100 nested arrays inside?
<br />
What if I stop giving those ridiculous examples? 🧐</p>
<p>In today’s post, we’ll answer all these questions!
Ok, so let’s go through all of the most popular complexities. </p>
<h2 id="constant-o1">Constant - O(1)</h2>
<p>The easiest to understand (and the fastest!) is the constant order. What does it mean? Our operation will ALWAYS take the same amount of time. This is the most desirable type of order because it’s the most predictable. We always know how our algorithm would behave and how can it affect our performance. We also don’t have to write complicated test cases because we know that every single one will always work the same way! Ok, so you probably asking which kind of operations are O(1)? These ones, which can reach the appropriate memory area without the need for searching.</p>
<p>Examples:</p>
<pre><code class="lang-javascript">array[<span class="hljs-number">2</span>] <span class="hljs-comment">// give me this third element of an array</span>
object.property <span class="hljs-comment">// give me this property of this particular object</span>
</code></pre>
<p>Every primitive operation like sum, subtraction, etc.</p>
<p>But there are some tricky ones. What about shift operation? Theoretically, all it does is removing the first element of an array. So you might think that our intelligent thread knows exactly where to go. Although it actually removes only the first element, it also has to change the order of all others. The second element will be first, third will be second, etc.</p>
<h2 id="linear-on">Linear - O(n)</h2>
<p>In this case, the number of operation that has to take place is proportional to the number of inputs. If they are the same, the complexity would be O(n), if they are two times larger, it would be O(2*n). It doesn’t matter that much because the scale remains the same. This complexity is obviously slower than the constant one but at the end of the day, it’s pretty common. I mean, probably every website has some operations that have this complexity. The simplest and easiest to understand the form of this one is the loop. ForEach, Map, For, While, there are many different types but at the end of the day they all work the same way.</p>
<h2 id="logarithmic-ologn">Logarithmic - O(logn)</h2>
<p>Ok, so this one sounds interesting. All you need to know is, in this case, the number of operations is decreasing when the number of your inputs grow. Imagine the loop which in the first iteration you have to proceed 100 operations, in the second one 50, in the third 25, etc. The fraction doesn’t matter that much, because again - the only thing that matters is scaling. As you may imagine this one is pretty good because it grows very slowly. It means, it’s better than the linear one but worst (slower) than the constant one. Ultimately this is the one that is, the most desirable among all developers.</p>
<h2 id="big-o-complexity-chart">Big-O complexity chart</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1598628480266/_1AfZHQRw.png" alt="image.png" /></p>
<p>Ok, so now, when we’ve described all good ones (constant, logarithmic) and all average ones (linear), let's talk about one of which you should avoid in many cases.</p>
<h2 id="quadraticcubed-onon">Quadratic/Cubed - O(n²)/O(n³)</h2>
<p>There isn’t that much to talk about. It’s just a loop inside a loop. That’s it. </p>
<p>Every time, when we put a loop inside a loop our complexity is multiplied by n. 
So for example:</p>
<pre><code class="lang-javascript">array.map(a =&gt; a.map(b =&gt; b.map(c =&gt; c.prop)))
</code></pre>
<p>would have the complexity of n³.</p>
<p>As you probably can imagine this approach of nesting loops can put you in some serious problems if it’d get out of control.</p>
<p>That’s why we should always be aware of what we’re putting inside a loop. </p>
<p>Sometimes we don’t even realize that we’re creating the quadratic complexity. Take look at this example:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> isGreaterThan = value =&gt; element =&gt; ( element &gt; value );
array.map(element =&gt; element.find(isGreaterThan(<span class="hljs-number">10</span>)));
</code></pre>
<p>What with this example? Theoretically, we have just one loop (map) but notice, that the find function works exactly like a loop. It doesn’t just point this particular value (it’d be a constant complexity then). </p>
<p>It literally goes from first to the last index searching for this particular value. What if this value would have the last index? </p>
<p>Remember, in terms of the big O notation we always look at the worst possible case. You must always remember to pay more attention when you deal with an array inside a loop.</p>
<p>Some of the tricky functions:</p>
<ul>
<li>every</li>
<li>filter</li>
<li>find</li>
<li>includes</li>
<li>reduce</li>
</ul>
<p>Especially you should pay attention to array sorting algorithms. Bubble sort, selection sort, quick-sort in the worst-case scenario can cost you a lot of time. In many cases, it is more effective to implement an algorithm based on the recursion (although it’s better in terms of time complexity, space complexity grows).</p>
<p>There also are some totally sick complexities like O(2ⁿ) or O(n!). They are not that common so I’ll not spend much time describing it. I just want to mention the real-life example (just for fulfilling your curiosity).
They’re basically all brute force algorithms when you want to find the particular value testing every possible combination (usable if you want to break a password).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1598628886423/77BScTaLS.png" alt="image.png" /></p>
<h2 id="summary">Summary</h2>
<p>That’s it for today. At the beginning of this post, I've mentioned that big O notation is something only related to the Time Complexity. 
Sike! 😜 That’s not entirely true, it’s used to describe all complexities, but it’s mostly used in terms of time. </p>
<p>I strongly encourage you to check out this website:
https://www.bigocheatsheet.com/</p>
]]></content:encoded></item><item><title><![CDATA[What are Data Structures in JavaScript?]]></title><description><![CDATA[Hey, hey hey! 🤟 
Today I want to take a look into some basic JavaScript Data Structures. 🧐
Yeah, I know, it doesn't sound that fascinating but it's probably the only way to become code master (or, at least, understand your own code a little more) �...]]></description><link>https://blog.codingbrah.com/what-are-data-structures-in-javascript</link><guid isPermaLink="true">https://blog.codingbrah.com/what-are-data-structures-in-javascript</guid><category><![CDATA[programming]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[React]]></category><category><![CDATA[Node.js]]></category><category><![CDATA[2Articles1Week]]></category><dc:creator><![CDATA[Codingbrah]]></dc:creator><pubDate>Thu, 27 Aug 2020 21:16:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1598562411768/mbEX2AeK7.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey, hey hey! 🤟 </p>
<p>Today I want to take a look into some basic <strong>JavaScript Data Structures</strong>. 🧐</p>
<p>Yeah, I know, it doesn't sound that fascinating but it's probably the only way to become code master (or, at least, understand your own code a little more) 😄 .</p>
<p>Do you pay attention, in your daily work, to <strong>Data Structures</strong> or don't have time for this stuff, and simply you choose the simplest and fastest solution? Let me know in the comments!</p>
<h2 id="data-structure">Data Structure</h2>
<p>Firstly, let’s define what <strong>Data Structure</strong> is. As the name may suggest<strong> it’s just a way to organize/structure your data</strong>. Every piece of information that is floating through the web must exist in memory with some kind of solid, logical representation.
It is crucial from the perspective of developers to know the difference between the most popular data structures because in many cases the right choice can noticeably reduce the big O complexity and speed up your app. But what actually <strong>big O</strong> is? 🤔</p>
<h2 id="big-o">Big O</h2>
<p>The <strong>big O</strong> notation is a common way to express the time complexity of an app. It’s used in the meaning of the worst-case scenario (situation when your algorithm must handle the worst possible case, for example to loop through the longest or deepest array). Two other notations (rather rarely used) are <strong>Big Omega</strong> (best case scenario) and <strong>Big Theta</strong> (average-case scenario). As you can see, developers by their nature don’t look that often on the bright side of life 😔 . There are many different types of orders (complexity types). I’ll definitely take a closer look at each one later, but for now, let’s get used to this concept and go directly to the first data structure - <strong>Stack</strong>.</p>
<h2 id="stack-last-in-first-out-lifo">Stack - Last In First Out (LIFO)</h2>
<p>A <strong>stack</strong> is an ordered list in which the most recently added 
element is the first one to remove.</p>
<p><strong>The simplest implementation:</strong></p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> stack = [ ];
stack.push(<span class="hljs-number">2</span>); <span class="hljs-comment">// stack is now [2]</span>
stack.push(<span class="hljs-number">5</span>); <span class="hljs-comment">// stack is now [2, 5]</span>
stack.pop( ); <span class="hljs-comment">// stack is now [2]</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1598560752629/_ubnuFWxS.png" alt="image.png" /></p>
<h2 id="queue-first-in-first-out-fifo">Queue - First In First Out (FIFO)</h2>
<p>As you probably might guess based on the previous definition, a <strong>queue</strong> is also an ordered list but this time, the most recently added element is the last one to remove. Elements are removed in the same order as they were added.</p>
<p><strong>The simplest implementation:</strong></p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> queue = [ ];
queue.push(<span class="hljs-number">2</span>); <span class="hljs-comment">// queue is now [2]</span>
queue.push(<span class="hljs-number">5</span>); <span class="hljs-comment">// queue is now [2, 5]</span>
queue.shift( ); <span class="hljs-comment">// queue is now [5]</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1598560986865/wAaQvo1TZ.png" alt="image.png" /></p>
<h2 id="linked-list">Linked List</h2>
<p>Now, when we have the basic knowledge about two, most fundamental data structures, let’s talk about something much more interesting.</p>
<p>A <strong>linked list</strong> is a structure in which each element is linked (or, in other words, has a reference) to the next node. This kind of data structure is at some points implemented, for example, in <strong>Blockchain</strong>. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1598561354615/w6gMIuEZZ.png" alt="image.png" /></p>
<h2 id="hash-table">Hash Table</h2>
<p>The main idea behind the <strong>hash table</strong> is to speed up the process of searching and comparing elements. Each element has its own number representation that is generating using the <strong>hash function</strong>. When we want to find a particular element we can just search through the indices (which in many cases can be a lot faster and more efficient). </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1598562537373/NevGemJPw.png" alt="image.png" /></p>
<h2 id="summary">Summary</h2>
<p>I know that this topic is probably way less interesting than some fancy SEO tricks and on the first look, it’s much harder to understand and put in real-life examples. You must understand, that sometimes, we all have to go through this though definitions to create strong fundamentals before we can do some real magic 🧙‍♂️. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1598561545561/wff10elBc.png" alt="image.png" /></p>
]]></content:encoded></item></channel></rss>