Hello there, my name is Eido, I’m a software developer and I want to ask you a question:
Have you ever encountered the moment when you had a super duper idea you wanted to implement while coding that just jumped into your mind?
Guess what? It also happened to me! What are the chances?!
So, you created some sort of nice comment as follows:
// todo implement <super duper idea>
This nice comment surely written from several good reasons, such as:
The truth is, this happened, happens and will happen to you, to me, and to all programmers while coding, how wonderful!
But there are some elusive problems in using this approach to remember your super duper ideas, what are they?
Luckily, you came to the right place, and the concept of codetags will solve you those problems:
It’s time to take action and convene the concept of these kind of comments, which can be found almost in any software project written.
As you probably already understood by reading the introduction, codetag is:
A widely used ad-hoc code comment markup convention to serve as reminder of section of code that need closer inspection or review.
I firstly read about this subject from PEP350 — Codetags which originally written by Micah Elliott in 2005. In this article, we’ll improve it a little for productivity purposes.
Codetags can be written in any programming language that supports comments.
I have using them for a while in Java programming language, XML, JavaScript and C#.
I also find them useful while working on multiple projects at the same time (don’t ask me why, but it happened) when I used them as my reminders to what I wanted to do when coming back to a project after a few days (using DOING mnemonic).
// fixme <incomprehensible short summary of tech important note>
One of the problems in the above codetag is “data” loss — when you read a codetag that wasn’t written accurately enough the following questions start to float around:
What exactly the author meant? who had this weird idea? for god sake how much is it lays here?
Those questions can be really critical because maybe the author of this “codetag” was the developer of this class when it was on early stages, and what he meant is that he thinks that developers of this class should write a technology specific important implementation by code that will prevent a slowdown that most probably will appear in the future, but he didn’t had the the time to do it and there was no slowdown at his time, so he continued, perhaps moved to another project and this part left alone.
How can we avoid this elusive “data” loss?
<CODETAG MNEMONIC>: <Codetag subject><Optional codetag multi-line message><(date)> <Author>
Here is an example of a codetag which sticks to above written rules:
/** TODO: Change client request from this server* The login will happen automatically when the service starts up.* A get service status will be called.* The methods that he calls will use server responses cache.* (23/01/2017) Aurobindo Boghos */
You probably ask yourself “why the hell should I write those lines and waste my time instead of continue coding faster toward my goal ?”
The answer to this question is divided into two parts:
Quickly writing well-formatted codetag in Android Studio IDE using Live Templates feature
There are numerous mnemonics mentioned in PEP350 — Codetags — Mnemonics, the mnemonics I found the most useful for me are the following:
TODO - something that someone need to do someday (notnecessarily) in the below section of code.
DOING - self reminder for what are you currently DOING (notnecessarily) relate to the below section of code.
CONSIDER - reminder to CONSIDER some sort of things (notnecessarily) about the below section of code.
BUG - the below section of code causes BUG.
FIXME - the below section of code need to be FIXed.
HACK - the below section of code is a workaround.
XXX - important note for you and other programmers (notnecessarily) relate to the below section of code.
CLARIFY - very incomprehensible section of code below that you need someone to CLARIFY for you.
So, you wrote some well-formatted codetags to save both your super duper ideas using snippets and your teammates precious time when they’ll read them, you’d probably want a way to easily manage those codetags so it will be much easier for you and your teammates to organize and navigate back to them, see how many codetags do you have, filter them by their mnemonics etc.
As of today, the following recommended tools are the ones that I’m familiar with, that will provide you the solution to easily manage your codetags:
You guys are welcome to share more similar tools that you are familiar with and I’d be happy to try and add them to the above list.
Finally, after understanding the concept of codetags, how to save both your own and your teammates super duper ideas, and how manage them, you might already seen that we only use them as reminders.
Currently, I don’t know if there are tools to generate the output of the purposes I’ll mention below, but you might also use them for the following purposes:
/** TODO: Implement Json send via socket* Also handle the login result* (29/01/2017) Demeter */
/** FIXME: parcelable object reading and writing* read answer most voted comment - http://stackoverflow.com/questions/7042272/how-to-properly-implement-parcelable-with-an-arraylistparcelable#comment39567370_7042753* (18/01/2017) Eido */
// CONSIDER: Do we need secret key?// (28/11/2016) Eido
<!--DOING: Add a video which constructed from h264 aacpriority on 1080p and multi speakers usage.(06/11/2016) Eido -->
/** TODO: Change to user friendly message* or remove by being irrelevant for the user.* (16/01/2017) Bob */