In this article, I will describe my struggles with a programming task I was asked to complete.
Preface
The task itself is not important at this point. The idea is to present the stages, and problems that I had to face, which in my opinion are common to most programming problems.
My programming assignment
I had to create an Android application (in Java) that would have only one screen (GUI) divided into two sections (fragments).
My stages of struggling with the task
The list below is my attempt to present and systematize the stages of struggling with any programming task.
- Lack of planning and division of the task - even the smallest task should be planned and divided into smaller elements.
- Underestimating the complexity of the task - ignorance, downplaying the task.
- Composing a task from smaller elements into one whole - using two different libraries and framework implementation methods.
- Failure to deepen the theoretical knowledge of a given library or framework - when using new libraries or frameworks, you should at least read the official documentation of the selected issue.
- Limitations in documentation and tutorials – official documentation and tutorials only describe and present isolated, ideal solutions.
- Proof Of Concept, PoC, isolating the problem - if possible, we create smaller ones , separate projects in which we check the operation of one element.
- Introducing single changes - we make changes to the code in one line, test them and only then introduce the next change; it's best to use TDD – Test Driven Development.
- Failure to check the requirements for the application - very often it happens that the programmer knows how to solve a given task, but does not make sure what the entire project should look like and then he has to "start all over again", and it was enough to ask "what exactly the application as a whole should do".
- Sometimes you have to start over and go no further.
- Side tasks unrelated to programming - sometimes you will need to configure something, e.g. a server, gain access to something, e.g. an API key.
- The end result is not as satisfying as the process of solving the problem - if you have this approach, programming is for you.
An example of a task I struggled with – 7 days
On the first day I checked that application skeleton can be generated from wizard for creating projects in Android Studio (IntelliJ version for Android) . There are also many tutorials on this topic on the Internet. I thought if something can be generated using the wizard, it certainly won't be a difficult task, I'll start doing it tomorrow. Point 1. – Stages of struggling with the task.
The second day, after generating the project, everything worked, the text was displayed and the button responded to clicking. I declared great success and postponed the rest of the task until the next day. Point 2. – Stages of struggling with the task.
On the third day I started dividing the screen into sections and fragments. It turned out that this can also be generated using a wizard and there are many tutorials on this subject on the Internet. I have generated another project that uses fragments. At this point I had two separate projects containing two different methods, two different ways of using the Android framework. Fragments also worked fine. Another success, I will finish the task the next day.
On the fourth day it was time to combine the two projects into one whole. I'm sure it can be done, because I saw somewhere on the Internet that it can be done. I have created a third project which will contain the first project with the application template and the second project with fragments. Unfortunately, this was no longer in the official documentation, and the tutorials were also silent on this issue. I had to put all the designs together by trial and error. After a long struggle, this was achieved. Point 3 - Stages of struggling with the task.
Why didn't I immediately add the fragments to the project template, but created a third project? Whenever possible, we create the so-called PoC – Proof Of Concept, we verify whether a given functionality works as we want. Then we combine smaller PoCs into one whole, this will not be in most cases in the official documentation or tutorials, you need to use logical thinking here. Point 6. – Stages of struggling with the task.
On the fifth day a new requirement "came in" to the application being created, which I didn't know anything about before - display data on Google maps. Of course, there is a wizard and tutorials, I started creating the fourth project. For Google Maps, there were a few non-programming activities that had to be performed, namely, creating Google maps API key. Points 8 and 10 - Stages of struggling with the task.
Now I had four applications – PoC projects:
– first, Android application template,
– second, fragments in GUI screens,
– third, combination of the first and second project,
– fourth, application with connected Google maps.
On the sixth day it turned out that it was possible to connect the "fourth" project with the "second" one without any problems, but it was impossible to connect the "third" with the "fourth". So, putting the projects together started all over again. I created a new "first" design, overlaid the "fourth" design on top of it, and then added the "second" design. Yes, yes, there was no other way. You're probably asking, but how? There was no such configuration in the official documentation, and the tutorials focused on single isolated issues, e.g. fragments in GUI screens, Google maps in Android. For a while I tried to combine the "third" and "fourth" projects, but it was better to start from scratch, so I did. Points 4, 5 and 9 - Stages of struggling with the task.
On the seventh day I was explaining to the person receiving the application why the application did not look or work as expected 😉
Summary
There was little Java code, I spent most of the time getting to know the new framework, in this case the Android framework, but it could be e.g. Spring Framework, Hibernate, etc.
Expectations vs reality
Different people perceive the ordered software differently, so you should always remember this - the picture below shows it perfectly.

Conclusions
As can be seen from the above, the implementation of the "small" project took me six days. I recommend not sitting up at night and assuming that it can be done "in one day". It is better to approach the topic with common sense and plan for more than one day to complete a given task. I will also add that I am describing a situation in which I was the only one working on a given task. The situation becomes more complicated if the task is to be performed by a team of programmers.
An additional element that I did not expect was the search for solutions in the search engine. When searching for "Android Google Maps", I received links to Android applications with Google maps, and it was similar with other keywords. It turned out that the word "developer" should be added to the query for the search engine, e.g. instead of "Android Google Maps", you should search for "Android developer Google Maps".