<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Andrea Canton</title>
    <description>The latest articles on DEV Community by Andrea Canton (@andreacanton).</description>
    <link>https://dev.to/andreacanton</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F204520%2F9bef7f51-7473-40da-b862-050241e98ea4.jpg</url>
      <title>DEV Community: Andrea Canton</title>
      <link>https://dev.to/andreacanton</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andreacanton"/>
    <language>en</language>
    <item>
      <title>Smart laziness</title>
      <dc:creator>Andrea Canton</dc:creator>
      <pubDate>Thu, 09 Mar 2023 07:16:23 +0000</pubDate>
      <link>https://dev.to/andreacanton/smart-laziness-4jg1</link>
      <guid>https://dev.to/andreacanton/smart-laziness-4jg1</guid>
      <description>&lt;p&gt;Have you ever sped up your pass (or even start running) when you see that someone is passing through the door that you’ll pass? Even if the person is holding the door, you started before thinking “I don’t want to re-open the door”.&lt;/p&gt;

&lt;p&gt;I’ve done it, many times. In most cases, this is not very smart.&lt;/p&gt;

&lt;p&gt;I’d prefer spent energy now (maybe more energy) instead of re-open the door.&lt;/p&gt;

&lt;p&gt;My fiancé after dinner, if she has to do dishes, prefers to lay on the couch for some minutes, then after a while get up and wash the dishes.&lt;/p&gt;

&lt;p&gt;I think is very difficult to get up, so when is my turn I wash dishes and then I lay down.&lt;/p&gt;

&lt;p&gt;Both behavior I think are lazy. I think mine is smart laziness. (I love you anyway, Marta)&lt;/p&gt;

&lt;p&gt;Since I started working in companies, as a developer, I always had to track in some kind of software or excel files, how much I’ve worked on which project or client, or ticket. In Italy we call it consuntivazione, context-reverso translates it into final balance. I don’t trust always the internet, but I hope that now you understand what I’m talking about.&lt;/p&gt;

&lt;p&gt;This operation for most of my colleagues is a nightmare. It is, but I prefer to do it every day, or even two or three times a day.&lt;/p&gt;

&lt;p&gt;Most of them prefer to do it at the end of the month to enter all of the data they may be written on a TXT on the desktop, or reading through their commits. Maybe they are on holiday and have to do it from the beach (or mountains).&lt;/p&gt;

&lt;p&gt;I think I don’t understand this kind of laziness. But most of the time I don’t even realize how not-smart-lazy I am, even when I’m running towards a closing door.&lt;/p&gt;

&lt;p&gt;Is lazy to do effort now than later? I think is yes.&lt;/p&gt;

&lt;p&gt;Is smart to do an effort now than later? Mostly yes.&lt;/p&gt;

&lt;p&gt;I want to talk about laziness because last week my boss tell me that he wants me to do a two hours speech to my colleagues about test automation.&lt;/p&gt;

&lt;p&gt;I’ve read many articles and books on tests. I’ve done some testing in my personal projects, but I’ve NEVER written tests in a company environment. That scares me the most, but I’ll be honest with my colleagues and I hope that the speech starts a conversation or even a debate.&lt;/p&gt;

&lt;p&gt;Doing test automation is smart laziness, but instead, I’ve always thought that doing F5 multiple times on Visual Studio was more efficient.&lt;/p&gt;

&lt;p&gt;Is not.&lt;/p&gt;

&lt;p&gt;Is easy to write most of the documentation of a project during or after completing it? You know the answer, but your mind hopes that postpone the pain hoping that problems never come up. But you struggle with all the support and training your client demand on a not well-documented software.&lt;/p&gt;

&lt;p&gt;And you end up that you have to spend more energy even if you never write documentation.&lt;/p&gt;

&lt;p&gt;I’m not smart-lazy, but I hope that this article starts a conversation or even a debate.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Always over estimate effort</title>
      <dc:creator>Andrea Canton</dc:creator>
      <pubDate>Thu, 26 Jan 2023 12:32:49 +0000</pubDate>
      <link>https://dev.to/andreacanton/always-over-estimate-effort-4137</link>
      <guid>https://dev.to/andreacanton/always-over-estimate-effort-4137</guid>
      <description>&lt;p&gt;Developers solve problems no one have tried to solve before.&lt;/p&gt;

&lt;p&gt;Trying to estimate how much time require to solve this problems is a guessing-game, is like gambling.&lt;br&gt;
Gambling is risky, so estimates should be superconservative.&lt;/p&gt;

