What power do we have as developers? The Ability to Code.
Let me tell this via a story.
Recently, I worked on a library to develop a custom UI in Jetpack Compose in Android, and one of the requirements for this design system is to use fluent icons from Microsoft.
Since I am using Jetpack compose, I wanted to use drawables using Kotlin instead of XML, but the library, for the moment, has only the XML variation.
💡 So I got the idea to make a good open-source contribution, create the icons in kotlin, and push it.
The only problem is that the icons are a lot, like really a lot, more than 13,000 icons. And each icon has lines to convert it from XML to kotlin.
Oh, how can you efficiently do that? We can use our magic powers as developers and write code to do it for you.
Now, I won't go through the code and tell you how I did that. If you want to know, please let me know in the comments below.
Simply I have created a parser that parses the XML icons and converts them to fluentIcons
using ImageVector
compose's nature using materialPath
.
I came up with the algorithm in half a day with TDD, but then the 13 thousand icons were generated in less than 10 seconds!
Guess what? I raised the PR, and it's almost one million lines of code!
Here is a full video about the PR:
But The PR isn’t merged yet because of some problem with the build 😅.
What I want to share with this story is that being able to code something is very valuable, and you can use it to automate many tasks.
You can reduce the complexity of any task by writing some code and automating some parts of it, and this is the idea behind Continuous delivery; I remember watching or reading David Farley's expression:
When is the best time to automate something? The second time you need to do it manually!
💡 Tip of the week
Here's a tip: If you find yourself doing the same task repeatedly, write code to automate it.
📣 See you in the upcoming weeks with another Tip!
✍️ Charfaoui Younes.
✅ My preferred things this week
Here is a couple of digital content I’ve been consuming and creating this week:
🎬 YouTube Video The easy way to migrate to Gradle Version Catalog!
👩💻 Github Repository A collection of learning resources for software engineers.
📑 Article Here's a productivity hack to save tens of engineering hours* when working with Jetpack Compose!
📚 Book I am thinking of reading Code that fits in your head.
You would make my day if you shared this newsletter with other developers 🙏.
🤗 Here are other ways I can help you with:
📞 Work with me 1:1 - book a coaching or strategy session for 60 minutes.
🔨 Course: Refactoring Legacy Code Like a Pro: A step-by-step approach for refactoring messy codebases into a Software Masterpiece.
🎥 Check out my YouTube channel: Discover tips on Android, Software Engineering, and productivity for developers.