I Love Errors!

I just choose to avoid them…

Mandar Bhide
4 min readJan 13, 2022

Debugging is arguably the most hated part of the software development process. Bug can be anything from a misplaced semi-colon to some huge logical error or entire setup error. Identifying them can take anything from 2 seconds to 2 weeks or even more! Then what a lunatic to love errors, right?

Wrong!

I started programming in 2017 with C++. Undoubtedly, the language is one of the best languages out there to start with. Its capabilities and performance make it front runner for many applications such as app development and AR/VR. But, (There’s always a ‘but’), C++ has wider spectrum of possible errors too! Very first and widely known is requirement of semicolon (;) at end of each statement.

That’s still very simple mistake, which IDE itself yells at you. But moving forward with data structures in C++, I came across another error saying ‘Segmentation fault’. The error appeared more prominently while implementing linked lists. Initially, I was frustrated by this error, like everyone else. A great friendship, as they say, started with conflict ;)

Then I decided to dig down into this error, with a common tool called internet. To start with, googling what is ‘segmentation’. After a lot of googling and exhausting trials in Turbo C++, the frequency of error reduced. To the extent that I started to complete university assignments without facing this error at all. Plus, I had better understanding of how the language works, which served as foundation to advanced subjects like compilers.

Skip to 2019, I created my very first android app with Java, except, I didn’t know what Android Studio is neither Java language. You don’t have time to learn from scratch when in face of a big hackathon. Only way forward is YouTube videos. But platforms and packages keep changing, which unlocks the box of unforeseen errors.

My latest experience with android errors is really worth it. What happened was, I was working on a flutter app. On a crazy day, an error started to appear, saying ‘Java heap exhausted’. Now, two possibilities I thought of were one, device is running out of memory or two, the IDE. To test for first possibility, I tried to run on more physical as well as virtual devices. But to no avail.

Then I turned towards the IDE, the great Android Studio! The error continued even after setting maximum possible heap size for the IDE. While digging into settings and StackOverflow, I found a solution involving editing gradle.properties file thus changing the heap allocated to the gradle daemon. Having nothing to lose, I tried that solution. Still, the error continued to fill the debug terminal with red.

And I gave up on it.

But that’s not ‘The End’. Few days later, I was checking the C drive for unnecessary data, in order to free up some space. On enabling ‘Show hidden files and folders’, I found a folder named .gradle . Out of curiosity, I opened it. The folder had its own gradle.properties, which held the old small value of Java heap. Again, with nothing to lose, I edited that value from 256MB to 1024MB. And Bingo! The app started running smoothly on virtual as well as physical devices, with no error at all!

Moral of the story is, the error that haunted me for about two weeks, turned out to have a very simple solution. And in the process of reaching that, I had better understanding of how the gradle tool works and overall how the Android Studio works.

Getting frustrated by errors is obvious. But that’s also a great way to understand how the things work. That understanding gives us an edge over other developers, who know only how certain piece of code works. Plus, you start to see the errors coming, thus can avoid them in first place.

Coming back to the title of this article, I love errors, as they help me build better understanding of things and thanks to that understanding, I can choose to avoid them.

I hope you enjoyed this article. If you did, don’t hesitate to give it a clap🙃. Take care of yourself and the loved ones (Still hard times!) and happy debugging!

--

--

Mandar Bhide

Computer Engineering student | Web and app developer| Love to learn technologies :)