&lt;p&gt;Like gambling, you think you are good, because sometimes you get it right. &lt;br&gt;
But you are not, you are only lucky.&lt;/p&gt;

&lt;p&gt;As a developer, even as a junior developer, you are responsible for the quality of the code, but our job is full of pitfalls.&lt;br&gt;
We have to check performance, maintainability, security and many other subjects. &lt;/p&gt;

&lt;p&gt;If the persons who asked you the estimate say that is too much, remember they asked &lt;em&gt;you&lt;/em&gt;, and if they needed a different answer they shouldn't ask you in the first place. &lt;br&gt;
If they need it in less time you can discuss the timing, of course, but the responsibility of failure is not all on you, at least is shared.&lt;/p&gt;

&lt;p&gt;Moreover, clients/PM/Product owner/etc. not always need all your work in short time, &lt;br&gt;
you don't need to demonstrate always how quick you can be. Speed of delivery is not the only metric that matter.&lt;/p&gt;

&lt;p&gt;Exaggerate estimate help you to keep calm and experiment various design pattern. &lt;br&gt;
If you think that they don't give you time to do unit tests, refactor, clean tech debt, remember that are you that say the estimates.&lt;/p&gt;

&lt;p&gt;So when you give yourself the chance to have some extra-time, you can really improve your codebase, and deliver very high quality code. &lt;/p&gt;

&lt;p&gt;Thirty minutes can be enough to make significant improvements.&lt;/p&gt;

&lt;p&gt;What is a better time to refactor a feature that anyway will be tested? You decide. You have the power to find time to improve the code.&lt;/p&gt;

&lt;p&gt;Inspiration for this article, other than personal experience, is &lt;a href="https://www.youtube.com/watch?v=QVBlnCTu9Ms" rel="noopener noreferrer"&gt;this talk&lt;/a&gt; by Allen Holub, where he says that doing estimates is stupid and you should not do it. I agree with him, but I'm not a CSO (Chief of Something Officer), I'm a senior developer of a company where I don't have the option to don't give estimates.&lt;/p&gt;

&lt;p&gt;I hope this article start a discussion and help me and some of you to better manage this itchy argument.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>career</category>
      <category>productivity</category>
      <category>writing</category>
    </item>
    <item>
      <title>Simple writing text animation</title>
      <dc:creator>Andrea Canton</dc:creator>
      <pubDate>Thu, 24 Dec 2020 07:00:58 +0000</pubDate>
      <link>https://dev.to/andreacanton/simple-writing-text-animation-2m80</link>
      <guid>https://dev.to/andreacanton/simple-writing-text-animation-2m80</guid>
      <description>&lt;p&gt;I just tried to create a simple writing text animation using css and vanilla javascript.&lt;/p&gt;

&lt;p&gt;The text indicator is pure css using &lt;code&gt;@keyframes&lt;/code&gt; in loop. The writing effect is done by using a &lt;code&gt;setInterval&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;An improovement that it came to my mind is to change the &lt;em&gt;interval&lt;/em&gt; every time and increment to one second if I encounter a period.&lt;/p&gt;

&lt;p&gt;Do you think I can do better?&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/andreacanton/embed/jOMGpyQ?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>codepen</category>
      <category>css</category>
      <category>javascript</category>
    </item>
    <item>
      <title>AHA Programming vs Single Responsibility Principle</title>
      <dc:creator>Andrea Canton</dc:creator>
      <pubDate>Fri, 12 Jun 2020 08:32:20 +0000</pubDate>
      <link>https://dev.to/andreacanton/aha-programming-vs-single-responsibility-principle-4go</link>
      <guid>https://dev.to/andreacanton/aha-programming-vs-single-responsibility-principle-4go</guid>
      <description>&lt;p&gt;In the &lt;a href="http://hero35.com/"&gt;Hero35.com&lt;/a&gt;'s newsletter, I've stumbled upon &lt;a href="https://www.youtube.com/watch?v=wuVy7rwkCfc"&gt;this video on AHA Programming&lt;/a&gt;, where Kent C. Dodds tries to explain this new principle he created. The minute he starts to code I said "AHA!", but not for the same reason Kent intended. Yes, because I think he missed some more important principles in programming.&lt;/p&gt;

