<?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 Basat Maqsood on Medium]]></title>
        <description><![CDATA[Stories by Basat Maqsood on Medium]]></description>
        <link>https://medium.com/@basatmaqsood?source=rss-1f38a0e03c0b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7oqmuZWhz1dT2pu_bsQsAw.jpeg</url>
            <title>Stories by Basat Maqsood on Medium</title>
            <link>https://medium.com/@basatmaqsood?source=rss-1f38a0e03c0b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 16:40:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@basatmaqsood/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[How I converted my traditional portfolio website into a full-stack engineering project.]]></title>
            <link>https://basatmaqsood.medium.com/how-i-converted-my-traditional-portfolio-website-into-a-full-stack-engineering-project-9a6d5be4cceb?source=rss-1f38a0e03c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a6d5be4cceb</guid>
            <category><![CDATA[full-stack-development]]></category>
            <category><![CDATA[website-development]]></category>
            <category><![CDATA[engineering-projects]]></category>
            <category><![CDATA[portfolio-website]]></category>
            <dc:creator><![CDATA[Basat Maqsood]]></dc:creator>
            <pubDate>Mon, 05 May 2025 11:31:45 GMT</pubDate>
            <atom:updated>2025-05-17T06:38:42.164Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I converted my traditional portfolio website into a Full-Stack Engineering Project?</h3><p>So I just finished development of my latest Portfolio website and it is not any traditional portfolio website built using a template or any website builder. Its a Full-stack Engineering project that has covered a lot of things that normally developers miss out. So let’s explore this project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hYqDqr-c7kbxaOH7kaafg.png" /><figcaption>A Glimpse of my portfolio website</figcaption></figure><blockquote>You can check my Portfolio here <a href="https://basatmaqsood.com/">https://basatmaqsood.com/</a></blockquote><p>So a few months ago, I came across a LinkedIn Post by CTO of MRS Technologies <a href="https://medium.com/@umerfarooqai">Mr. Umer Farooq</a> and it was about his blog on the topic “10 Full-Stack Project Ideas — Think Like an Engineer and Build Skills That Set You Apart!”. You can read the blog <a href="https://medium.com/@umerfarooqai/10-full-stack-project-ideas-think-like-an-engineer-and-build-skills-that-set-you-apart-ce1cf5773107">here.</a> I started reading it. Most of the projects were out of my scope but then I came across this project “Personal Portfolio Website” and I thought: “What?? How can a portfolio website be among these projects”. I read it and immediately realized “It really is a Full-stack project”. I decided that moment that I’m gonna build it. And here I am after almost 2 months with this project. There were a lot of challenges mentioned in the blog and I have tried to tackle all of them in my project. Lets go through each challenge one by one.</p><p><strong>Challenge #1: Use an SEO-Friendly Framework like Next.js or Nuxt.js, which supports server-side rendering (SSR) to improve search engine rankings. Please say NO to no-coding platforms like WordPress or Webflow.</strong></p><p>I decided to use Next.js because of it’s SEO-friendly environment and it is hot in the market. Plus I have strong expertise and experience in Next.js so it was my choice by default.</p><p><strong>Challenge #2 Integrate any headless Content Management System (CMS) like Contentful, Strapi, or even WordPress to add, update, or remove sections like projects, blogs, and certifications without modifying code.</strong></p><p>Now that’s the fun part about this project. I have worked with WordPress before and I had a little bit idea about headless CMSs but I never really used one before. So it really was a challenge for me. I decided to use Strapi as a headless CMS to manage the content of my portfolio without having to change the code directly. I had never used Strapi before. But that’s what the engineering means. To tackle new challenges and always welcome Learning. So I decided to learn Strapi first and to my surprise, I didn’t have to struggle much to learn it. I learnt almost everything without even having to rely on any tutorial. I deployed it on my Oracle Cloud VPS and handled permissions to restrict unauthorized access to my CMS. It was total fun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lR3XlPtdYVXDM1dP0H7a8w.png" /><figcaption>A glimpse of my Strapi CMS</figcaption></figure><p><strong>Challenge #3 Blog Section — Write at least four original blogs on your favorite topics showcasing your communication skills. Implement categories, tags, and search functionality. No AI-generated copy-paste bullshit, please!</strong></p><p>I am not new to Medium. I wrote a few articles in the past about JavaScript back when I was learning things. So instead of building a complete section on my website, I decided to use Medium to write blogs and then share those articles on my portfolio on the blog page. I even wrote some new articles on Medium regarding the problems that I faced at times. You can check out my other blogs <a href="https://basatmaqsood.medium.com/">HERE</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H7HOfE7FjWbqnhVSO-tgqA.png" /><figcaption>Blogs section of my Portfolio</figcaption></figure><p><strong>Challenge #4 Fully Responsive Design — Your portfolio should work seamlessly on mobile, tablet, and desktop. Find tools/extensions to test responsiveness on various screens.</strong></p><p>The Blog website is fully responsive on all screens. Primarily, I used google chrome’s dev tools to test the responsiveness but since the challenge was to find tools/extensions for it, I searched a bit and came across this tool <a href="http://responsivetesttool.com/">http://responsivetesttool.com/</a> where you can test how your website looks across different devices. It has built-in sizes for a large number of devices including mobiles, laptops, desktops, tablets and many more. Developer tools also has a number of built-in device configurations but they are very few. While this new tool has almost 100+ devices listed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hsk8UWjgj4pzVq7lLVcr9A.png" /><figcaption>Different Mobile mockups to test your website</figcaption></figure><p><strong>Challenge #5 Implement Google Analytics to track page views, clicks, and time spent on different sections.</strong></p><p>I am building websites for almost 3 years now but I never thought about integrating Google Analytics in my Website except for the one WordPress blog website that I developed. So a new challenge here. I tackled it too. I researched a bit on how it works and then I integrated it with my portfolio. Things got messy at start but then I handled that too and successfully implemented Google Analytics in my Portfolio.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BWOetIKru5p2wqlDUfE3sA.png" /><figcaption>Google Analytics Overview of my Portfolio</figcaption></figure><p><strong>Challenge #6 Performance Optimization — Speed matters. Optimize images, scripts, and assets, use lazy loading, and leverage a CDN for fast content delivery.</strong></p><p>Performance… That’s the real challenge that I faced. That’s the most worth reading part about this blog. I was using traditional client side and server side components from Next.js but the performance was not looking very good. So instead of using traditional SSR or CSR, I used the mostly ignored yet powerful technique. ISR. Incremental Static Regeneration.</p><p>Before, the data from Strapi was fetched by Vercel and then pages were generated on server and served to the browser. It was taking some time to fetch and render the data. After using ISR, the data is fetched and pages are generated and then data is stored in Cache on Vercel for 24 hours. Since the data from Strapi is not changing frequently, it is revalidated after 24 hours. It reduces the number of requests to Strapi server and reduce the load and computation resources. Instead of loading data every time a user visits the website, it is loaded only once every 24 hours. This technique helped me boost my website’s performance like crazy and reduced load on the server allowing large number of users to access the website without any denial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SR583tg8kbKPVTzRnxFkQA.png" /><figcaption>Performance metrics of my Portfolio</figcaption></figure><p><strong>Challenge # 7 SEO Configuration — Set up meta tags, OG images, structured data, and sitemaps. Check your robots.txt and ensure it allows Google and other search engines to crawl your website.</strong></p><p>By default, Next.js is SEO-friendly but still some configurations are necessary to provide details of your website to the search engines and crawlers. I have implemented the necessary meta tags, added OG images and generated a static sitemap since my website does not contain any dynamic pages. Open-Graph protocol is used to show structured data about website on Social platforms like WhatsApp, Twitter etc. I have implemented Open-graph protocol and added OG-image to display on social platforms. OG Protocol was originally developed by Facebook and is quite helpful to manage how your website looks on other platforms.</p><p>As a result, my website is now indexed on Google and appears on first page when searched on Google and Bing. I have also attached screenshots from relevant platforms for reference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V0OuyKdemdi8zGSO_2nN1Q.png" /><figcaption>Search Results from Google. Ranked #3. P.S. First two results are also my profiles 😁</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y7ndhaTpY4ukPxbQMXuKwQ.png" /><figcaption>Search Results from Bing. Ranked #1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*gupXxP8u4-mDxFhb_MQdEA.png" /><figcaption>OG-Image and Description. How my website link is displayed on WhatsApp</figcaption></figure><p><strong>Challenge #8 Integrate Google Search Console. This tool can identify indexing and other SEO-related issues. Learn how to fix the specific problems pointed out by the tool.</strong></p><p>I have integrated google search console and it really is quite helpful. I submitted my sitemap and it indexed the pages. Some pages got indexed directly but some had issues. My old portfolio website was indexed on google. So I had to remove it also. I used Google cloud console to handle the website removal from Google search and redirected the old domain to my new domain. Now my old domain <a href="https://www.basatmaqsood.live/">basatmaqsood.live</a> also redirects to <a href="https://www.basatmaqsood.com/">basatmaqsood.com</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q4P9wIfivMsm1u8VN-jbfw.png" /><figcaption>Google Search Console dashboard of my portfolio</figcaption></figure><p><strong>Challenge #9 Implement a secure contact form with email validation, reCAPTCHA, and spam protection. Show a confirmation message upon submission.</strong></p><p>Now this is the other section that was very full of learning and it was very much fun. The contact form is fully functional. I have used Email.js to handle the form submissions. I have also made an Email template using HTML and CSS for form submission. Now the challenge was to secure the form with reCAPTCHA and prevent spam. Now there are two things that I used here.</p><p>First I have implemented Google reCAPTCHA v3. reCAPTCHA v3 is a bot detection service by Google that verifies interactions on websites without requiring user interaction. It analyzes user behavior to assess the likelihood of a request being from a human or a bot, and returns a risk score. This score allows website owners to take appropriate actions based on the level of suspected abuse, such as requiring additional verification or throttling potentially malicious traffic. Thus, it allows form protection without having users to fill captcha form.</p><p>Second, I have implemented Honeypot fields to prevent bots from submitting the form. The honeypot fields are dummy input fields that are not displayed on the website but are present in the code. So when a bot fills the form, the honeypot fields are also filled. Before form submission we check if honeypot fields are empty. If the fields are not empty, the form is not submitted. Thus, honeypot fields also prevents bots to fill our contact form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rbT2ovz5r4WJlHABIf2Pfw.png" /><figcaption>Email Template of Contact form Submission</figcaption></figure><p><strong>Challenge #10 Deployment &amp; Hosting — Deploy your portfolio on GitHub Pages, Vercel, or AWS and make it live for recruiters and potential clients.</strong></p><p>So I have deployed my Portfolio on Vercel where it is fully visible to all the recruiters and potential clients. You can visit it <a href="https://basatmaqsood.com/">here.</a></p><p><strong>Challenge #11 Get your own domain — purchase it from GoDaddy or any trusted registrar to build a professional online presence.</strong></p><p>I have purchased my domain name <a href="https://basatmaqsood.com/">basatmaqsood.com</a> from Hostinger. I was previously using basatmaqsood.live domain that I got for free from GitHub student developer pack. But I decided to buy my own .com domain now. A little investment on myself. I have shifted all of my projects to my own subdomains now instead of using .vercel subdomains i.e. <a href="https://nextrivals.basatmaqsood.com/">https://nextrivals.basatmaqsood.com/</a>. All projects are available at <a href="https://basatmaqsood.com/projects">basatmaqsood.com</a>. Check them out.</p><h3>🧠 Think Like an Engineer</h3><p><strong>👉 Handling High Traffic:<br>How will you ensure fast load times when many users visit simultaneously? Would your server be able to handle it?</strong></p><p>Yes! I have used ISR that sends API request every 24 hours and caches data So when many users simultaneously visit the website, instead of sending request for each user, it uses cached data and serves it directly without having to wait for any response. Thus, Server is able to handle many users if they visit the portfolio simultaneously.</p><p><strong>👉 Choice of Framework:<br>Why choose one framework over another? And why not just use a plain React app instead? Make sure you understand the difference between Client-Side Rendering (CSR) and Server-Side Rendering (SSR).</strong></p><p>I have chose Next.js instead of plain react app because of it’s SEO friendly features. Moreover ISR is also the main reason Next.js was my primary choice for my portfolio website because of it’s optmization and performance.</p><p><strong>👉 Content Management System (CMS):<br>🔸How will you integrate your CMS with your frontend app?<br>🔸Will you use REST APIs or GraphQL?<br>🔸Where will you deploy it? And can it scale when your website gains traction?</strong></p><p>I have used REST APIs to integrate my CMS with frontend. I have deployed CMS on Oracle cloud so if I need to scale it, I can easily scale it vertically to manage heavy traffic load Or use horizontal scaling to balance the traffic load.</p><p><strong>👉 Security Considerations:<br>How will you secure your contact form to prevent spam and unauthorized access?</strong></p><p>I have used reCAPTCHA v3 and honeypot fields to prevent spam and unauthorized access on my contact form.</p><p><strong>👉 Testing &amp; Debugging:<br>How will you ensure your website is fully responsive and adapts seamlessly across all devices? Will you test on every device manually to find out?</strong></p><p>I don’t need to manually test my website on every device. I have used tools like <a href="http://responsivetesttool.com/">http://responsivetesttool.com/</a> to test how my website will look across different devices like iPhone 15 or Samsung S24 etc.</p><p><strong>👉 Optimizing Media Files:<br>How do you compress and serve images efficiently to maintain quality without sacrificing speed?</strong></p><p>I have used Cloudinary to store and serve all the media files. Cloudinary uses CDN to serve media files. Thus all images are efficiently served without sacrificing speed.</p><p><strong>👉 Wait… Can’t Google see my website?<br>What is SEO, and how do you ensure Google indexes your website? Can people find your website in search results?</strong></p><p>Yes! My website is indexed on Google. It appears on the first page and is ranked number 3. I have implemented Meta tags and OG-Tags to implement proper structure for search engines.</p><p><strong>👉 Automated Deployments:<br>Can you set up a CI/CD pipeline so that every change you push to GitHub automatically updates your live portfolio?</strong></p><p>I have deployed the frontend on Vercel and connected with GitHub. By default, Vercel provides automatic CI/CD pipeline that automatically pushes all changes to the production.</p><h3>Conclusions:</h3><p>So this was all about my project. This project was a lot of fun and it was full of learning. Instead of giving up on things, I learnt new technologies and implemented them. I accepted all the challenges and completed them. Check out my blog and let me know about your reviews. Thank you for reading :)</p><blockquote>Connect with me on LinkedIn. <a href="https://www.linkedin.com/in/basatmaqsood/">https://www.linkedin.com/in/basatmaqsood/</a></blockquote><p>Check out my other blogs on Medium also and give me a follow for more such content. Happy Reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a6d5be4cceb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Development is Far More Than Making Websites!]]></title>
            <link>https://basatmaqsood.medium.com/web-development-is-far-more-than-making-websites-33a2df9309e3?source=rss-1f38a0e03c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/33a2df9309e3</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Basat Maqsood]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 18:38:49 GMT</pubDate>
            <atom:updated>2025-04-14T19:26:50.284Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CBkIGlrzVUae74GeVmnZ_w.jpeg" /></figure><blockquote>“So… you make websites?”</blockquote><p><em>That’s what I usually hear when I say I’m a web developer. </em>And while that’s not entirely wrong, it’s like saying a chef “makes food” — technically true, but it leaves out <strong>everything else</strong> involved: from planning the menu, sourcing ingredients, to managing a kitchen. Web development, in the same way, is <strong>so much more than just making websites</strong>.</p><p>Let me take you on a journey through what web development actually involves — with some analogies to make it fun and relatable.</p><h3>1. Web Development Has Evolved — A Lot</h3><p>Once upon a time, websites were just digital brochures. A few lines of HTML and some inline CSS got the job done.</p><p>But today? We’re building platforms like <strong>Gmail, Notion, Discord, TikTok</strong> — dynamic, interactive, data-driven beasts that feel more like desktop apps than old-school websites.</p><blockquote><em>🛠️ </em><strong><em>Analogy</em></strong><em>:<br> </em>Websites used to be like printed brochures. Today, they’re more like fully-loaded smartphones — you don’t just read them, you interact, collaborate, and sometimes even create entire projects within them.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WSTvCoqm0ujw4wuNNK1CZQ.png" /><figcaption>First Web Page on Internet</figcaption></figure><h3>2. The Frontend: It’s Not Just About Looking Good</h3><p>A lot of people think frontend development is just about making things “look nice.” But really, it’s about <strong>making things work beautifully</strong>.</p><p>We care about:</p><ul><li><strong>User experience (UX)</strong> — Is it smooth? Intuitive?</li><li><strong>Accessibility</strong> — Can people with disabilities use it?</li><li><strong>Responsiveness</strong> — Does it look good on phones, tablets, TVs?</li><li><strong>Performance</strong> — Does it load fast or feel like dial-up?</li></ul><blockquote><em>🛍️ </em><strong><em>Analogy</em></strong><em>:<br> </em>The frontend is like the entrance to a restaurant — sure, it has to be beautiful. But if the menu is confusing, or there’s no wheelchair ramp, or your food takes 20 minutes just to order — the experience is ruined.</blockquote><p>Frontend devs are the ones sweating over how that button animates, how the menu behaves on scroll, and making sure your experience feels <em>right</em>.</p><h3>3. The Backend: The Invisible Engine Room</h3><p>Now, if the frontend is what users see and touch, the <strong>backend</strong> is what powers the entire thing from behind the scenes.</p><p>This is where we:</p><ul><li>Authenticate users (login/signup)</li><li>Store and retrieve data from databases</li><li>Handle logic like filtering, analytics, payments</li><li>Connect APIs and third-party tools</li></ul><blockquote><em>🔌 </em><strong><em>Analogy</em></strong><em>:<br> </em>If the frontend is the restaurant’s entrance, the backend is the kitchen. You don’t see it, but it’s where all the magic happens: food is prepped, orders are processed, and chaos is controlled.</blockquote><p>Backend developers work with servers, databases, security, and a whole lot of logic to make sure everything just… works.</p><h3>4. Full Stack &amp; DevOps: The Unsung Heroes</h3><p>A <strong>full stack developer</strong> works on both frontend and backend. Kind of like a hybrid.</p><p>And <strong>DevOps</strong>? That’s where we make sure everything we built actually reaches users safely.</p><p>DevOps involves:</p><ul><li>Version control (Git)</li><li>CI/CD pipelines (automated testing &amp; deployment)</li><li>Server setup and monitoring</li><li>Rollbacks and recovery</li></ul><blockquote><em>🚦 </em><strong><em>Analogy</em></strong><em>:<br> </em>Think of DevOps as traffic control. They make sure updates go live without crashes, and everything runs smoothly on the digital highway.</blockquote><p>These roles are essential to keep the system <strong>scalable, stable, and secure</strong>.</p><h3>5. Web Development = Solving Problems, Not Just Coding</h3><p>At its heart, web development is <strong>problem solving</strong>. Whether it’s automating a boring task, making a system more efficient, or helping a business go online — we build solutions.</p><p>Some examples:</p><ul><li>Internal dashboards for managing teams</li><li>E-learning platforms for schools</li><li>Tools to automate invoices or analytics</li><li>Real-time chat systems, file uploads, video conferencing</li></ul><blockquote><em>🧰 </em><strong><em>Analogy</em></strong><em>:<br> </em>A good web developer is like a Swiss Army knife — adaptable, resourceful, and always ready with the right tool to solve a digital problem.</blockquote><p>We’re not just coders. We’re builders, creators, tinkerers.</p><h3>6. It’s Not All Code — It’s People Too</h3><p>Web development also involves:</p><ul><li>Talking to clients and understanding their needs</li><li>Working with designers, PMs, marketers</li><li>Being part of a team, planning sprints, giving feedback</li></ul><p>Soft skills matter more than you’d think. Communication, empathy, and collaboration are often the difference between a good dev and a great one.</p><blockquote><em>🧠 </em><strong><em>Analogy</em></strong><em>:<br> </em>Think of a web developer as a digital architect who not only designs buildings but also works closely with the electricians, plumbers, and interior designers to make sure the space is usable and welcoming.</blockquote><h3>7. The Real-World Impact of Web Dev</h3><p>Web development powers so much of what we do online — and offline.</p><ul><li>Businesses thrive through e-commerce.</li><li>Communities connect through forums and social platforms.</li><li>Students learn through online classrooms.</li><li>Doctors consult through telehealth platforms.</li></ul><p>It’s not just about code — it’s about <strong>enabling people</strong>. Every line we write can potentially improve lives, create jobs, and drive innovation.</p><blockquote><em>🪵 </em><strong><em>Analogy</em></strong><em>:<br> </em>Web developers are like digital carpenters — building the structures of tomorrow’s world, one piece at a time.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*Y0u5tTm9H_uYZUMiTTwjFA.jpeg" /><figcaption>Web Development in the Analogy of Building a House</figcaption></figure><h3>8. Conclusion: We Build More Than Websites</h3><p>So next time someone says, “Oh, so you make websites?” — smile, and know the truth.</p><p>Yes, we do <strong>make websites</strong>. But we also:</p><ul><li>Craft user experiences</li><li>Architect backend systems</li><li>Solve real-world problems</li><li>Work in teams and manage workflows</li><li>Deploy global-scale apps</li><li>And constantly <strong>learn and adapt</strong></li></ul><p>We are builders of the modern digital world.</p><h3>Final Thoughts</h3><p>Web development isn’t just about writing lines of code or making things look pretty on a screen. It’s about <strong>understanding problems</strong>, <strong>designing experiences</strong>, and <strong>delivering solutions</strong> that people rely on every day — often without even realizing it.</p><p>Behind every seamless checkout, every intuitive dashboard, and every helpful web app, there’s a developer (or a team of them) who went beyond pixels and syntax to build something meaningful.</p><blockquote><strong><em>We don’t just build websites — we build the infrastructure of modern life.</em></strong></blockquote><p>Whether it’s helping a small business get online, empowering education through digital tools, or creating platforms that bring people together — web developers are quietly shaping the way the world works, learns, shops, and connects.</p><blockquote>So the next time someone says,<br> <em>“Oh, so you make websites?”</em><br> just smile and say:<br> <em>“Yes — and so much more.”</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33a2df9309e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why you should not use Vercel for RealTime apps! A Comprehensive Guide to deploy RealTime Apps]]></title>
            <link>https://basatmaqsood.medium.com/why-you-should-not-use-vercel-for-realtime-apps-a-comprehensive-guide-to-deploy-realtime-apps-759769c590f3?source=rss-1f38a0e03c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/759769c590f3</guid>
            <category><![CDATA[vercel-deployment]]></category>
            <category><![CDATA[oracle-cloud]]></category>
            <category><![CDATA[web-development-services]]></category>
            <category><![CDATA[real-time-application]]></category>
            <category><![CDATA[vercel]]></category>
            <dc:creator><![CDATA[Basat Maqsood]]></dc:creator>
            <pubDate>Thu, 03 Apr 2025 05:08:25 GMT</pubDate>
            <atom:updated>2025-04-03T05:08:25.652Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dNJL4-N1K1UEhBHHP9zqeQ.png" /></figure><h3><strong>Context</strong></h3><p>Recently I worked on two Real time web applications. One was a real time confession board and other one was a real time collaborative drawing app. Both of these were working correctly during development. But when I had to deploy these, I faced a lot of challenges. I had to do a lot of research on all of available platforms. Every platform had its own tradeoffs. At the end, I chose the most optimal platform. In this article, I will discuss all of those platforms and their tradeoffs and which one to chose for your next real time project.</p><h3>Introduction to Vercel</h3><p>Vercel is the most popular and widely used hosting platform now a days that provide out of the box support for a number of frameworks and technologies like NextJs, Angular, Gatsby, Ember, Vite and a number of other frameworks. You can easily deploy any app with just a few clicks without having to manually handle all the configurations which can be pretty tiresome. Vercel saves us the efforts and time and just provides everything out of the box. But <strong>why Vercel is not a good Choice for Real-Time Apps? </strong>In this article, I will discuss why Vercel sucks at real time applications and which platforms can you use to deploy your Real-Time Applications.</p><blockquote>BTW if you wanna know more about me, Here is my Portfolio Website. <a href="https://www.basatmaqsood.live/">www.basatmaqsood.live</a></blockquote><h3><strong>Real Time Applications</strong></h3><p>First of all lets understand what Real Time applications are. A real-time application (RTA) is software that provides users with real-time information updates as events happen or circumstances and conditions change. In the field of Web, RTA’s are mostly developed using <strong>Web Sockets.</strong> Web Sockets are a communication protocol enabling real-time, two-way communication between a client and a server over a single TCP connection, unlike traditional HTTP which is unidirectional and requires a new connection for each request. Thus Web Sockets enables the development of Real Time systems.</p><p>Another API that enables Real time communication over web is <strong>WebRTC.</strong> It is an Open Source project that allows web browsers to communicate with servers and applications with real time communication over API’s. Both Web Sockets and WebRTC are powerful tools but create a lot of challenges when deploying. Here’s why.</p><h3><strong>Why Vercel sucks at Real Time APPs?</strong></h3><p>While Vercel provides out of the box service for a number of Technologies, it is still limited to serverless functions because it is a serverless Platform and only works with stateless functions. Stateless functions means the function only performs their specified task and when their task is finished (i.e. response to a request is sent), it is destroyed and the connection is terminated. While on the other hand, web sockets require a persistent connection between client and server to keep communicating. Therefore, when sockets are deployed in a serverless environment, they cannot maintain a continuous connection and connection is severed after each request. Therefore, the Real time communication between client and server is blocked.</p><p>Since serverless functions are spun up only when needed, WebSocket connections would experience <strong>cold starts</strong>. A cold start occurs when a serverless function is invoked after being idle, and it takes time to initialize. This can lead to significant delays, which is problematic for WebSocket, as they rely on low-latency, always-available connections. Thus making Vercel a bad choice for hosting RealTime apps.</p><h3><strong>Where to Deploy RealTime Apps?</strong></h3><p>So the question is, Where can I deploy my RealTime apps? The answer is, It depends on Your project. If you are working on real world project that actually is going to generate some revenue for you, simply go ahead with VPS to deploy your App. You can purchase a VPS and simply deploy your App like normal apps. It works perfectly fine. Although you need to manually handle all the configurations on VPS server and create environment for your app whereas Vercel provides these services out of the Box.</p><p><strong><em>But what If I only want to deploy project for my Resume?</em></strong></p><p>That’s what happened in my case. The projects that I developed were just hobby projects and I wanted a free platform to deploy these projects so I can put them in my Resume.</p><blockquote>BTW You can check these projects here 1. <a href="https://blurtbox.basatmaqsood.com/">BlurtBox: Real-Time Confession Board</a> 2. <a href="https://boardcast.basatmaqsood.com/">BoardCast: Real-Time Collaborative Drawing App</a></blockquote><p>Don’t worry! That’s what I am here to tell you. So lets break down all of the possible options for you and drawbacks of using each platform.</p><ol><li><strong>Railway</strong></li></ol><p>Railway has a lot of plus points like Easy to deploy, great for Node.js and WebSockets, allows persistent connections, automatic scaling and many more. But the problem comes when you are using free tier. Railway free tier has limited monthly runtime and memory, may shut down on inactivity. Thus your App might not be available at times.</p><p><strong>2. Render</strong></p><p>Render also offers the same features as Railway plus it’s free tier does not have have runtime limit. It means your app does not shut down automatically. But there is also drawback here. In free tier, the app goes down to sleep after 15 minutes of inactivity. That means when there is no request for 15 minutes, the app will go to sleep. When there is a new request during sleep period, the app wakes up from sleep and that causes cold responses. App can take almost 30 seconds to 1 minute for waking up. That means your first request will be delayed for 1 minute that can cause a bad impression on recruiters.</p><p><strong>3. Koyeb</strong></p><p>Koyeb is your best option if want a hosting platform that is free and stays up 24/7 and does not goes to sleep due to inactivity. The only side effect with Koyeb is that it only provides 1 free service. That means you can only deploy one app for free. If you have multiple projects, you will have to pay for it and that is not very pocket friendly especially when you are just building projects as a hobby.</p><p><strong>4. Other Platforms</strong></p><p>There are a number of other platforms too but all of them have same issues. Either they don’t provide free tier, or they have monthly runtime limit and go to sleep. You can check outFly.io, Replit, Glitch, Deta Space, Cyclic, NorthFlank e.t.c.</p><p><strong>5. What I chose?</strong></p><p>After doing a lot of research, I hosted BlurtBox on Koyeb but my account got suspended after a few days. So I had to do further research and I came across Oracle Cloud Free tier. Oracle provides a lot of resources in their free tier. You get free computing instance (Your own VPS server) where you can deploy your apps and its free forever. Oracle Cloud Free Tier provides <strong>always-free compute instances</strong>, databases, storage, and networking resources. Here’s a breakdown of what you get:</p><ol><li><strong>Compute Instances:</strong></li></ol><ul><li>2 Always-Free instances</li></ul><p>Choose between:</p><ul><li>1 AMD-based VM (Up to 4 vCPUs, 24GB RAM)</li><li>4 Arm-based VMs (Shared 4 vCPUs, 24GB RAM total)</li></ul><p><strong>2. Storage &amp; Databases:</strong></p><ul><li>200GB block storage</li><li>20GB object storage</li><li>2 Always-Free Autonomous Databases (Each with 1 OCPU, 20GB storage)</li></ul><p><strong>3. Networking &amp; Bandwidth:</strong></p><ul><li>10TB free outbound bandwidth per month</li><li>Free static public IPv4 address (Ideal for WebSocket servers)</li><li>Free load balancer (10Mbps throughput)</li></ul><p><strong>4. Security &amp; Monitoring:</strong></p><ul><li>Built-in firewall protections</li><li>Always-Free monitoring &amp; logging tools</li></ul><p><strong>Drawbacks:</strong></p><ul><li><strong>Complex setup</strong> (Requires manual configuration of networking &amp; security)</li><li><strong>Credit card verification required</strong> (But no charges for free tier)</li></ul><h3>Conclusion</h3><p>At the end, I had to use a VPS server to host my custom Real-time backend. There is no better alternative to hosting your apps on your custom VPS servers. If you want a production-level server, You can purchase Hostinger VPS servers or You can use any Cloud service providers like Oracle, Amazon, Google or Microsoft.</p><p>If you are a developer and just want to deploy your apps to showcase on your portfolio, the best option for you is Oracle Cloud free tier that provides you with more than enough services for free. You can configure Nginx to add your custom domains in your VPS server and you are good to go!</p><blockquote>If you like such tech related articles, don’t forget to follow me. I write such articles now and then.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=759769c590f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating Common JavaScript Pitfalls: A Developer’s Guide]]></title>
            <link>https://basatmaqsood.medium.com/navigating-common-javascript-pitfalls-a-developers-guide-3aa669329305?source=rss-1f38a0e03c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3aa669329305</guid>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Basat Maqsood]]></dc:creator>
            <pubDate>Tue, 14 Nov 2023 18:17:36 GMT</pubDate>
            <atom:updated>2023-11-14T18:17:36.267Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>JavaScript is a powerful and versatile programming language that has become the backbone of modern web. While it offers immense possibilities, developers often encounter common pitfalls that can lead to bugs, performance issues, and headaches. In this guide, we will explore some of these common JavaScript pitfalls and provide insights on how to navigate them like a pro.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v0v38jELHtoBlGy8AiARQw.png" /></figure><h3>1. Misunderstanding Equality Operators</h3><h3>Double and Loose Equality Operator</h3><p>One of the most common JavaScript pitfalls is misunderstanding the double equal (==) and loose equality operators. These operators compare values by converting them to a common type, which can lead to unexpected results. For example, &quot;5&quot; == 5 would evaluate to true, which can be confusing.</p><p>To avoid this pitfall, it’s essential to understand the concept of type coercion. Instead of relying on loose equality, it’s generally recommended to use the triple equal (===) operator, which performs a strict comparison, considering both the value and the type. This way, &quot;5&quot; === 5 would evaluate to false, providing a more accurate result.</p><h3>Triple and Strict Equality Operator</h3><p>While the triple equal (===) operator helps prevent type coercion issues, it&#39;s crucial to be mindful of its characteristics as well. One common pitfall is mistakenly assuming that two objects with the same properties and values are equal using strict equality. However, since objects are reference types in JavaScript, strict equality (===) would evaluate to false in this case.</p><p>To determine equality between objects, developers should use appropriate comparison methods or libraries that can perform deep equality checks. These tools analyse the internal structure and properties of objects, ensuring accurate equality checks.</p><pre>// Pitfall<br>console.log(“5” == 5); // true<br>// Solution using triple equal (strict equality)<br>console.log(“5” === 5); // false</pre><pre>// Pitfall with objects<br>const obj1 = { name: “John” };<br>const obj2 = { name: “John” };<br>console.log(obj1 === obj2); // false<br>// Solution using appropriate comparison methods or libraries<br>// (e.g., lodash’s isEqual function)<br>const isEqual = require(‘lodash/isEqual’);<br>console.log(isEqual(obj1, obj2)); // true</pre><h3>2. Misusing Variable Declarations</h3><h3>VAR, let, and const Keywords</h3><p>Variable declarations in JavaScript can be a minefield if not used correctly. One of the common pitfalls is misusing different keyword declarations, such as var, let, and const. Each keyword has its own scope rules and characteristics.</p><p>Using var can lead to unexpected variable hoisting and scoping issues. It&#39;s recommended to use let and const instead, as they provide block-level scoping and prevent accidental variable reassignment. By using these keywords appropriately, developers can avoid the headaches caused by variable declaration mishaps.</p><pre>// Pitfall with var<br>if (true) {<br> var x = 10;<br>}<br>console.log(x); // 10 (hoisted to the global scope)<br>// Solution using let and const for block-level scoping<br>if (true) {<br> let y = 20;<br> const z = 30;<br>}<br>// console.log(y); // Error: y is not defined (block-scoped)<br>// console.log(z); // Error: z is not defined (block-scoped)</pre><h3>Also Read: <a href="https://medium.com/@basatmaqsood/mastering-javascript-with-10-mind-blowing-one-liners-a0fc7d84daa0?source=your_stories_page-------------------------------------">Mastering JavaScript with 10 Mind-Blowing One-Liners</a></h3><h3>3. Mishandling Mutable and Immutable Types</h3><h3>Understanding Mutability in JavaScript</h3><p>JavaScript has mutable and immutable types, and mishandling them can lead to bugs and unexpected behavior. Mutable types, such as arrays and objects, can be modified after they are initialized, while immutable types, like strings and numbers, cannot be changed.</p><p>One common pitfall is assuming that assigning an array or object to a new variable creates a deep copy. However, it merely creates a reference, leading to unintended modifications when changing the new variable. To work with immutable versions of mutable types, developers should make use of techniques like deep copying or libraries that provide immutable data structures.</p><h3>Deep Copying Objects for Immutable Types</h3><p>When dealing with mutable types that need to be treated as immutable, deep copying is a reliable approach. Deep copying involves creating an entirely new object with copies of all nested properties instead of creating a reference to the original object.</p><p>Developers can achieve deep copying by using methods like JSON.parse(JSON.stringify(object)), which creates a new object without any shared references. By employing deep copying techniques, developers can ensure the integrity and immutability of objects, avoiding potential pitfalls.</p><pre>// Pitfall<br>const originalArray = [1, 2, 3];<br>const newArray = originalArray;<br>newArray.push(4);<br>console.log(originalArray); // [1, 2, 3, 4]<br>// Solution using deep copying<br>const deepCopiedArray = JSON.parse(JSON.stringify(originalArray));<br>deepCopiedArray.push(5);<br>console.log(originalArray); // [1, 2, 3, 4]<br>console.log(deepCopiedArray); // [1, 2, 3, 4, 5]</pre><h3>4. Understanding ‘this’ in Arrow Functions</h3><h3>Context Differences between Arrow and Regular Functions</h3><p>Arrow functions introduced in ES6 offer a concise syntax and lexical this binding. However, it&#39;s important to understand the differences in context between arrow functions and regular functions.</p><p>In regular functions, this refers to the object that called the function, while in arrow functions, this retains the value of its surrounding scope. This difference can be a source of confusion and lead to unexpected behavior when working with objects and prototypes.</p><p>Developers should pay attention to the context in which they use arrow functions, ensuring they align with the desired behavior. By grasping the nuances of this in different function types, JavaScript developers can navigate the realm of contexts more effectively.</p><pre>// Pitfall<br>function RegularFunction() {<br> this.value = 42;<br> setTimeout(function () {<br> console.log(this.value); // undefined (context issue)<br> }, 1000);<br>}<br>// Solution using arrow function and maintaining context<br>function ArrowFunction() {<br> this.value = 42;<br> setTimeout(() =&gt; {<br> console.log(this.value); // 42 (context retained)<br> }, 1000);<br>}</pre><h3>5. Handling Asynchronous Code Correctly</h3><h3>Using dot then and dot catch</h3><p>Asynchronous code, such as AJAX requests and asynchronous functions, is a fundamental part of modern JavaScript development. However, mishandling asynchronous code can introduce hard-to-debug errors and unpredictable behavior.</p><p>One common pitfall is not properly chaining promises using the then and catch methods. Failing to chain promises correctly can lead to callback hell and make the code difficult to read and maintain. By chaining promises correctly and utilizing the catch method to handle errors, developers can ensure reliable execution of asynchronous operations.</p><pre>// Pitfall<br>asyncFunction()<br> .then(result =&gt; {<br> return anotherAsyncFunction(result);<br> })<br> .then(finalResult =&gt; {<br> console.log(finalResult);<br> })<br> .catch(error =&gt; {<br> console.error(error);<br> });</pre><h3>Utilizing async and await</h3><p>ES8 introduced the async and await keywords, providing a more concise and readable syntax for handling asynchronous code. By declaring a function as async, developers can use the await keyword to pause the execution until a promise is resolved or rejected.</p><p>Using async and await in combination with try and catch blocks can greatly simplify the management of asynchronous operations. This approach enhances code readability, reduces nesting, and makes error handling more straightforward.</p><pre>// Properly handling asynchronous code with async/await<br>async function asyncExample() {<br> try {<br> const result = await asyncFunction();<br> const finalResult = await anotherAsyncFunction(result);<br> console.log(finalResult);<br> } catch (error) {<br> console.error(error);<br> }<br>}</pre><h3>Conclusion</h3><p>Navigating common JavaScript pitfalls is crucial for any developer striving to write reliable and efficient code. By understanding and avoiding the pitfalls related to equality operators, variable declarations, mutable and immutable types, ‘this’ in arrow functions, and handling asynchronous code, developers can elevate their JavaScript skills and produce higher quality applications.</p><p>Remember, JavaScript is a powerful language, but it can have its quirks. With a solid grasp of these common pitfalls, developers are well-equipped to tackle any challenges that come their way in the exciting world of JavaScript development.</p><h3>Related Posts:</h3><h3><a href="https://medium.com/@basatmaqsood/mastering-javascript-with-10-mind-blowing-one-liners-a0fc7d84daa0?source=your_stories_page-------------------------------------">Mastering JavaScript with 10 Mind-Blowing One-Liners</a></h3><h3><a href="https://medium.com/@basatmaqsood/mastering-modern-javascript-tips-and-tricks-for-efficient-development-2a77ead8b99c?source=your_stories_page-------------------------------------">Mastering Modern JavaScript: Tips and Tricks for Efficient Development</a></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3aa669329305" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering JavaScript with 10 Mind-Blowing One-Liners]]></title>
            <link>https://basatmaqsood.medium.com/mastering-javascript-with-10-mind-blowing-one-liners-a0fc7d84daa0?source=rss-1f38a0e03c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0fc7d84daa0</guid>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Basat Maqsood]]></dc:creator>
            <pubDate>Mon, 13 Nov 2023 12:18:47 GMT</pubDate>
            <atom:updated>2023-11-14T18:21:00.713Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>JavaScript is a versatile programming language that powers the dynamic and interactive elements of countless websites and applications. While mastering the ins and outs of JavaScript can take time, there are clever one-liners that can elevate your coding skills to new heights. In this article, we will explore 10 mind-blowing one-liners that will help you level up your JavaScript game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hjXq9TN-PK0uk8Qt9KB1JQ.png" /></figure><h3>Design Mode: Dynamic Text Manipulation</h3><p>JavaScript allows you to manipulate text dynamically, and the designMode property is a powerful tool to achieve this. By simply setting the designMode value to &quot;on&quot;, you can turn any webpage into an editable canvas. With this one-liner, you can make your website instantly interactive, allowing users to edit content on the fly.</p><pre>document.designMode = “on”;</pre><h3>Random Boolean: Unleash the 50/50 Magic</h3><p>Need a random true or false value? JavaScript has got you covered with a stunningly simple one-liner. By using Math.random(), you can generate a random decimal between 0 and 1. Adding &gt;= 0.5 at the end of the equation will give you a 50% chance of getting true and a 50% chance of getting false. This magical one-liner is perfect for creating unpredictable experiences or conducting randomized experiments in your applications.</p><pre>const isTrue = Math.random() &gt;= 0.5;</pre><h3>Array Merge: Simplifying Array Combination</h3><p>Combining arrays in JavaScript can be a tedious task, but fear not! There’s a mind-blowing one-liner that simplifies the process. By using the spread operator, you can merge arrays effortlessly. Simply input [...array1, ...array2] and voila! Your arrays are merged into one. Say goodbye to lengthy for loops and embrace the elegance of this one-liner.</p><pre>const todos = [“Subscribe to developbaya.com”, “Check out the courses”];<br>const socials = [“Twitter”, “Instagram”];<br>const merge = […new Set([…todos, …socials])];</pre><h3>Object Extraction: A Shortcut to Property Access</h3><p>Accessing object properties can sometimes lead to multiple lines of code. However, JavaScript offers a concise one-liner to extract a property’s value effortlessly. By using the destructuring assignment, you can assign the value of a property directly to a variable. For example, { property } = object will allow you to access the value of property with a single line of code. This one-liner simplifies your code and enhances readability.</p><pre>const user = { age: 20, todos: [“killed one”, “rain one”] };<br>const { age, todos: [killed, rain] } = user;<br>console.log(age, killed);</pre><h3>Generate Hex Code: Adding a Splash of Color Dynamically</h3><p>If you’re looking to add a dynamic splash of color to your web applications, JavaScript has a mesmerizing one-liner for you. By using Math.random().toString(16).substr(-6), you can generate a random hexadecimal color code. This one-liner opens up endless possibilities to enhance your UI with vibrant and eye-catching colors.</p><pre>const randomHex = `#${Math.floor(Math.random() * 0xffffff).toString(16)}`;</pre><h3>Copy to Clipboard: A Simple Yet Powerful Utility</h3><p>Want to offer your users a convenient way to copy text? JavaScript offers a clever one-liner to achieve this. By using the document.execCommand(&quot;copy&quot;) method, you can copy any selected text to the clipboard with a single line of code. Say goodbye to the old-fashioned right-click and &quot;Copy&quot; routine and give your users a seamless copying experience.</p><pre>const copyToClipboard = (text) =&gt; navigator.clipboard.writeText(text);<br>// Usage: copyToClipboard(“Hello, Clipboard!”);</pre><h3>Fade Out and Remove: A Graceful Transition</h3><p>Creating smooth transitions in JavaScript is a breeze with a one-liner that combines the power of CSS transitions and JavaScript. By adding the class .fadeOut to an element and removing it after a brief timeout, you can achieve a graceful fade-out effect. This one-liner adds a touch of elegance to your UI and creates visually pleasing transitions that captivate your users.</p><pre>const button = document.getElementById(“yourButtonId”);<br>button.addEventListener(“click”, () =&gt; {<br> button.style.opacity = 0;<br> button.addEventListener(“transitionend”, () =&gt; button.remove());<br>});</pre><h3>Nullish Coalescing Operator: Streamlining Data Retrieval</h3><p>Retrieving data from objects can sometimes result in lengthy conditionals. JavaScript simplifies this with the nullish coalescing operator, represented by ??. This operator allows you to retrieve the first non-nullish value from a list of expressions. With a single line of code, you can handle null or undefined values gracefully and streamline your data retrieval process.</p><pre>const userData = getUserData() ?? “No user data available”;</pre><h3>Console.Table: Visualizing Arrays of Objects</h3><p>When working with arrays of objects, displaying the data in a tabular format can be immensely helpful for visualization. JavaScript’s console.table method provides a mind-blowing one-liner to accomplish just that. By passing your array of objects as an argument to console.table, you can neatly display the data in a table format directly in your browser&#39;s console. This one-liner is a lifesaver for quickly analyzing complex objects and arrays.</p><pre>const videos = [<br> { name: “Video1”, views: 1000 },<br> { name: “Video2”, views: 500 },<br>];<br>console.table(videos);</pre><h3>Screen Capture: Unveiling the Power of One-Line Screen Recording</h3><p>Capturing your screen has never been so easy with JavaScript’s one-liner for screen recording. By utilizing the navigator.mediaDevices API along with getDisplayMedia(), you can record your screen with minimal effort. This mind-blowing one-liner allows you to create powerful tutorials, demonstrations, or bug reports seamlessly, all with a single line of code.</p><pre>const startCapture = async () =&gt; {<br> const video = document.getElementById(“yourVideoId”);<br> video.srcObject = await navigator.mediaDevices.getDisplayMedia({ video: { cursor: “always” }, audio: false });<br> // Usage: startCapture();<br>};</pre><h3>Conclusion</h3><p>JavaScript is a versatile language that offers an array of mind-blowing one-liners to simplify complex tasks and elevate your coding skills. By harnessing the power of dynamic text manipulation, random booleans, array merging, property extraction, and more, you can create impressive applications with ease. Embrace the potential of these one-liners and take your JavaScript mastery to new heights. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0fc7d84daa0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Modern JavaScript: Tips and Tricks for Efficient Development]]></title>
            <link>https://basatmaqsood.medium.com/mastering-modern-javascript-tips-and-tricks-for-efficient-development-2a77ead8b99c?source=rss-1f38a0e03c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a77ead8b99c</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[front-end-web-development]]></category>
            <category><![CDATA[frontend-development]]></category>
            <dc:creator><![CDATA[Basat Maqsood]]></dc:creator>
            <pubDate>Sun, 12 Nov 2023 11:05:14 GMT</pubDate>
            <atom:updated>2025-01-08T06:28:59.436Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“JavaScript, the language that brings interactivity and life to the web.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7_wHUu2kCrPnm-_0IE3Acg.png" /></figure><h3><strong>Introduction</strong></h3><p>Welcome to the world of modern JavaScript! In this article, we will dive into some essential tips and tricks that will help you become a more efficient developer. JavaScript has come a long way, evolving into a powerful language that is crucial for front-end development in today’s companies. We will explore various aspects of debugging, writing concise and efficient code, mastering modern loops, and simplifying asynchronous code using async/await. So, let’s get started!</p><h3><strong>Overview of JavaScript’s Evolution</strong></h3><p>JavaScript has undergone a significant evolution over the years. Starting as a simple scripting language, it has transformed into a versatile and powerful tool for web development. From the introduction of ES6 (ECMAScript 2015) to the latest ES2021, the language has seen numerous updates, introducing new features and enhancing the developer experience. These advancements have made modern JavaScript more efficient, readable, and maintainable.</p><h3><strong>Importance of Front-End Development in Modern Companies</strong></h3><p>In today’s digital era, front-end development plays a pivotal role in modern companies. With user experience at the forefront, businesses strive to create seamless and visually appealing web applications. JavaScript, as the primary language for front-end development, empowers developers to build interactive and dynamic websites. Understanding the importance of front-end development in modern companies will motivate you to delve deeper into mastering JavaScript.</p><h3><strong>Debugging Like a Pro</strong></h3><p>Debugging is an essential skill for any developer. It allows you to identify and fix errors, improve the quality of your code, and optimize performance. Let’s explore some tips and tricks to enhance your debugging skills.</p><h3><strong>Leveraging Console Logging for Effective Debugging</strong></h3><p>Console logging is a powerful tool for debugging. It allows you to output information to the browser console, providing valuable insights into the execution flow of your code. By strategically placing console logs at key points in your code, you can trace variable values, track the flow of control, and identify potential issues.</p><h3>Computed Property Names for Clarity</h3><p>Computed property names are a handy feature introduced in ES6. They allow you to dynamically generate property names within objects. This feature can be leveraged during debugging to provide more meaningful and descriptive console log outputs. By utilizing computed property names, you can provide clear labels for your logging statements, making it easier to understand the logged information.</p><h3>Custom CSS Styling with Console Logging</h3><p>Did you know that you can style your console log outputs using CSS? This little-known trick can enhance the readability of your logged messages and make them more visually appealing. By applying CSS styling properties to your console logs, such as color, background, and font styles, you can differentiate log messages, add emphasis, and create a more enjoyable debugging experience.</p><h3>Displaying Objects as Tables</h3><p>When logging objects, the default output in the console can be complex and hard to read. However, you can change the view of objects by displaying them as tables. This console logging trick presents objects in a tabular format, making it easier to analyze their properties and values. You can even sort and filter the table columns, providing a clear and organized representation of your objects.</p><h3>Benchmarking Performance with Console Time</h3><p>Console time is a useful tool to measure the performance of your code. By using the console.time() and console.timeEnd() methods, you can track the execution time of specific code blocks or functions. This allows you to identify potential bottlenecks and optimize your code for better performance.</p><h3>Adding Console Traces for Function Origin Tracking</h3><p>When debugging complex applications, it can be challenging to trace the origin of function calls. However, by adding console traces throughout your code, you can track the execution path of your functions. This technique helps you understand the sequence of function calls, identify problematic areas, and gain insights into the execution flow of your application.</p><h3>Writing Concise and Efficient Code</h3><p>Writing concise and efficient code is crucial for improving productivity and maintainability. Let’s explore some tips and tricks to help you achieve this.</p><h3>Object Destructuring to Eliminate Repetition</h3><p>Object destructuring is an elegant feature that allows you to extract specific properties from objects and assign them to variables. This technique helps eliminate repetitive code by providing a concise syntax to access object properties directly. By destructuring objects, you can improve code readability and reduce the number of lines required to access or assign values.</p><h3>Utilizing Template Literals for Readable Strings</h3><p>Template literals, introduced in ES6, revolutionized string manipulation in JavaScript. They provide a concise and readable syntax for creating dynamic strings. With template literals, you can easily interpolate variables, perform multiline string formatting, and enhance the readability of your code. By utilizing this feature, you can write cleaner and more maintainable code.</p><h3>Functional String Composition for Dynamic Outputs</h3><p>Functional string composition is a powerful technique that allows you to create complex and dynamic strings by combining smaller string fragments. This approach enhances code reusability and reduces redundancy, as it enables the creation of reusable string formatting functions. By adopting functional string composition, you can generate dynamic outputs efficiently and achieve a higher level of code maintainability.</p><h3>Unleashing the Power of Spread Syntax for Objects and Arrays</h3><p>Spread syntax is a versatile feature in JavaScript that allows you to expand iterables such as arrays or objects. By using spread syntax, you can easily merge arrays, clone objects, pass multiple arguments to functions, and more. This powerful tool simplifies many common coding tasks and enhances the readability and efficiency of your code.</p><h3>Creating Immutable Objects with Object.assign</h3><p>Immutable objects are essential for maintaining data integrity and preventing unintended mutation. JavaScript provides the Object.assign() method, which allows you to create new objects by merging existing objects. By utilizing Object.assign(), you can ensure immutability, reduce side effects, and enhance the predictability of your code.</p><h3>Harnessing Spread Syntax for Array Manipulation</h3><p>Spread syntax is not limited to objects; it can also be used for manipulating arrays efficiently. By leveraging spread syntax, you can concatenate arrays, clone arrays, extract subsets, and perform various transformations. This feature simplifies many array-related operations and helps you write cleaner and more expressive code.</p><h3>Mastering Modern Loops</h3><p>Loops are fundamental building blocks for iteration and repetition in JavaScript. Let’s explore some modern looping techniques to enhance your coding skills.</p><h3>Moving Beyond Traditional For Loops</h3><p>Traditional for loops have been the go-to choice for many developers when it comes to iteration. However, modern JavaScript provides alternative loop constructs that are more expressive and offer added functionalities. By exploring modern looping techniques such as forEach, for…of, and for…in, you can write cleaner and more readable code.</p><pre>// Practical Example: Using forEach to Process an Array of Numbers<br>const numbers = [1, 2, 3, 4, 5];<br><br>// Using forEach to square each number<br>console.log(“Original numbers:”, numbers);<br>const squaredNumbers = [];<br><br>numbers.forEach((num, index) =&gt; {<br> const squared = num ** 2;<br> squaredNumbers.push(squared);<br> console.log(`Square of ${num} at index ${index}: ${squared}`);<br>});<br><br>console.log(“Squared numbers:”, squaredNumbers);</pre><h3>Array.reduce for Accumulation</h3><p>The reduce method is a powerful tool for accumulating values from an array into a single output. This method allows you to perform complex operations, such as summing numbers, finding maximum or minimum values, or even creating new data structures. By incorporating reduce into your coding repertoire, you can simplify and optimize many accumulation tasks.</p><h3>Simplifying Mapping and Filtering with Array Methods</h3><p>JavaScript arrays provide a range of built-in methods to simplify common tasks such as mapping and filtering. By utilizing methods like map and filter, you can write concise and expressive code that is easy to understand and maintain. These higher-order array methods enable you to manipulate and transform arrays with minimal effort, opening up possibilities for more efficient development.</p><h3>Async/Await: Simplifying Asynchronous Code</h3><p>Asynchronous programming is an integral part of modern web development, and JavaScript provides powerful tools to simplify it. Let’s explore the usage of async/await to streamline asynchronous code and improve readability.</p><h3>Understanding the Complexity of Promise Chains</h3><p>Promises have revolutionized asynchronous programming in JavaScript, but working with long chains of promises can become cumbersome. The code may become nested and difficult to interpret. Understanding the complexity involved and the challenges associated with promise chains will motivate you to explore solutions like async/await.</p><h3>Introducing Async/Await for Synchronous-Like Asynchronous Code</h3><p>Async/await is a syntactic sugar built on top of promises, designed to simplify asynchronous code. It allows you to write asynchronous code in a more synchronous-like manner, making it easier to reason about and understand. By utilizing async/await, you can eliminate excessive nesting and write cleaner, more readable code.</p><h3>Practical Example: Retrieving and Summing Asynchronous Numbers</h3><p>Let’s dive into a practical example to demonstrate how async/await simplifies asynchronous code. We’ll retrieve a series of asynchronous numbers and sum them up using async/await. This example will illustrate the power and simplicity of this approach, helping you grasp the concept in a real-world scenario.</p><pre>// Practical Example: Retrieving and Summing Asynchronous Numbers<br><br>// Simulating an asynchronous function that returns a promise<br><br>const fetchAsyncNumbers = () =&gt; {<br> return new Promise((resolve) =&gt; {<br><br> // Simulating an API call or asynchronous operation<br><br> setTimeout(() =&gt; {<br> const randomNumbers = Array.from({ length: 5 }, () =&gt; Math.floor(Math.random() * 10));<br> resolve(randomNumbers);<br> }, 2000);<br> });<br>};<br><br>// Using async/await to retrieve and sum asynchronous numbers<br><br>const sumAsyncNumbers = async () =&gt; {<br> try {<br> const asyncNumbers = await fetchAsyncNumbers();<br> console.log(“Async Numbers:”, asyncNumbers);<br><br> const sum = asyncNumbers.reduce((acc, num) =&gt; acc + num, 0);<br> console.log(“Sum of Async Numbers:”, sum);<br> } <br>catch (error) {<br> console.error(“Error fetching or summing async numbers:”, error);<br> }<br>};<br><br>// Trigger the async operation<br>sumAsyncNumbers();</pre><h3>Exploring Advanced Use Cases of Async/Await (Teaser)</h3><p>Async/await is a versatile tool that can handle more complex use cases beyond the basics. In this section, we’ll provide a sneak peek into the advanced capabilities of async/await. We’ll touch on error handling, parallel execution, and chaining asynchronous operations, providing you with a glimpse of what lies beyond the fundamentals.</p><h3>Conclusion</h3><p>Congratulations on mastering the essential tips and tricks for efficient JavaScript development! In this article, we explored the evolution of JavaScript, the importance of front-end development, debugging techniques, writing concise and efficient code, mastering modern loops, and simplifying asynchronous code with async/await. You now have the knowledge and tools to enhance your JavaScript skills and become a more efficient developer.</p><p>Remember, this is just the beginning of your journey. JavaScript is a vast and ever-evolving language. Embrace the vast possibilities and keep exploring advanced topics to expand your expertise further. Stay tuned for future content that will delve deeper into the exciting world of modern JavaScript.</p><p>Now, it’s time for you to take action! Like and subscribe to our blog to receive updates on new articles and exciting JavaScript content. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a77ead8b99c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>