<?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 Lucia Harcegova on Medium]]></title>
        <description><![CDATA[Stories by Lucia Harcegova on Medium]]></description>
        <link>https://medium.com/@zhiva.tech?source=rss-58b445df83ac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0AXarsVP0ZaRykg1SIaDKA.jpeg</url>
            <title>Stories by Lucia Harcegova on Medium</title>
            <link>https://medium.com/@zhiva.tech?source=rss-58b445df83ac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 00:39:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zhiva.tech/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[Sustainable Web Design: How Dark Mode Can Reduce Your Digital Carbon Footprint]]></title>
            <link>https://medium.com/@zhiva.tech/sustainable-web-design-how-dark-mode-can-reduce-your-digital-carbon-footprint-d2c516b98933?source=rss-58b445df83ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2c516b98933</guid>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[web-sustainability]]></category>
            <category><![CDATA[ethical-design]]></category>
            <category><![CDATA[sustainability]]></category>
            <dc:creator><![CDATA[Lucia Harcegova]]></dc:creator>
            <pubDate>Mon, 04 Mar 2024 10:54:12 GMT</pubDate>
            <atom:updated>2024-03-04T13:13:04.467Z</atom:updated>
            <content:encoded><![CDATA[<h4>The role of dark mode in sustainable web design or the surprising ways your screen’s color scheme influences sustainability and accessibility</h4><p>Did you ever think that the colors on your screen could be not just a matter of aesthetics, but have an impact on the sustainability of the site? I was quite surprised to find out, as it just never crossed my mind that a seemingly innocent choice of color could have a greater impact than just making something pretty or not. I was probably just living under some rock (or walking my dog), while the debate over various benefits of dark mode has been booming.</p><h4><strong>Is dark mode better for the planet? Dark mode and energy savings</strong></h4><p>The basic concept seems to be pretty simple: <strong>the colors displayed on a screen can change how much battery your phone or computer uses</strong>. Google, among others, looked into this by comparing how much battery gets used when you use Google Maps in its regular, light mode versus its dark mode. They found that using dark mode can save a lot of battery — up to <a href="https://www.zdnet.com/article/google-heres-why-dark-mode-massively-extends-your-oled-phones-battery-life/">63% less energy</a> than the light mode. Another research study conducted at Purdue University, also took a closer look at this idea and found that switching from light to dark mode can save <a href="https://dl.acm.org/doi/10.1145/3458864.3467682">on average 67%</a> of phone battery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QUKlagWQPISmzwNUtxUCWw.png" /><figcaption>Environmental impact of color on OLED displays</figcaption></figure><p><strong>If dark mode saves so much energy, how come we haven’t all switched to it yet? If this research has been out for some years now, are the app makers deliberately wasting our batteries?</strong></p><p>Not really. The reality is again not so black and white. The studies have also found that the energy savings are actualized only on OLED displays, and for devices with LCD screens, there is no difference in energy consumption.</p><p>OLED displays’ technology illuminates each pixel individually, and hence the brighter colors will require more energy to be displayed, while pixels displaying pure black, can be effectively turned off completely. Meanwhile, LCD screens light their pixels from the edges, so the same amount of power is used even if the screen is entirely black.</p><p>This is an important fact to consider, as most laptops have LCD screens, and only about half of the modern smartphones being produced use an OLED display. For better context, the first iPhone to use an OLED screen was released in 2017. Therefore, for any model before the iPhone X, switching to dark mode would not make a difference in energy consumption.</p><p>Another point to keep in mind when considering switching to dark mode is that the study tested energy savings at 100% screen brightness. If the device was set to auto-brightness, the savings dropped significantly. Thus, a more realistic difference in energy consumption could be around 15%. It’s also important to note that dark mode doesn’t make a difference when displaying media, such as photos or videos.</p><h4><strong>Is dark mode better for people? Accessibility and dark mode.</strong></h4><p>Another factor to consider with dark mode is the accessibility of such an interface. <a href="https://www.nngroup.com/articles/dark-mode-users-issues/">User research</a>, conducted by Nielsen and Norman Group, has found that many people find dark mode easier on the eyes, which even helps them avoid unpleasant headaches. However, individuals with certain eye conditions, such as cataracts, may struggle to read dark text on a light background. Conversely, people with other conditions, for example, those who have myopia, astigmatism, or dyslexia, might find reading light text on a dark background difficult. You can read more about accessibility and dark mode, for instance, in <a href="https://www.boia.org/blog/dark-mode-can-improve-text-readability-but-not-for-everyone">this blog</a> from the Internet Accessibility Bureau.</p><h4>So should we switch to dark mode?</h4><p>We have seen that dark mode can not only create aesthetic and modern interfaces but also provide benefits in terms of energy consumption and be essential for enhancing the user experience for people with various conditions. However, a global adoption of only dark mode is probably not the way to go. <strong>While it’s surely useful to keep in mind the energy-saving potential of darker colors, we should not go all black.</strong></p><p>Ideally, we should find a middle ground and allow users to choose what they prefer. <strong>This is what many users are already doing by choosing dark mode in their device settings</strong>. As web developers and website owners, we should consider how we can respect their choice, i.e., enable dark mode on our sites.</p><p>There are multiple ways of doing this, and I might later write a simplified tutorial on how to enable dark mode in Webflow and your Rails application. In the meantime, there is <a href="https://css-tricks.com/a-complete-guide-to-dark-mode-on-the-web/">a great article</a> by CSS Tricks that digs deep into dark mode implementation.</p><p><em>This article is part of a zhiva.tech newsletter. If you would like to receive similar content monthly directly to your mailbox you can subscribe </em><a href="https://zhiva.tech/"><em>here</em></a><em>.</em></p><p><a href="https://zhiva.tech/">Ethical Web Practices for a Sustainable Future</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2c516b98933" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[All you need to know about W3C Web Sustainability Guidelines]]></title>
            <link>https://medium.com/@zhiva.tech/all-you-need-to-know-about-w3c-web-sustainability-guidelines-068eaf85c9a7?source=rss-58b445df83ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/068eaf85c9a7</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[web-sustainability]]></category>
            <category><![CDATA[ethical-web-development]]></category>
            <dc:creator><![CDATA[Lucia Harcegova]]></dc:creator>
            <pubDate>Mon, 29 Jan 2024 12:37:09 GMT</pubDate>
            <atom:updated>2024-01-29T12:45:53.089Z</atom:updated>
            <content:encoded><![CDATA[<h4>W3C Web Sustainability Guidelines essentials</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BMV4TqtPmbgiGK1yHckyGw.png" /><figcaption>Web sustainability guidelines made simple on websustainabilityguidelines.com</figcaption></figure><p><strong>Every industry has a moment when a shift towards greater responsibility starts becoming an imperative rather than just a nice idea</strong>. The automotive industry is moving towards electric cars, enforced by production quotas. The fashion industry offers more sustainable alternatives to fast fashion and improves the supply chain standards transparency under consumer and governmental pressure, etc.</p><p><strong>For the web industry, the moment could be approaching now,</strong> marked by the introduction of the Web Sustainability Guidelines. Developed by the W3C, these guidelines represent a significant leap toward integrating sustainability into digital products and services. Let’s see what is important to know about this game-changing document.</p><h4>What are Web Sustainability Guidelines?</h4><p>Web Sustainability Guidelines(WSG) are a set of best practices published by the W3C, The World Wide Web Consortium (<a href="https://www.w3.org/">https://www.w3.org/</a>). It is a document, that formalizes existing best practices from the industry. The guidelines are designed to help digital product and service creators make their digital products more sustainable, prioritizing people and the planet.</p><blockquote><strong>Every industry has a moment when a shift towards greater responsibility starts becoming an imperative rather than just a nice idea</strong>…</blockquote><blockquote><strong>..For the web industry, the moment could be approaching now,</strong> marked by the introduction of the Web Sustainability Guidelines.</blockquote><h4>Who created them?</h4><p>The Web Sustainability Guidelines were developed by web sustainability experts, based on measurable, evidence-based research. The draft was edited by Tim Frick (from Mightybites, author of <a href="https://www.oreilly.com/library/view/designing-for-sustainability/9781491935767/">Designing for Sustainability</a>), and <a href="https://alexanderdawson.com/">Alexander Dawson</a>.</p><h4><strong>Why should we care about the guidelines?</strong></h4><ul><li><strong>Industry-wide impact</strong> -The WSG (Web Sustainability Guidelines) serve as a powerful signal within the industry, emphasizing the importance of sustainability.</li><li><strong>Guidance for Digital Professionals </strong>— They offer a practical guide for digital professionals on implementing sustainable practices and serve as a valuable resource for both creators and sustainability specialists in the digital field.</li><li><strong>First step in establishing Sustainability Standards </strong>— While not being an W3C standard yet, the web sustainability guidelines are a significant step towards making sustainability considerations a standard practice in the design and development of digital products.</li><li><strong>Alignment with wider reporting standards </strong>— the WSG are designed in alignment with GRI Standards (Global Reporting Initiative), so there is a great potential for their broader use in the sustainability domain. They can be used not only by the creators of digital products but also by sustainability consultants and departments.</li><li><strong>Catalyzing Industry Change </strong>— Acts as a catalyst for integrating environmental considerations in the tech sector.Encourages the adoption of eco-friendly strategies in the digital realm.</li></ul><h4>How can we use these guidelines?</h4><p>The guidelines are divided into four sections: <strong>UX Design,</strong> <strong>Web Development</strong>, <strong>Infrastructure and Hosting Systems</strong>, and <strong>Business Strategy and Product Management</strong>. While interrelated, they are separated to facilitate implementation by different professionals and teams. So depending on your or your team&#39;s specialization, you can decide to learn about possible actions and success criteria in that particular domain.</p><p>These sections are not exhaustive but serve as prompts to consider and minimize impact at each step of the work process.</p><h4><strong>Will the web sustainability guidelines become obligatory?</strong></h4><p>Probably not soon, but I can imagine them being translated into some enforceable industry standard someday. In the EU, sustainability reporting has been mandatory for large companies since January 1, 2024. While it might take time to extend to smaller businesses, understanding and minimizing impacts is increasingly important. With climate change posing an undeniable threat, initiatives to reduce carbon emissions are becoming crucial across all industries.</p><h4>What resources and tools are available to help you adopt these guidelines?</h4><p>Each guideline, and there are 93 of them, comes not only with a checklist of actions but also with resources to learn more about the particular guideline. There are also examples being added to illustrate the implementation of best practices. There is also a growing body of literature, videos, and other resources to help us understand the impacts and implement solutions to minimize them.</p><p>I also created a simple platform, to make learning about the guidelines easier. On <a href="https://www.websustainabilityguidelines.com/">websustainabilityguidelines.com</a> you can easily <strong>filter the guidelines by your area</strong>, and also more easily find those that can have a high impact while requiring low effort, ie. to<strong> find a low-hanging fruit of minimizing the impact of your website</strong> and make it simpler to start with the implementation wherever you are.</p><p>To conclude, the W3C Web Sustainability Guidelines are more than just guidelines; they are a practical blueprint for meaningful change. With actionable steps and accessible resources, they demystify the path toward sustainable web practices. For me they also can be synthesized into a powerful message, <strong>start where you are, use what you have, and do what you can</strong> — the sustainability journey begins always with a single step first.</p><p><em>This article is part of a zhiva.tech newsletter. If you would like to receive similar content monthly directly to your mailbox you can subscribe </em><a href="https://zhiva.tech/"><em>here</em></a><em>.</em></p><p><a href="https://zhiva.tech/">Ethical Web Practices for a Sustainable Future</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=068eaf85c9a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chrome Extensions to level up your sustainable web design game]]></title>
            <link>https://medium.com/@zhiva.tech/chrome-extensions-to-level-up-your-sustainable-web-design-game-39c32b89b0c1?source=rss-58b445df83ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/39c32b89b0c1</guid>
            <category><![CDATA[sustainable-design]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web-sustainability]]></category>
            <dc:creator><![CDATA[Lucia Harcegova]]></dc:creator>
            <pubDate>Thu, 28 Sep 2023 10:30:34 GMT</pubDate>
            <atom:updated>2023-09-28T10:30:52.024Z</atom:updated>
            <content:encoded><![CDATA[<h4>How can you quickly check how much carbon is emitted by a website?</h4><p>If you want to quickly develop an eye for sustainable web design and best practices, you can, in addition to running sites through a website carbon calculator (which I explored in <a href="https://medium.com/@zhiva.tech/what-is-the-carbon-footprint-of-a-web-project-ac44a262fbf">another article)</a>, make use of browser extensions that help you estimate the carbon impact of a site without having to leave the site. Many of these extensions also clearly break down the criteria, which can help you gain a better understanding of what influences the environmental impact of a site according to industry standards.</p><p>Here are some that I find useful, you can choose your own favorite.</p><h4>Top 3 Chrome extensions to measure and understand the environmental impact of a website</h4><p><strong>🥇</strong><a href="https://chrome.google.com/webstore/detail/globemallow/jibhiolaefbcfiahgolfpmngjefngdmd"><strong>Globemallow</strong></a></p><p>Simple extension, which shows a preview of the sustainability grade (A being the best). If you open it up you can see the website sustainability scoring criteria broken down into single action points with their separate score. This I find to be a great way to get a better understanding of what one could do to improve the environmental impact of a website, especially if you are just starting to familiarize yourself with different eco-web practices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*lOHsLZRbZPvdmF_TO6QXsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*SMRXOif92L4gOylPOD8hpw.png" /><figcaption>Preview of Globemallow extension</figcaption></figure><p>One can also expand on the comparison of different sites from their browsing history and see an explanation of the various criteria and action points.</p><p>🥈 <a href="https://chrome.google.com/webstore/detail/greenit-analysis/mofbfhffeklkbebfclfaiifefjflcpad"><strong>GreenIT-Analysis</strong></a></p><p>An extension developed by the French GreenIT allows you to check a website’s ‘ecoIndex.’ The analysis must be accessed through developer tools and is not as quick as the previous extension. However, the analysis provides a helpful checklist that can assist you in understanding how to make a website more environmentally friendly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*uEVjrFlt18yzUzXspJoFpw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*r5mJFHNNsYCIRCWyYDX9Ug.png" /><figcaption>GreenIT-Analysis report example in developer tools.</figcaption></figure><p>🥉<a href="https://chrome.google.com/webstore/detail/website-footprint/jlpnojjijmliogpegigbllcnpckflnik"><strong>Website Footprint</strong></a></p><p>A simple and very quick way to check the carbon footprint of a site you are currently browsing. It not only displays the estimated emissions generated by one visit and the ranking compared to the average website but also provides an overview of your digital footprint as a user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*mU3V5g9RCmB4ttB_E4qKSQ.png" /><figcaption>Example use of Website Footprint</figcaption></figure><p>These are the three Chrome extensions I found to be the most useful to measure website emissions and you can give them a try as well and make informed choices for a greener digital experience.</p><p>Thank you for reading, and please let me know what you think or if you have any other tried-and-true suggestions in your toolbox.</p><p><em>This article is part of a zhiva.tech newsletter. If you would like to receive similar content monthly directly to your mailbox you can subscribe </em><a href="https://zhiva.tech/"><em>here</em></a><em>.</em></p><p><a href="https://zhiva.tech/">Ethical Web Practices for a Sustainable Future</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39c32b89b0c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is the carbon footprint of a web project?]]></title>
            <link>https://medium.com/@zhiva.tech/what-is-the-carbon-footprint-of-a-web-project-ac44a262fbf?source=rss-58b445df83ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac44a262fbf</guid>
            <category><![CDATA[digital-footprint]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web-sustainability]]></category>
            <dc:creator><![CDATA[Lucia Harcegova]]></dc:creator>
            <pubDate>Thu, 28 Sep 2023 08:37:02 GMT</pubDate>
            <atom:updated>2023-09-28T10:54:27.158Z</atom:updated>
            <content:encoded><![CDATA[<h4>Short answer: It is hard to tell.<br>Long answer: It is hard to tell, but we can estimate the CO2 emitted by a website using the industry’s standardized methods and existing tools.</h4><p>This might not be a surprise to you. I’m usually the first to be skeptical when someone claims that we can determine the exact amount of CO2 emitted by anything and whether that’s harmful or beneficial. However, a considerable amount of research has been conducted on this topic, and if we’re willing to accept a certain level of simplification, we can estimate the carbon footprint of our web project and work towards its improvement.</p><p>And why to accept this simplification? Just as with any goal, if we want to make improvements, we need a metric to measure our progress and efforts. And the carbon footprint calculated using at least some things we can measure can serve us as such.</p><p>That being said, the carbon footprint of a web project can be estimated by the amount of energy it requires to be delivered to the users and the carbon intensity of this energy.</p><p>So when we want to estimate the carbon footprint of our project we can ask: What is the amount of data being transferred and stored, and where does the electricity powering all this process come from?</p><p>This can still be a significant inquiry, particularly if you aren’t super experienced in web development or primarily focus on design. It may also raise further questions:</p><h4>Where can we get the data on the amount being transferred?</h4><p>The amount of data being transferred for a single page view can be easily proxied by the<strong> page weight</strong>, ie. the overall kilobyte size of a website. This number you can find this either by looking into the developer tools in the browser, reading it from your hosting provider, or just running your site through some external tool or extension.</p><blockquote>..when we want to estimate the carbon footprint of our project we can ask: What is the amount of data being transferred and stored, and where does the electricity powering all this process come from?</blockquote><p>This might not be an easy calculation to out of the top of the head and I would assume that you don’t have the time to reinvent the wheel when trying to estimate the environmental impact of your digital project. Luckily, there is an ever-growing number of website carbon calculators and the industry is unifying around a standardized methodology for estimating emissions.</p><p><strong>The Sustainable Web Design methodology then takes this energy requirement for a single page visit and multiplies it by the average carbon intensity of the energy source</strong>. The carbon intensity varies depending on the energy source. For instance, the carbon intensity of energy produced from burning coal differs significantly from that generated by wind or solar plants, with average estimates of 442 g/kWh vs. 50 g/kWh, respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*fu1ounYcHJB1HnW9nkcFjw.png" /><figcaption>Simple: Paste the website URL to get CO2 estimate</figcaption></figure><h3>Comparison of website carbon calculators</h3><p>Despite the fact that most of them use the <a href="https://sustainablewebdesign.org/calculating-digital-emissions/"><strong>Sustainable web design</strong></a> methodology, which is also based on using <a href="https://www.thegreenwebfoundation.org/co2-js/"><strong>CO2.js</strong></a><strong> </strong>(an open-source library managed by the Green Web Foundation), there might be slight differences in the way they measure and present the results.</p><p>My favorite would be <a href="https://ecograder.com/"><strong>Ecograder</strong></a>, as it breaks down the results and offers actionable suggestions for improving the score.</p><p>You should try them out and choose your own champion! Here is my comparison of some of the main ones, along with a summary of their main features.</p><blockquote>Just as with any goal, if we want to make improvements, we need a metric to measure our progress and efforts.</blockquote><h4>🌎 <a href="https://www.websitecarbon.com/">Websitecarbon</a></h4><p>Created by Wholegrain Digital, a UK-based digital agency considered a trailblazer in digital sustainability, it simply takes a URL and provides you with the estimated amount of CO2 per single page visit. It also offers a number of real-life analogies, showing you what else shares the same carbon footprint as your website (assuming it receives 10,000 visitors a month). It employs the Sustainable Web Design calculation methodology, considering whether the hosting provider is deemed ‘green’ by the Green Web Foundation but utilizing the carbon intensity of the international average grid.</p><p>➕ Very nice easy to navigate design</p><p>➕ Fast and simple answer</p><p>➕ Gives examples of low-carbon websites</p><p>➕ Offers a batch you can embed to your website, to show the CO2</p><p>➖ No particular suggestions for improvement, only links to general articles</p><p>➖ Let you do the math if you want to know your monthly impact, but have a different number of visitors than 10,000</p><p>➖ Not really taking into consideration the location of the data center (?)</p><p><strong>All in all, it’s a great tool if you simply want to quickly determine your site’s carbon footprint and share it with others. 🚀</strong></p><h4>🌎<a href="https://ecograder.com/"> Ecograder</a></h4><p>Developed by another leader in digital sustainability, the US-based agency Mightybytes, Ecograder not only takes a URL but also calculates your sustainability score, breaking it down into a relatively detailed report with suggestions for improvement. The score takes into consideration the CO2 result using CO2.js (so far the industry standard) and combines it with the Google Lighthouse web performance report adding to the score whether the host is green.</p><p>➕ Offers actionable suggestions for improvement</p><p>➕ I like the simple and easy-to-use page structure and design</p><p>➕ Breaks down your carbon score into different areas</p><p>➕ Allows you to adjust to your real traffic</p><p>➖ Annoying cookie banner jumping on me every time I open the site, but it might be just me not seeing any confirm or decline button</p><p>➖ It can take a longer time since it is computing the result from different sources</p><p><strong>I would say it’s worth the wait, as it can serve as an excellent learning tool for web performance and sustainability. It breaks down the score in a very clear manner, and the action steps are often accompanied by useful ‘Learn more’ links.</strong></p><h4>🌎 <a href="https://digitalbeacon.co/">Beacon</a></h4><p>Designed by a sustainability consultancy, it also enables you to calculate the environmental impact of a web page, providing a breakdown and offering advice on measures you can take to improve. It’s not entirely clear whether they are using CO2.js or what is their methodology, but what is evident is that the tool calculates based on the website’s size in GB and the CO2 per kWh.</p><p>➕ Has a Chrome and Firefox extension that allows you to run the page test (opens up a new window with the Beacon report)</p><p>➕ Gives actionable advice on improvement and provides links to learning resources</p><p>➕ Allows you to adjust to your real traffic</p><p>➕ Allows you to adjust to calculate monthly CO2 also based on the percentage of returning vs. new visitors</p><p>➕ Show a history of previous measurements of the site</p><p>➕ You can embed a batch to your site to share the result</p><p>➕ Comparatively fast</p><p>➖ Not a clear methodology explanation</p><p>➖ I find the very modern UI to be harder to comprehend, fx. when going through “opportunities for improvement”</p><p><strong>A very popular and useful tool that provides advice and a wealth of information. Ultimately, it’s a matter of personal preference, and I find Ecograder to be much easier to use when it comes to understanding improvement points.</strong></p><h4>🌎 <a href="https://ecoping.earth/">Ecoping</a></h4><p>A tool designed mainly for businesses that are measuring and reporting on their environmental impact. It is very precise and offers continuous monitoring of the page, taking into account the actual number of views and the real-time carbon intensity of the grid in the country where the site is hosted. It gives you “EcoScore” and provides tips on how to improve it. It also checks the sustainability of the third-party providers and adds its impact. However, the tool is subscription-based and requires registration.</p><p>➕ Live carbon intensity data</p><p>➕ Daily monitoring and calculation based on actual visitors</p><p>➕ Higligts actions that should be taken to improve the website</p><p>➖ Requires registration and the free plan allows you to check only one site</p><p><strong>It’s a great tool if you own a website and want to see detailed information about the CO2 it produces to offset exactly or report on it. However, I don’t find it as useful as a learning tool for developing an understanding of sustainable design practices because you can’t test multiple sites.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eOfr7_jkfFeNZ9qw9DsxHg.png" /><figcaption>WebCarbon Calculator comparison overview table</figcaption></figure><p>The digital world is becoming increasingly eco-conscious, with sustainability becoming a web standard*. Whether you are a developer, designer, or a website owner, I believe that understanding the estimated impact, by, for example, using one of the calculators, can be a great first step toward greening your practice and learning more about how to bring sustainability into your digital life.</p><p>Thank you for reading. If you’d like to check the environmental impact of websites you’re browsing without having to open any of the calculators, take a moment to read <a href="https://medium.com/@zhiva.tech/chrome-extensions-to-level-up-your-sustainable-web-design-game-39c32b89b0c1">this super-short article</a> introducing a couple of useful browser extensions that allow you to do exactly that.</p><p><em>This article is part of a zhiva.tech newsletter. If you would like to receive similar content monthly directly to your mailbox you can subscribe </em><a href="https://zhiva.tech/"><em>here</em></a><em>.</em></p><p><a href="https://zhiva.tech/">Ethical Web Practices for a Sustainable Future</a></p><p>*On August 30, 2023, the World Wide Web Consortium (W3C), published Web Sustainability Guidelines</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac44a262fbf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Iterating over an array in Javascript and Ruby]]></title>
            <link>https://medium.com/@zhiva.tech/iterating-over-an-array-in-javascript-and-ruby-450f963e39dc?source=rss-58b445df83ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/450f963e39dc</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[junior-developer]]></category>
            <category><![CDATA[codingbootcamp]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <dc:creator><![CDATA[Lucia Harcegova]]></dc:creator>
            <pubDate>Fri, 23 Dec 2022 15:45:25 GMT</pubDate>
            <atom:updated>2022-12-23T15:46:08.242Z</atom:updated>
            <content:encoded><![CDATA[<h4>Master the main methods to work with array elements in Javascript and Ruby.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HkozV8PpZfnSuy9M91AHlA.jpeg" /><figcaption>Photo by Luca Bravo on Unsplash</figcaption></figure><h4><strong>Using iterative array methods instead of for loop</strong></h4><p>One way to iterate over elements of an array is by using a for loop, where we define the starting point, an expression to be evaluated upon entry into the loop, and one to be evaluated after. I struggled to understand how<em> for loops</em> work in my initial coding classes, but I felt proud when I finally grasped the concept. However, I haven’t used a<em> for loop</em> since then. In Ruby and JavaScript, arrays come with built-in methods that allow us to loop through array elements and perform an action, just like a <em>for loop</em> would.</p><h4><strong>Are iterative methods completely replacing the need for for loops ?</strong></h4><p>Probably not completely, but I can tell you that I haven’t seen a for loop in any codebase I have worked with up until now. As a rule of thumb, use .forEach() in JavaScript and .each in Ruby. However, you might still want to use a for loop in some cases, as it gives you better control over the condition, index, and allows you to exit it using the break keyword. Additionally, a for loop can be faster in performance if you are working with a large amount of data. For example, you might want to use a <em>for loop</em> when looping through a range of numbers (and you don’t want to put them into an array first), or when you want to increment the index by a number different than one (although you can use a condition inside of .forEach/.each to do that as well).</p><blockquote>I haven’t seen a for loop in any codebase I have worked with up until now. As a rule of thumb, use .forEach() in JavaScript and .each in Ruby.</blockquote><h3><strong>.forEach() in Javascript vs .each in Ruby</strong></h3><p>Their functionality is almost the same, the most obvious difference being the name of the methods, followed by slight differences in syntax.</p><h4><strong>How to write .forEach() in Javascript</strong></h4><p>This array method <strong>takes a function as an argument</strong>, which can take up to three arguments or rather gives you access to them so you can <strong>use them in your iteration</strong>: the current element, the index, and the array itself. You <strong>don’t need to specify all three</strong> of them if you are not planning to use them, but you <strong>must</strong> <strong>include the current element</strong> at a minimum. The method will then loop through each and every element of the array (unless you specify some condition) and perform your desired operation with these elements.</p><p>If you pass the index as an argument, you will have access to it as well and can use it, for example, to reassign values of the current elements and hence modify the array.</p><pre>const myArray = [&quot;element_1&quot;, &quot;element_2&quot;, &quot;element_3&quot;]<br><br>myArray.forEach(element =&gt; console.log(element))<br><br>// iterates over the array and logs out current element<br>// the function passed to forEach can be an arrow function, or regular function<br><br>myArray.forEach((element, index) =&gt; console.log(element,index))<br><br>// iterates over the array and logs out current element and its index<br>// you have access to the index by passing it as a argument to the callback function<br><br>myArray.forEach((element, index, array) =&gt; console.log(element, index, array))<br><br>// iterates over the array and logs out current element,its index and the array itself</pre><h4><strong>How to write .each in Ruby</strong></h4><p>Very similarly to any other array method in Ruby, the method is used on an array and then passed a block. This can be either a block declared using <strong>{}</strong> or <strong>do..end</strong>. Which one to use depends on your personal preference, but the best practice is to use curly braces {} when the block is no more than one line long and to use <em>do…end</em> for longer blocks of code. <strong>In ||, you pass </strong>the argument, the <strong>current element</strong>, which you can then perform operations with or use its value. However, the .each method <strong>doesn’t automatically give you access to the element’s index</strong>; to utilize it, you would want to use <strong>.each_with_index.</strong></p><p>The best practice is to use curly braces <strong><em>{}</em></strong> when the block is no more than one line long and to use <strong><em>do…end</em></strong> for longer blocks of code</p><pre>myArray = [&quot;element_1&quot;, &quot;element_2&quot;, &quot;element_3&quot;]<br><br>myArray.each { |element| puts element }<br><br># OR<br><br>myArray.each do |element|<br>  puts element<br>end<br><br># iterates over each and every element of the array and prints it to the console<br><br>myArray.each_with_index { |element, index| puts element, index }<br><br># prints to the consle element with its index</pre><h4><strong>Differences in .each, .forEach() Javascript and Ruby</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DV6n88h1z7hcN_Mb105BpA.png" /><figcaption>Differences in .each and .forEach in Javascript and Ruby</figcaption></figure><h3><strong>.map in Javascript and Ruby</strong></h3><p>In Javascript and Ruby, <em>.map</em> is a method that will, similarly to .forEach and each, go through all elements of an array and perform an action defined in a block but unlike .forEach it will <strong>return a new array</strong>. If the array contains nil/null values it will also try to execute the function on these, leading to possible exceptions. In Javascript, there is no native <em>.map</em> method for Objects, in Ruby you can iterate with<em> .map </em>also over Hashes and Ranges (be aware that the return object will be an array still). <em>Map</em> method is mainly used to transform data, without modifying the original data.</p><h4><strong>How to write .map in Javascript</strong></h4><p>In Javascript<em> .map() </em>is an array method that takes a function as an argument and returns a new array after executing it for each element in the array. This can be an arrow function, callback, or an inline callback function. Except for the current element, we can have access also to the index and array itself, if we pass them as arguments to the function. As mentioned above, there is no native .map for Object in Javascript, so in order to iterate over an object you can use <em>for…in loop.</em></p><pre>const array = [&quot;linda&quot;, &quot;falafel&quot;, &quot;chips&quot;]<br><br>array.map(element =&gt; element.toUpperCase())<br><br>// returns a new array of upcased values<br>// [&quot;LINDA&quot;, &quot;FALAFEL&quot;, &quot;CHIPS&quot;]<br><br>array.map((element,index) =&gt; …)</pre><h4><strong>How to write .map in Ruby</strong></h4><p>By calling the method on an existing array, and passing a block as an argument you will get a new array with all elements modified by the effects of the block. This block, similarly to any other Ruby block can be surrounded either by <em>{}</em> or <em>do..end. </em>The original array won’t be changed, however, if you want it to be changed you can always reach for .map! which will change the original array.</p><blockquote>Also<em> </em>cool as Ruby is, it offers us, for simple method calls that will fit into one line, a shorthand <strong><em>.map(&amp;:method_you_want_to_use)</em></strong><em>.</em></blockquote><p>In Ruby you can call <em>.map</em> also on a hash or a range, the <strong>return value will though still be an array </strong>(see the example below), so if creating a modified copy of a Hash is what you aim for, then I would suggest using different methods specific to Hashes. Also<em> </em>cool as Ruby is, it offers us, for simple method calls that will fit into one line, a shorthand .map(&amp;:method_you_want_to_use)<em>. </em>Any method can be passed to the block as an argument to map, and it will be executed for every element.</p><pre>array = [&quot;linda&quot;, &quot;falafel&quot;, &quot;chips&quot;]<br><br>array.map { |element| element.upcase }<br><br># returns a new array of upcased values<br># [&quot;LINDA&quot;, &quot;FALAFEL&quot;, &quot;CHIPS&quot;]<br># more concise way of writing the code would be array.map(&amp;:upcase)<br><br>hash = { name: &quot;Linda&quot;, best_food: &quot;falafel&quot;, snack: &quot;chips&quot; }<br><br># need to pass both key and the value as arguments<br># single argument is read as an array [key, value]<br># we use _key or _ to indicate that it won&#39;t be used<br><br>hash.map { |_key, value| value.upcase }<br><br># returns a new array of upcased values<br># [&quot;LINDA&quot;, &quot;FALAFEL&quot;, &quot;CHIPS&quot;]<br><br>hash.map { |key, value| [key,value.upcase] }.to_h<br># returns an array of arrays with key value pairs, that we need to convert back to hash<br># {:name=&gt;&quot;LINDA&quot;, :best_food=&gt;&quot;FALAFEL&quot;, :snack=&gt;&quot;CHIPS&quot;}<br># we would use .transform_values or .transform_keys, instead of .map to get a new hash with modified key/values in more concise way</pre><h4><strong>Differences in .map Javascript and Ruby</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n8fqPboXSSMi23MAQ3yE2A.png" /><figcaption>Differences in .map between Javascript and Ruby</figcaption></figure><h3><strong>When to use .map and when .forEach (.each in Ruby)</strong></h3><p>There isn’t much you can do with one that you couldn’t do with the other, but their <strong>return value is what makes a difference</strong> depending on what you are planning to do. While .map iterates over every element in the array, performs some action on it, and returns a copy of the original array with the modified elements, .each (or .forEach in JavaScript) doesn’t return anything; it simply performs an action with the elements of the original array and returns undefined.</p><p><strong>You want to chain multiple methods</strong><br> Use <strong>.map</strong>, as it returns an array that you can apply other array methods to, such as .filter(), .find(), etc. .each will return undefined and hence cause an error if you try to continue performing actions on it.</p><p><strong>You want to modify the original array</strong><br> Use <strong>.forEach (.each)</strong>, as it allows you to do some action on each element instead of returning a copy of it.</p><p><strong>You want to keep the original array untouched</strong><br> Use <strong>.map </strong>to create a copy of an array after performing some action with each element.</p><p><strong>You want to use the values of the elements</strong><br> Use<strong> .forEach() (each)</strong> if you want to use the values of array elements and do something with them, such as printing out their values, attaching an event listener, or creating an HTML tag for each element, etc.</p><h4>To sum up</h4><p>In this article, I went over two similar, but different, iterative methods in Javascript and Ruby. Being a bilingual coder is not always easy, therefore I am trying to explain some methods and concepts for both languages side by side. I hope that this will help at least someone to understand better and remember the methods syntax and use, as I too can still get frustrated about why my Ruby syntax doesn&#39;t work in my JS code and the other way around. Have a wonderful day and juniors remember, it takes almost 3 years of coding to have 2–3 years of experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=450f963e39dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Finding a job after coding bootcamp]]></title>
            <link>https://medium.com/@zhiva.tech/finding-a-job-after-coding-bootcamp-d1322d1f3d49?source=rss-58b445df83ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1322d1f3d49</guid>
            <category><![CDATA[job-hunting]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Lucia Harcegova]]></dc:creator>
            <pubDate>Wed, 14 Dec 2022 13:55:55 GMT</pubDate>
            <atom:updated>2022-12-14T15:09:11.007Z</atom:updated>
            <content:encoded><![CDATA[<h4>My experience of searching and finding the first job after LeWagon web development bootcamp</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rd9IZ3SLf5vJJ_qCd6dz9w.jpeg" /></figure><p>The statistics say “<em>81% of graduates found a job within 3 months, 93% had a job after 6 months</em>”, my main question after finishing the bootcamp was “but how?”. When sitting down to remodel my wannabe “sustainability and human rights professional” job-seeking materials, I got overflown by thoughts that I will surely be in the remaining 7% of graduates, end up on the street, or more probably, move back into my parent’s house. So the first thing I needed to do was to take a deep breath and let some reason sink in. These statistics don’t lie, people change careers and everyone who has been trying to find a job after the bootcamp found it in the end, there is no reason why especially I should be the exception. It all comes down to it being a matter of ”sooner or later”.</p><p>I had some time, thanks to being registered as unemployed, but still wanted to get a job rather sooner than later. It was before the holiday season, and my job applications would probably not be properly answered before January, so I focused on learning, working on my projects for some weeks, and developing my “job-searching strategy”. I ended up getting a job offer roughly two months after I started applying and can sum up my experience and learnings into the following few points.</p><h4>1. Searching for a job is a job itself</h4><p>Finding the first job in a new field might not be easy. What helped me was a piece of advice I heard many times already, namely, that I should consider the job-hunt as any other project or job. Have a strategy and a system to go about it. Have daily and weekly goals, keep track of open positions, my applications, companies, and people to contact in an excel sheet. Have set “working hours”, so it doesn’t become a never-ending struggle but also to know when and where will I be sitting down to work on the tasks I set for myself. This all helped me to keep the motivation up while braving the gates of the new tech world.</p><h4>2. Be the perfect match</h4><p>Reading the job ad and modifying the materials to be the candidate of their dreams, can be very crucial to be invited for an interview. My mentor in the career center was telling me to always analyze the job ad by asking a couple of questions and then presenting the parts of my experience in a way that fits the company’s idea of the ideal candidate.</p><p><em>What are the team and work environment like?</em></p><p>Understanding how they present themselves as a company allowed me to decide whether I should present myself as <em>“thriving in small teams, and have experience managing multitude of tasks independently”</em> or “<em>thriving in agile teams, where learning and constant feedback are shared values</em>”. All this can be deducted from the job ad if they are “dynamic” I used that word too, or if they kept dropping words like “<em>agile</em>”, and “<em>fast-paced</em>” so did I and bridged it with examples from “previous life” or professional experiences. Also, if they mentioned pair programming, then I made sure not to forget to write, that from LeWagon we already have experience with that.</p><p><em>What technical skills they are looking for?</em></p><p>This feels the most uncomfortable for a beginner, but luckily there is a list of technical skills we gain during the course and have experience using in the two final projects. So I would write those skills, that were said to be needed by the job ad. The important part is to transmit that one is eager to learn whatever is needed for the role. On that note, I know people who found a job working with technologies they never worked with before fx. Java, and C++ and were taught on the job. Knowing one programming language opens the door to learning others as one already understands what an array, iteration, functions, and conditional statements are, as they create the base of all programming languages. I would instinctively disqualify myself from jobs requiring knowledge of things like Docker, AWS, and other technologies I had no clue about, but then decided to apply anyway (and the job I got, listed these as required). A basic understanding of most technologies can be gained from online materials and implementing them into a project, so fx. writing a docker file following a tutorial for the Airbnb-clone project, reading about TDD, and introducing some tests allows you to write something like “<em>have experience with Docker and testing …</em>”</p><p><em>What soft skills do they need?</em></p><p>Soft skills are probably the section where we as career changers can shine the most. So if I identified three main soft skills for example communication skills, being great a team player, and attention to detail, these could all be easily linked to previous non-technical experience.</p><h4>3. Don’t wait for them to find you</h4><p>What I did, I found a list of companies working with Ruby on Rails in Copenhagen, selected the first few that seemed like they are not too big (so there are not too many rigid structures and hiring procedures in place), found their CTO on LinkedIn and reached out directly on LinkedIn or by email, introducing myself and asking whether they would consider me for an internship.* I send 1 email and 2 LinkedIn messages and got 3 interviews, 2 of which led to an offer (one even at the end suggested a job even though I asked for an internship). It is a small quantity, but a great success rate. I would probably continue sending more requests to the other companies I found if the results weren’t so quick and I didn’t get a regular job in the meantime.</p><h4>4. Set your goals right</h4><p>To not get demotivated during the process. It is important to try to reformulate the main goal of “finding a job” to more actionable goals. Since whether or not one gets a job, doesn’t depend only on oneself, but also on the job market, other applicants, and the star alignment (jk?), it is useful to focus one’s energy on what one can do and influence today. Having a goal like “read 3 articles a day”, “clean GitHub repos”, “connect with 10 people a day”, and “send 2 applications a week” are much more actionable and made me feel like I am on track, doing something instead of only waiting for replies to come.</p><p>I hope my experience can be useful to at least one person or let someone struggling with self-doubt know that they are not alone in feeling like this. I wish everyone the best of luck in their transition and also here apply the motto “trust the process”.</p><p><em>*If you can’t find a list of companies working with RoR in your area, it can help to search on LinkedIn for companies where LW graduates work.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1322d1f3d49" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Becoming a better programmer in a day (for beginners)]]></title>
            <link>https://medium.com/@zhiva.tech/becoming-a-better-programmer-in-a-day-for-beginners-bb56d32c9048?source=rss-58b445df83ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb56d32c9048</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <dc:creator><![CDATA[Lucia Harcegova]]></dc:creator>
            <pubDate>Mon, 16 May 2022 10:51:16 GMT</pubDate>
            <atom:updated>2022-05-16T10:51:16.619Z</atom:updated>
            <content:encoded><![CDATA[<h4>How can you rapidly improve your coding game and become a better programmer or at least feel like you one ?</h4><p>Learning how to code can be quite simple but it&#39;s not easy. Finishing a bootcamp or following online tutorials by yourself may leave you feel like an impostor coder even though you have the necessary knowledge. It may take some time to start feeling confident and introduce yourself as a web developer and get comfortable in a crowd of software engineers. There are few things though you can do to feel better and to improve your coding game quickly.</p><h4>Master keyboard shortcuts</h4><p>Knowing your way around the terminal and your code editor without the lengthy cursor dragging and other navigation awkwardness can make wonders not only for the effectiveness of your coding but also can make you feel like you a developer instead of a kitten behind a computer. So find the keyboard shortcuts for your computer, customise them if needed, learn them by heart and most importantly start using them. It may feel like a additional struggle at first to try to recall and press multiple strange keys at the same time, but will soon get saved into “muscle memory” and become a second nature to you. I also wrote an article on how to find and set keyboard shortcuts with a cheatsheet for Mac and Windows, you can read it<a href="https://medium.com/@codepoco/mastering-keyboard-shortcuts-or-how-to-be-a-more-effective-web-developer-b9067e94a839"> here</a>.</p><h4>Have a second screen</h4><p>Having a second screen is not only what the cool kids do, it does actually increase your effectiveness and speed up the process. Just imagine following a tutorial without having to switch between the windows or being able to see your code and see it in a browser at the same time, not to mention that one does really feel like a better programmer just sitting in front of two screens. It is an investment, but it can be one worth making. Also the increased effectiveness effect and some other benefits come regardless of the price range you get your screen for, and there are also very available options out there.</p><h4>Write a test</h4><p>Testing your code will make you more confident in its functionality, save you the time clicking around attempting all possible scenarios after every change you make to it and it will also get you to fit into the coding community more easily, as test driven development or TDD is becoming a standard in many places. Writing your first test may feel awkward at the beginning and also a bit like a wasting a time you could be spending writing the actual code, but it is very well worth it. More on why to test your code and how to go about it <a href="https://medium.com/p/4d9a90f173c7">here</a>.</p><h4>Keep coding</h4><p>Just write code today and repeat that again and again. That&#39;s the most effective way of becoming better, and also to feel like a real programmer. There is a lot of literature out there about how “living the life” of someone you want to become ie. taking on the identity, helps build habits, keep it and eventually become the person you want to be (James Clear in Atomic Habits calls this identity based habit). Well and what do great programmers do? They code. I find it sometimes hard to simply trust the process and keep struggling with functions that I would expect are easy for others and take me hours of googling to solve. However, one needs to keep reminding oneself that struggling you become better, because next time it will just take maybe one hour to solve, then half an hour and eventually it won&#39;t be a problem at all. You can find a fun project to work on, help a friend with building something, play codewars or get inspired by others and rebuild existing projects you find cool. The options are plentiful, just learn to enjoy the process and trust it.</p><h4>One day</h4><p>These tips can be done in one day, however as everything that is worth it, one needs to do it one day at a time. But it&#39;s worth keeping in mind that everyday you are becoming better, because if you are doing something you are surely not becoming worse and hence are moving towards your goal.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb56d32c9048" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering keyboard shortcuts or how to be a more effective web developer]]></title>
            <link>https://medium.com/@zhiva.tech/mastering-keyboard-shortcuts-or-how-to-be-a-more-effective-web-developer-b9067e94a839?source=rss-58b445df83ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9067e94a839</guid>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Lucia Harcegova]]></dc:creator>
            <pubDate>Tue, 10 May 2022 19:59:35 GMT</pubDate>
            <atom:updated>2022-05-11T06:50:43.624Z</atom:updated>
            <content:encoded><![CDATA[<h4>Guide to learning Visual Studio code keyboard shortcuts on Mac and Windows</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kv69brcLt4kfE4i2c4n5Gw.png" /><figcaption>Image credits: Altum Code for Unsplash (cropped)</figcaption></figure><p>Maybe you experienced it yourself already, the silent awe when you see a senior developer or a teacher doing something in VS studio code, what took you many awkward clicks, they do it in milliseconds as if with a stroke of a magic wand.</p><p>It turns out they know kind of magic, the magic of keyboard shortcuts. However, this magic is not reserved only for seniors and you can learn them as well to step up your coding game, be more effective and at least feel instantly like a better programmer.</p><h4>How to find keyboard shortcuts</h4><p>In VS code navigate to the top menu bar <em>Help -&gt; Keyboard Shortcuts Reference</em> ( or ⌘K ⌘R on Mac and Ctrl+K Ctrl+R on Windows). This will give you the full keyboard shortcuts documentation you can read and refer to whenever in need. I made a cheatsheet of those I find the most useful that I would suggest to learn by heart.</p><p>If you find some of them hard to get into your fingers or you find out that they don&#39;t work on your computer (it might be that some of the VS extensions you installed had overwritten the default system shortcuts), there is a way to check and change the shortcuts to your liking. On Mac you would press ⌘K ⌘S, Ctrl+K Ctrl+S on Windows and it will open a list of all shortcuts in your VS, which you can read and also edit by clicking on the edit icon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8XKa55xXYSKkKVZsFt9qxg.png" /><figcaption>Edit keyboard shortcuts</figcaption></figure><p>Also, if you feel like you discovered some strange behaviour, when you press certain keys, you can actually check what do the keys do, kind of look up a keyboard shortcut on reverse. This is done by clicking on the keyboard icon in the top navigation bar. It is also useful, when you want to create your custom keyboard shortcut and make sure that those keys are free ie. are not tight to certain functionality already.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EQV01Z5hQRY2lzbrJbQHZQ.png" /><figcaption>Testing out keys</figcaption></figure><p>Below you can find the cheatsheet and also download it<a href="https://drive.google.com/file/d/1hIXu40zDQ0OeWuhfbqbO_Fps5c6C-QI_/view?usp=sharing"> here</a>.</p><p>Again, remember that if some of the shortcuts do not work for you, you have all the power in your hands. And even though it might feel like more effort at the beginning, your brain and hands are wired in a way that when you use the keyboard shortcuts often enough it will become natural and effortless.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QmxvOcSqy-IQ2reSWu9DqQ.png" /><figcaption>Visual Studio Code useful commands.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ufWVY-OYyXDElrrlZ998rw.png" /><figcaption>Visual Studio Code keyboard shortcuts cheatsheet</figcaption></figure><h4>Master the keyboard shortcuts (sum up):</h4><ol><li>Find and familiarise yourself with the shortcuts</li><li>Modify them to your liking</li><li>Start using them !</li></ol><p>I hope this short guide can be useful to you as well and will encourage you to learn keyboard shortcuts to be, as a start, at parity with senior programmers at least in the speed you are working in VS code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9067e94a839" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The secret life of forms. What are they and how to use forms in Rails. Part I]]></title>
            <link>https://medium.com/@zhiva.tech/the-secret-life-of-forms-what-are-they-and-how-to-use-forms-in-rails-part-i-9b8392b03925?source=rss-58b445df83ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b8392b03925</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[forms]]></category>
            <dc:creator><![CDATA[Lucia Harcegova]]></dc:creator>
            <pubDate>Tue, 22 Mar 2022 08:14:36 GMT</pubDate>
            <atom:updated>2022-03-22T08:14:36.304Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AoFqJ2BQxqRsmslBrqiflA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@magellol?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Thomas Lefebvre</a> on <a href="https://unsplash.com/s/photos/form?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Forms are everywhere and are very useful for the interaction between user and us. In apps they are the main way to create and modify our data. However, forms are not that simple as they look. Especially if we plan to collect input for different models, but of course the user doesn’t give a damn about our db:schema and wants to be able to click “Submit” only once, if possible. So what is the minimum to understand for us to be able to work with forms on our website without the chills one gets when dealing with mystery?</p><h4>What are forms</h4><p>So let’s first demystify forms. Form is a way to send data to a server. HTML &lt;form&gt; tag is a standard way of sending data to a specified server(url). Once the form is submitted it is sent to the server, it makes a request to a server using HTTP protocol. The server answers using the same protocol. So the form on a web page is nothing more than a convenient user-friendly way to configure an HTTP request to a server. This enables the user to provide information to be delivered in the HTTP request.</p><p>In the form we defined how and where to send the data, by specifying <em>the action</em> and <em>method </em>attributes. We can have a closer look at these too, to better understand what kind of information the form wants from us and how is it used.</p><p><strong><em>Form action</em></strong></p><p>Defines where the data gets sent to, in Rails the route the form will go to. This action attribute is automatically filled in Rails either by the URL we will pass into the <em>form_with</em> or the associated model.</p><p>The value needs be valid relative or absolute URL and if this attribute isn’t provided the data will be sent to the URL of the current page by default.</p><p><strong><em>Form method</em></strong></p><p>Defines how data is sent, ie. which HTTP protocol method should be used to transmit the data.</p><p>Just to recap, an HTTP request consists of two main parts, namely a header containing a set of global metadata about the browsers capabilities, and a body that contains information necessary for the server to process the specific request. We can see the HTTP request if we inspect our browser and go to the Network tab.</p><p><strong>HTTP methods</strong></p><p><strong><em>Get</em></strong> is a method used by the browser to ask the server to send back a given resource. The data is appended to the URL as a series of name/value pairs. With the <strong><em>post</em></strong> method the data gets appended to the body of the HTTP request. These data won’t be displayed to the user in the URL. We would use <strong><em>patch</em></strong> method for partial modifications to a resource, to update it, if I was to use the CRUD terminology. <strong><em>Delete</em></strong> will delete the specified resource.</p><p>Whichever HTTP method we choose, the server receives a string that will be parsed in order to get the data as a list of key/value pairs. If you want to learn more about HTTP protocols and requests, here is a set of <a href="https://developer.mozilla.org/en-US/docs/Learn/Forms/Sending_and_retrieving_form_data">articles</a> I found useful or also this <a href="https://www.youtube.com/watch?v=CFzgKfnmG-Q&amp;ab_channel=PrettyPrinted">video</a> explains it quite well.</p><p>This is how our form could look like (the HTML output):</p><pre>&lt;form method=”post” action=”/users”&gt;</pre><pre>  &lt;label for=”email”&gt;Email&lt;/label&gt;</pre><pre>  &lt;input type=”email” name=”email” id=”email”&gt;</pre><pre>  &lt;label for=”password”&gt;Password&lt;/label&gt;</pre><pre>  &lt;input type=”password” name=”password” id=”password”&gt;</pre><pre>  &lt;input type=”submit” name=”Sign up”&gt;</pre><pre>&lt;/form&gt;</pre><p><strong><em>Input type</em></strong></p><p>There is many input types that can be used within a form, you can read about all of them for example <a href="https://www.w3schools.com/html/html_form_input_types.asp">here</a>. The most common ones would be <em>text</em>, which is quite self explanatory, and it allows the user to enter single-line text. We can define the size(visible width) or if we need a bigger field of text we can go with <em>textarea</em> tag within or outside the form(we need to specify the <em>form id</em> in the <em>form attribute</em> to connect it our form it should belong to). To let user choose only one option from many, we use <em>radio</em> buttons and if they are to be able to select multiple we would use <em>checkboxes</em>. All inputs need to have a name attribute so we can identify the data submitted and the input would be the value of the input field. The input id is important if we are assigning it a label, as we will need to define it in the label for attribute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3auaVhqoH8B040hFoY4mSQ.png" /></figure><h4>Using forms in Rails</h4><p>The basics of a form are cool to understand but not that useful alone for our Rails app, if we don’t know how it works with it. Here is an intro into using forms in Rails, that I will elaborate more on more specific cases in later articles.</p><p>Generally speaking Rails is attempting to make our lives as easy as possible, and also in the case of working with forms it offers a useful Form helpers, that do exactly that and help us create a form.</p><p><em>Form_with</em> is the knight in shining armour Rails sent to help you with your forms, although you might see form_tag or form_for in some existing older project these are considered to be slowly deprecating. Form_with is currently the unified standard for Rails and I will elaborate on its use in the following article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b8392b03925" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are classes and how to use them in Ruby and Javascript]]></title>
            <link>https://medium.com/@zhiva.tech/what-are-classes-and-how-to-use-them-in-ruby-and-javascript-b0b7e428e0e3?source=rss-58b445df83ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0b7e428e0e3</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[oop]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Lucia Harcegova]]></dc:creator>
            <pubDate>Wed, 16 Feb 2022 10:46:22 GMT</pubDate>
            <atom:updated>2023-02-21T15:15:26.896Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CztiEKs6asEKzEuQqteCcw.png" /><figcaption>Photo by <a href="https://unsplash.com/@izzuddindanial?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Zaini Izzuddin</a> on <a href="https://unsplash.com/s/photos/classroom?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Classes are the bread and butter (or falafel and beer) in <strong>Object Oriented Programming</strong>. To give a simple definition, classes are basically a template for creating objects. Funnily enough, even though there is a saying in Ruby “Everything is an object”, classes are not. They are a template for creating objects.</p><p>You could build a program without using them, but it would be a lot of repetitive work. However, you can rid yourself of some unnecessary pain and they will make your life a bit better, just like beer and falafel. Learning how to use them is a treat for yourself, let’s start and learn the basics of object oriented programming!</p><h3><strong>How do you create a new class</strong></h3><p>In JS there are two ways one can create a new class. Since classes are in fact “special functions” one can create a new class through either <em>class declaration</em> or by using a <em>class expression</em>. These class expression can be then both named and unnamed.</p><p>The class declaration way of creating a new class is almost identical with Ruby, you simply write the <strong>class keyword</strong> before the <strong>name of the class</strong>, which is by convention in both languages <strong>capitalised</strong>.</p><figure><img alt="Cheatsheet for class creating in JS, Ruby" src="https://cdn-images-1.medium.com/max/1024/1*6dBEbSanXAwKS60jPKOdnQ.png" /><figcaption>Creating a new class</figcaption></figure><p><strong>Class is defining what properties and methods will the object hold.</strong> Adding properties to a class is useful when these properties will be shared among the instances, such as some behaviour ie. methods or other common properties.</p><p>To initialise such properties we use <em>initialize method </em>in Ruby and <em>constructor method </em>in Javascript.</p><p>Both take arguments, that can be passed in when creating a new object from that class, an instance, and will be particular for that instance. These are called i<strong>nstance variables</strong>, named properties of that instance. They get created and initialised by the constructor method (which is called initialize in Ruby, but its function is still to construct an object).</p><p>The constructor method is so special that there can be <strong>only one constructor method</strong> for the given class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ygu5N4oTBmglkuqWCAypBg.png" /><figcaption>Differences between class in Ruby and JS</figcaption></figure><h3>How do you create an object from a class</h3><p>For the classes to be useful, one actually needs to use them. To put the class in use and to create a new object from the given class, so called class instance, you will be using the <strong>new</strong> keyword in Javascript and the <strong>.new</strong> method in Ruby.</p><p>If the class was created with a constructor method (<em>initialize</em>()) that takes any arguments, those will need to be passed in as well, unless you set them to a default value and you want to keep it like that.</p><figure><img alt="How to create an object from a class in Javascript and Ruby" src="https://cdn-images-1.medium.com/max/1024/1*EoFboxDGqo2sCyTmxHrZ5Q.png" /><figcaption>Creating a new class instance, an object</figcaption></figure><h4>Class and instance methods</h4><p>What is even more cool and useful about classes is that you can create methods, and then use them on all the objects belonging to that given class. Wrapping a piece of functionality into an instance method saves a lot of typing and possible human-factor errors.</p><p><strong>Instance methods</strong> are the methods you define within a class. Both Javascript and Ruby do not require any keyword for that and they consider the methods to be automatically instance methods that you can start using on the objects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H3AZEzDQ2sZl3-uiOXKwqg.png" /><figcaption>Creating instance methods</figcaption></figure><p>Until now we have seen that the methods that you define in a class can be used on the objects created from the class. But can one call them on the class itself? Not really. If you want to create a method that will work for the class itself, you have an option of creating a, so called, class method in Ruby and an analogous <em>static </em>method in Javascript.</p><p><strong>Class methods</strong> (or static methods as they are called in Javascript), are useful when you want to do something with the class, that has nothing to do with its instance. They are often used for utility functions, fx. for Active Record in Ruby and similarly also in Javascript.</p><p>Important to remember is that, <strong>classes themselves do not respond to instance methods</strong>, and vice versa, the <strong>objects will return undefined when you try to call a class (static) method on them</strong>.</p><p>The class methods are created be putting <em>self </em>keyword before the method name in Ruby or the keyword <em>static</em> in Javascript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4tFZDczDca3hTNB-87m1CA.png" /><figcaption>Creating class methods</figcaption></figure><h3>How do you check whether an object belongs to a class</h3><p>To see whether an object is an instance of a given class, both Ruby and Javascript offer us built-in methods to call. If you know the class and you also</p><p>know the object, then you can check with <em>instance_of</em>?(Ruby) or<em> instanceOf</em> (Javascript). These methods will give you a simple yes or no answer (boolean value). This is useful, for example, if you have your awesome instance methods ready and want to be sure that you can use them on the given object.</p><p>In Ruby you can also find out which class does the object belongs to, by calling a <em>.class</em> method on it or in Javascript one can get the name of the constructor.</p><figure><img alt="How to check whether an object is an instance of a class in Javascript and Ruby" src="https://cdn-images-1.medium.com/max/1024/1*VTpTVuJCQa34OKRvSln9kw.png" /><figcaption>Checking whether an object is an instance of a class</figcaption></figure><p>This also comes handy when dealing with class inheritance, another core concept of object oriented programming. However, I find <strong>inheritance</strong> and all the <strong>super classes</strong> to be a quite complex issue and that’s why I will elaborate on it in a separate article.</p><p>I hope you got some more clarity and understanding, of what classes are, how they work and how can you use them in both Javascript and Ruby. The differences between the two languages are not too big, since both are object oriented and the difference lays mainly in small syntax variation. Anyway, I find it very useful to keep them in mind ie. See them next to each other so I don’t waste time attempting ruby syntax for Javascript and the other way around.</p><figure><img alt="Ruby and Javascript hero" src="https://cdn-images-1.medium.com/max/282/1*MEQTEU742PA9uP7we26-TA.jpeg" /><figcaption>Ruby and Javascript hero (you?)</figcaption></figure><p>Thank you, and have a falafelishious day!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0b7e428e0e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>