&lt;p&gt;First things first, &lt;strong&gt;what the heck is AHA Programming&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;AHA stands for &lt;em&gt;Avoid Hasty Abstractions&lt;/em&gt;, from &lt;a href="https://kentcdodds.com/blog/aha-programming"&gt;Kent's blog post&lt;/a&gt; we can summarize this way of thinking in two points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prefer duplication over the wrong abstraction&lt;/li&gt;
&lt;li&gt;Optimize for change first&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So far seems some good points, maybe out of the ordinary, but I encourage you to read the article or at least watch the video before continuing. Or you can just trust me, I'm not judging you!&lt;/p&gt;

&lt;p&gt;In the presentation, Kent is showing an example where there is a frontend application that displays the name of a &lt;code&gt;user&lt;/code&gt; in multiple places.&lt;br&gt;
In general thinking a developer builds an abstraction by creating a function, say, &lt;code&gt;getDisplayName(user)&lt;/code&gt;, so if there is a bug in the behavior you'll fix it once and it repairs everywhere.&lt;/p&gt;

&lt;p&gt;Kent brings the case when the client or stakeholders ask you to add the honorific to the name on the profile page. It always happens, &lt;strong&gt;it's in the software nature to change in time&lt;/strong&gt;. The example goes on to the point every place where the name is displayed has different behavior. Kent says at this point a developer tent to don't dismantle the abstraction, instead, prefer to add flag parameters to the function/module/component to accommodate new behaviors.&lt;/p&gt;

&lt;p&gt;I can agree that a medium level developer has this type of mindset. I also agree that removing the abstraction is a great choice instead of making a wrong abstraction. But I think the same result can be achieved easily &lt;strong&gt;following other old good programming principles&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let me explain.&lt;/p&gt;

&lt;p&gt;I recently read the well-known book on software development &lt;em&gt;Clean Code: A Handbook of Agile Software Craftsmanship&lt;/em&gt; by Robert C. Martin - I C. a pattern here! It's quite inspiring, it also helped me to improve the quality of my code significantly and my supervisor noticed! You should totally read it once in your life, maybe not too early in your career: just to see enough of what the real world is made of to better understand what Uncle Bob is pointing out.&lt;/p&gt;

&lt;p&gt;You can imagine in this book there are a lot of rules and examples of writing code. A lot. I can say principles wrote there are hard to discredit.&lt;/p&gt;

&lt;p&gt;One of the main rules that it came out most frequently is the &lt;strong&gt;Single Responsibility Principle&lt;/strong&gt;, a.k.a. SRP, that states that every module or class should have responsibility for a single part of the functionality provided by the software and that responsibility should be entirely encapsulated by the class, module, or function. Uncle Bob summarize in this sentence: "A class should have only one reason to change."&lt;/p&gt;

&lt;p&gt;In the Functions chapter, Martin says that a method should do only a task and avoid flag parameters. If there is an &lt;code&gt;if&lt;/code&gt; or a &lt;code&gt;switch&lt;/code&gt; create two or more method methods if you can.&lt;/p&gt;

&lt;p&gt;So back to the issue presented by Kent: we could address the problem by creating another function named &lt;code&gt;getUserNameWithHonorific&lt;/code&gt;, so if after a while the name of the user became different in every place we have different functions and is easier to disassemble the abstractions if we see they're a lot and used only in one place. It's easier because you don't have a huge single function that's hard to understand, instead, you have more functions that explain what they do in the name and made by few lines of code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusions
&lt;/h2&gt;

&lt;p&gt;Dodds' AHA principle is not wrong, but I think that doesn't add anything new, plus &lt;strong&gt;it doesn't simplify the comprehension&lt;/strong&gt;. You can agree with me that you can't define precisely &lt;em&gt;wrong&lt;/em&gt; abstraction, it's open to interpretation. Instead, you can more clearly identify functions or components that have more than one purpose.&lt;/p&gt;

&lt;p&gt;I think that the parametrization of software has to stay in the higher levels of abstraction, such as abstract classes of a library, the main component of a frontend widget. &lt;strong&gt;Only one main switch&lt;/strong&gt; and different modules/components that do only one thing, so if a change will come - and it will - you edit only one module or create a new one.&lt;/p&gt;

&lt;p&gt;Now tell me what you think. I'll be pleased to discuss it!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Cover photo: taken by me last week in a forest near &lt;a href="https://goo.gl/maps/U4VPXZ6NWCqHVFh86"&gt;Corno d'Aquilio&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>codequality</category>
      <category>healthydebate</category>
    </item>
    <item>
      <title>GIT Mantras you should know</title>
      <dc:creator>Andrea Canton</dc:creator>
      <pubDate>Wed, 19 Feb 2020 12:03:42 +0000</pubDate>
      <link>https://dev.to/andreacanton/git-mantras-you-should-know-1nh3</link>
      <guid>https://dev.to/andreacanton/git-mantras-you-should-know-1nh3</guid>
      <description>&lt;p&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@simonmigaj?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Simon Migaj&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/meditation-git?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;DISCLAIMER: This post is not the Bible, is my personal opinion, feel free to comment if you disagree.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I wrote the first line of code in 2007 and one of the main tools I used over the years is GIT. I studied various ways of thinking and encountered many problems caused by misusing this fundamental tool. So I wrote some thoughts I learned on the field, hopefully, to help you to be more confident and professional.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use a VCS even if you are the only coder
&lt;/h2&gt;

&lt;p&gt;The first job I had was a mess from many points of view. One of those was they don't use any version control system. The excuse of the head developer was "we are only in three and work always on different projects". He didn't understand that GIT (or other VCS) works as a time machine for your code and is useful even if you are the only coder in the team. And if you're asking: yes, it happened we have to work on the same project, in a rush.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make useful commits
&lt;/h2&gt;

&lt;p&gt;You should treat your commit like you treat your code (assuming you want a clean code) because if you don't keep neat your commits and branches, your repository became useless and unreliable.&lt;br&gt;
One of the most trendy GIT 'motto' is &lt;a href="https://sethrobertson.github.io/GitBestPractices/#commit" rel="noopener noreferrer"&gt;&lt;em&gt;Commit Early And Often&lt;/em&gt;&lt;/a&gt;.&lt;br&gt;
I think a better rule can be: &lt;strong&gt;Make &lt;em&gt;frequent&lt;/em&gt; commits with a short description.&lt;/strong&gt; Even more precisely: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The first line of commit should be less than 50 characters, in plain English and should describe an action in simple present. Should not contain words like "and" or "+", in most cases you should split into two commits.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;add about page file&lt;/li&gt;
&lt;li&gt;implements contacts saving logic&lt;/li&gt;
&lt;li&gt;remove commented code in invoice service&lt;/li&gt;
&lt;li&gt;intent code in the database config file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Of course, your commit should be as descriptive as possible. I've seen a lot commits with only written "wip" or "fix": please, simply &lt;em&gt;don't&lt;/em&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ok thanks, but how can I do those commits???&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Don't be afraid to use a graphic interface (GUI)
&lt;/h2&gt;

&lt;p&gt;I'm a huge fan of GIT CLI, I mostly use it but in some cases, I use an interface to easily select which files (or even lines) to commit. Instead to use &lt;code&gt;git add -p&lt;/code&gt;&lt;br&gt;
Yes, because &lt;em&gt;frequent&lt;/em&gt; doesn't mean to commit every five minutes. When you are in a rush, or you are focused to solve a problem, you can easily forget to commit early and often. So when you notice that, you can open your GUI and make your commits.&lt;/p&gt;

&lt;p&gt;It doesn't matter if a test is failing or your branch is broken. Unless you are on the production branch, it's better to have more descriptive commits that can help you to debug or find a deleted feature, than working commits. &lt;/p&gt;

&lt;p&gt;Here some GUI i've used/use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.sourcetreeapp.com/" rel="noopener noreferrer"&gt;Sourcetree&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.gitkraken.com/" rel="noopener noreferrer"&gt;GitKraken&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/docs/editor/versioncontrol" rel="noopener noreferrer"&gt;VSCode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://visualstudio.microsoft.com/it/vs/features/collaborate/" rel="noopener noreferrer"&gt;Visual Studio&lt;/a&gt; have a simpler but useful interface ()&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why I should use English only for my commits?
&lt;/h2&gt;

&lt;p&gt;Let's take an example, a realistic example.&lt;br&gt;
Your job is in a firm that produces e-commerce websites for other clients in Magento. At some point tons of work arrive and you and your team can't keep up to developing a lot of code. So your boss decides to hire remote developers from India.&lt;br&gt;
Now your code and your git have to be read from foreign developers. Imagine if the code and git commits are all in Italian/Spanish/German/French/Finnish/etc. You and your team will be poked every minute by your foreign co-workers to explain your repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh42cv4oh4x33qu3exfvl.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh42cv4oh4x33qu3exfvl.gif" alt="Family Guy Italian" width="400" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another plus is English is usually shorter and without special characters.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;(en) "add about page file"&lt;br&gt;
(it) "aggiunge il file della pagina chi siamo"&lt;br&gt;
(es) "agrega el archivo de la página sobre nosotros"&lt;br&gt;
(de) "fügt die Auslagerungsdatei über uns hinzu"&lt;/p&gt;

&lt;p&gt;(en) "implement contacts saving logic"&lt;br&gt;
(it) "implementa la logica del salvataggio dei contatti"&lt;br&gt;
(es) "implementa la lógica de ahorro de contactos"&lt;br&gt;
(de) "implementiert die Logik des Speicherns von Kontakten"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Use distinct branches for each feature or issue
&lt;/h2&gt;

&lt;p&gt;I suggest you should use &lt;a href="https://danielkummer.github.io/git-flow-cheatsheet/" rel="noopener noreferrer"&gt;GIT flow&lt;/a&gt; to manage your feature/issue branches. So you can experiment on a new feature, without losing the chance to make a hotfix on the production branch (master).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthumbs.gfycat.com%2FUnevenAbsoluteAustraliansilkyterrier-size_restricted.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthumbs.gfycat.com%2FUnevenAbsoluteAustraliansilkyterrier-size_restricted.gif" alt="Fixing bug in production" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Look at &lt;a href="https://nvie.com/posts/a-successful-git-branching-model/" rel="noopener noreferrer"&gt;this article&lt;/a&gt; for more informations&lt;/p&gt;

&lt;h2&gt;
  
  
  Repeat with me: &lt;code&gt;git pull --rebase&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;When you work in a team on a single branch (like a release branch) it happened quite often that you make a commit but someone pushes another commit before you, so you should pull before pushing. If you don't use the &lt;code&gt;--rebase&lt;/code&gt; flag, git will create a merge commit, a &lt;em&gt;useless and confusing&lt;/em&gt; merge commit.&lt;br&gt;
Instead, if you use the &lt;code&gt;--rebase&lt;/code&gt; option that's what occurs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;your commit(s) is(are) put aside&lt;/li&gt;
&lt;li&gt;the remote commits are pulled&lt;/li&gt;
&lt;li&gt;(one at a time) your commit(s) is(are) applied on top of the updated branch&lt;/li&gt;
&lt;li&gt;if conflicts occur the rebase stop, you solve the conflict and stage the files, then launch &lt;code&gt;git rebase --continue&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;if there are no more commit finish, otherwise return to point 3.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most of the time I never solve conflicts, so the rebase goes straight forward and then I push my commit(s). Notice that the conflicts part will have occurred anyway with the standard pull/merge process.&lt;/p&gt;

&lt;p&gt;There are some &lt;em&gt;negligible downside&lt;/em&gt; of this practice: all the timestamp of your commit(s) will be updated when you do the rebase if you have more commits you may have to solve conflicts every time a commit will be applied. Anyhow in most cases, you push commits after you make it, so those problems are almost irrelevant.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ok but why should I care?
&lt;/h2&gt;

&lt;p&gt;If you care you sound more professional and you'll benefit in the future:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can delete all the commented code sure of cherry-picking from the past if the client wants a feature back.&lt;/li&gt;
&lt;li&gt;You can easily debug your code with &lt;a href="https://git-scm.com/docs/git-bisect" rel="noopener noreferrer"&gt;&lt;code&gt;git bisect&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you found this article useful, please consider sharing this article with your colleagues. &lt;/p&gt;

&lt;p&gt;Like this article, if you like it! &lt;a href="https://twitter.com/intent/tweet?text=I%20think%20@andreacanton%20sound%20crazy%20%23DEVcommunity%20https://dev.to/andreacanton/git-mantras-you-should-know-1lfd-temp-slug-5426745/"&gt;Feel free to say how crazy I sound on twitter&lt;/a&gt;.&lt;br&gt;
There aren't stupid questions or comments: let me know your GIT mantra or your best practices, I'll respond to all of your comments!&lt;/p&gt;

</description>
      <category>codequality</category>
      <category>healthydebate</category>
    </item>
    <item>
      <title>I made some dots for a slider, Instagram style</title>
      <dc:creator>Andrea Canton</dc:creator>
      <pubDate>Thu, 09 Jan 2020 13:51:51 +0000</pubDate>
      <link>https://dev.to/andreacanton/i-made-some-dots-for-a-slider-instagram-style-38in</link>
      <guid>https://dev.to/andreacanton/i-made-some-dots-for-a-slider-instagram-style-38in</guid>
      <description>&lt;p&gt;I'm currently working in a firm who develop software for utilities company (distributors of energy, gas and water). I'm in the web development team and I'm currently building an app (using &lt;a href="https://capacitor.ionicframework.com/" rel="noopener noreferrer"&gt;capacitor&lt;/a&gt;) where final customer can check and pay bills, consumptions, send self-readings, etc.&lt;/p&gt;

&lt;p&gt;I had to build an horizontal slide for the last bills, so this slide can have more than 10 elements in it. The problem was they want some indicators on the bottom, so I tought about &lt;strong&gt;instagram dots indicator&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fgj4stk51jepdvyg258mv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fgj4stk51jepdvyg258mv.png" alt="Instagram style dots"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Premises
&lt;/h2&gt;

&lt;p&gt;The slider is made with an horizontal &lt;code&gt;CdkVirtualScroll&lt;/code&gt; (see the  &lt;a href="https://material.angular.io/cdk/scrolling/overview" rel="noopener noreferrer"&gt;docs&lt;/a&gt;) element and work fine in mobile because you can drag the slides without adding javascript, plus it &lt;strong&gt;optimize the memory usage&lt;/strong&gt;. The example is very semplified but the indicator component is the same I use in my project.&lt;/p&gt;

&lt;h1&gt;
  
  
  The code
&lt;/h1&gt;

&lt;p&gt;I've made a component for the dots that mutate according the &lt;code&gt;length&lt;/code&gt; and the current &lt;code&gt;index&lt;/code&gt;. Note that works also for infinite scrolling with the length changing while scrolling!&lt;/p&gt;

&lt;p&gt;The solution was to listen to changes with &lt;code&gt;ngChange&lt;/code&gt; functionality and change the class of indicator elements. Then set the css to make smooth transitions.&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://stackblitz.com/edit/instagram-dots?file=src/app/components/carousel-indicator/carousel-indicator.component.ts&amp;amp;view=editor" width="100%" height="500"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Try it out with your phone in device mode with Chrome dev tools.&lt;br&gt;
&lt;a href="https://instagram-dots.stackblitz.io" rel="noopener noreferrer"&gt;https://instagram-dots.stackblitz.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope I've help someone, I'll read and respond to all of your comments&lt;/p&gt;

</description>
      <category>angular</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Please use huge font on your editor</title>
      <dc:creator>Andrea Canton</dc:creator>
      <pubDate>Fri, 02 Aug 2019 14:01:59 +0000</pubDate>
      <link>https://dev.to/andreacanton/please-use-huge-font-on-your-editor-2d9k</link>
      <guid>https://dev.to/andreacanton/please-use-huge-font-on-your-editor-2d9k</guid>
      <description>&lt;p&gt;I've been a developer for over a decade. I've to confess: my desk isn't tidy. But the virtual enviroment is near-perfect and I want to improove it everyday.&lt;/p&gt;

&lt;p&gt;Thats some of my routines to keep my virtual workspace clean:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/6127328/how-can-i-delete-all-git-branches-which-have-been-merged/6127884#6127884"&gt;remove git merged branches&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;remove useless &lt;em&gt;commented code&lt;/em&gt;, because there is GIT to remember old code.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;refactor long files&lt;/em&gt; in shorter one.&lt;/li&gt;
&lt;li&gt;remove useless thing from my editor (like sidebar, toolbar) for encourage me to use keyboard shortcut (like CTRL + P)&lt;/li&gt;
&lt;li&gt;editor with a dark theme and a 16px font with a 30px line height (not that big, I've seen bigger line height, eg. Jeffrey Way in laracasts)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On this last particular topic some of my colleagues use to make fun of me by saying that my editor seem for visually impared people. Some of them use font 10px or 9px or even lower!&lt;/p&gt;

&lt;p&gt;But I think this setting have two advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's better for my eyes&lt;/li&gt;
&lt;li&gt;It discourage me to build huge &lt;em&gt;unmanintainable&lt;/em&gt; files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tell me what you think about it or tell me your routine!&lt;/p&gt;

</description>
      <category>codequality</category>
      <category>healthydebate</category>
    </item>
  </channel>
</rss>
