Plan your day tips

The term Plan your day might trigger the thinking that Oh! I (or that guy) must be very busy. I do not have to be busy to learn how to plan my day. It is just another fun thing in life that I can try. It is cool if things are planned and organized before getting started.

When starting a day, everyone has different expectations depending on their job, their position, the nature of business they are in. Regardless, one must have something done in the day.

Being a developer and team leader of a team of 10, here are typical things that are expecting me when I start a day

  1. Unread messages in MS Teams channels
  2. Emails from pull requests (PR) that need to review
  3. Emails from comments, discussions on the PR that I reviewed
  4. Emails from product backlog items (PBI), bugs that team members asked
  5. My own PBIs, Bugs that I have to work on today

Very short and simple list. But sometimes, I had problems.

  1. Jumped between PRs
  2. Forgot to answer some questions/discussions

Most of the time, they are not big deals. But it is cool to be better at it. Here are what I have come up with.

Plan your day

Everyday, before starting a working day, I spend around 25 minutes or less (a Pomodoro) to plan for the day. It is a habit that I want to develop and be disciplined about. Instead of chasing around my day, I step back and plan.

It is quite easy and simple to improve the siuation with existing free tools—Browsers and Microsoft To Do app.

Browser tabs

I usually have a couple of browsers opened. There are some tabs in each. The content is vary. Some are just news, some are technical bogs, some are social media.

Why did I not have one for planning purpose? Let’s try that. And it works for some weeks for me.

  1. Open a new blank browser (I use Chrome)
  2. Go through my emails. Skim through one by one and open the links in the email in that empty browser. It is important that I do not proceed them immediately. Just read through quickly and open the links
  3. Sometimes I prioritize them by reordering the tabs

During the day, I close one by one. And for any new things come up while working, the same approach is used.

Microsoft To Do app

I use it to jot down my tasks as quick as possible. It has a cool feature called My Day that allows me to jot down things I have to do in that day.

  1. Answer John questions on MS Teams channel
  2. Ask Anna how things is going with the PBI 1234
  3. ….

If my To-Do list is empty, I have a quite, good day.

Summary

It is simple but it works. All the tools are there and free

  1. A browser: Chrome, Edge, Firefox, …
  2. A to do app: Microsoft To Do is free and good if you have Microsoft account
  3. A little bit of discipline

Apply Zettelkasten to improve English with Trello

Recently, I was introduced to Zettelkasten from X-Team blog. It is a system, a method to capture and retain knowledge.

Zettelkasten suggests an approach to solve a common problem – Unless you have a super memory, you forget what you have learnt weeks ago, even days. "I remember I read it somewhere, that I know it" – I told myself many times when, for example, I saw old words. Words that I read the other days in articles, in conversions,…

Nowadays, knowledge is almost free. You can search for almost anything using a search engine such as Google, Bing, … We do not have to remember too much as far as we know what and where to find what we need.

That reasons well with some area, especially information that we do not need to access frequently. I want to turn information into my knowledge as much as possible. That is the only way for me to grow.

Being a software developer, I use English in my job, mostly in writing. I write code in English; I write/read documents in English; I communicate with my clients, coworkers in English. I am glad to have opportunities to learn new words, new expressions. Below is my flow when I meet a new word

  1. Lookup their meanings, usually via Collins Dictionary – I highly recommend it
  2. Read through the definition and guess the meanings. And to understand what the other person (or the document) was trying to say

The flow took around 1-3 minutes. And I was done. I declared the victory. I thought I got it. Until! A few days later, or weeks, I saw it again. I could not access its meaning from the memory. I knew it. I just could not access it. The knowledge about that word was not mine.

So the best thing I could do was to repeat the flow, again. It sucks! Really sucks!

When I read about Zettelkasten, an idea was flashing in my mind. Hey! I could utilize this system to capture and retain knowledge. I could improve my English situation. So I have started Zettekkasten.

Zettelkasten-English-Board
Zettelkasten English Board

Tool – Trello

Next, I need a tool to capture knowledge. Trello came to my mind immediately. I have been using it for years. I knew it was a perfect tool for this purpose. I suggest you visit Trello for a complete list of features, of what It can support your creativity.

Why Trello? Because:

  1. Access everywhere as far as you have internet access. You can use the web version, the mobile apps version (Android and iOS)
  2. There is a free version which supports basic functionalities. That is all I need for knowledge capture
  3. Organize information in lists and cards. A card is like a sticky paper note, a perfect tool to brief information
  4. Easy to use
  5. Search fast
  6. It gives me the feeling that I am working with paper and sticky note, the paper sticky note. That feeling is important because it lowers the barrier. So simply it makes me feel good

Prepare the garden

Trello is a general purpose tool. You use it with your own creativity. To use it for Zettelkasten (yes I use that term more often to remind me of capturing and retaining knowledge), I have to prepare. Turn Trello’s list and card into Zettelkasten holder.

I decided to group words by months. I wanted to see what I have learned over the time; and at what moment (at what month is good enough) in time.

  1. A list is a month
  2. A card is a word. The card title has a short description of the word. This allows me to recite them faster by glancing at the board. All the detail, example, … is in the card’s description. And usually I put a link to the Collins Dictionary. I can read them in detail by following the link. Easy and fast

I name the board: Zettelkasten – English. This reminds me of the approach I am using and what the board is having. Next year, I might need a new board with the year. But now, I do not worry that much.

It is easy like that.

So my flow has changed

  1. Look up the meaning in the Collins Dictionary
  2. Create a card in the right list. If the list (the month) does not exist, create a new one. It is important to spend a little time to write your own understanding of the word

Note: Avoid copy and paste as much as possible. Writing will help remember better.

Eat the fruit

Setting up and leaving it there will not help. I need to tweak my routine, my habit to take advantages of the Zettelkasten.

At work, I often open that Trello board in a browser tab. It allows me to add new words faster. Some minutes of reviewing the board has a tremendous impact on my memory. It will enforce my long term memory.

I also install the Trello app on my phone. I have short idled periods while waiting for my kid, before taking them to school and pick up after classes. Instead of visiting facebook, twitter, news, … open the Trello first; glance at the board, and continue my normal routine if I wish to.

The app allows me to add new words anytime, anywhere. I simply capture them first, then work on the detail later.

I utilize my time better without impacting anything.

I have had the setup for over a month (there are 2 months on the board at the time of this writing). So far it works beautiful. I still need to practice and enforce my disciplines.

Why do I limit myself only to the English? So I have applied in other knowledge areas: technology, book. They require different setups but the principles remain.

Zettelkasten with Trello sound a good couple.

Teamwork by Giving Implementation Hints

Tom and Jerry work in an agile development team building a web application. The team has 4 developers. In the planning meeting, Tom is assigned to a product backlog item (PBI). The PBI is simple. Anyone in the team can implement it.

Tom implemented the PBI the day after. It worked. A pull request (PR) was created and asked Jerry to review it. It is a normal process of the team.

Jerry left a comment in the PR:

Hi Tom, we already implemented the same thing at X feature. There is a common method that you can reuse.

A very constructive, useful feedback. Except the consequences:

  1. Tom has to throw away his implementation and reuse the existing one
  2. Waste of time from both sides: implementer and reviewer

Does it sound similar to you? – A common problem: Developers re-invent the wheel.

Why

The fact is that it is hard for a developer to know everything in the system. For many, that is impossible. Developers take PBI from the sprint backlog and work on them. How could they know what are already implemented? What could they reuse?

Discussions can help if you know what to discuss. Asking questions on the team can help if you know what to ask.

Reflecting on your team, how many times do your developers ask questions regarding to the implementation, to what to reuse. It is easier said than done.

Developers tend to write their own implementation. Because they think it will be faster and safer for them. So they just write code. And one cannot ask that question for every single PBI.

What Could We Do to Improve?

I am not a big fan of theory saying that developers should be proactive, ask questions. Yes. They should and they might will if that is the business logic. Or that is something unclear in the specification. Implementation? Not really.

Well-planned in the planning meeting can help. However, people have not talked much about technical design (or implementation hints) in the planning meeting.

Asking questions in the daily stand-up? I have not seen many questions asked in that regard. Most of the messages in the daily stand-up are status report. Just they are expressed in a different way.

So what could we do?

Give implementation hints in comments of PBIs

Each developer has different knowledge about the system. When an PBI is reviewed, some might have an idea of:

  • What it is
  • How to implement
  • What could be reuse
  • Reference points such as old PBI, Pull Request, or a specific commit

So instead of keeping them in your head, write comments in the PBI. When a developer starts implementing the PBI, he/she has a good starting point. From there, he/she can start discussions, asking questions. Because they know what to ask and who to talk to.

In a team, the most skilled, familiar with the code should look around the team backlog. Try to give as many hints as possible. Anyone can do it as well.

The approach has a compound effect. The teamwork is at the next level. Developers care about other PBIs, about the team. It also encourages conversions, engagement. When a developer leaves a comment, the conversion has started.

Take Away

Give implementation hints, folks, give implementation hints. Your teammates do not know what you know. The developers working on those PBIs will thank you. And in turn, they will do you a favor. That is where the conversation, the engagement begin.

Farewell 2017 Welcome 2018 Win the Year by Plan

2017 comes to the end. Regardless of what we have done, we have spent 1 year. It has gone completely. You never ever get back a year called 2017. At this time of the year, people start thinking about vacation, about parties, about salary bonus. And then we welcome 2018 and spend it just like 2017. For many, live goes on in that pattern without their acknowledgement, without their awareness. Each has their own unique way of spending their time. And everyone is right.

What if we try something slightly different? I remember Jim Rohn once said

Do not spend a day until you see it finished

Do not spend a week until you see it finished

Do not spend a month until you see it finished

Do not spend a year until you see it finished

It means that you should plan the year before jumping into it. The highest abstract level is that you should have a plan, you should have goals. And because it is so abstract, it is hard to implement. In a good/bad mood, human being will promise many things. I remember I made so many promises every year in the past. Why? Because I fucked up the year. I had to make something to feel better. Guess what happened? I made the same promises every year. Fortunately I realized that fact and changed.

Have you ever asked yourselves?

  1. What do I want to accomplish?
  2. What do I want to improve?
  3. Hey what are my plans, my goals?

If not yet, I suggest you should start from this year. The process will not take you much time. However, it requires your honesty and courage.

I hope you have some free hours with paper and pencil.

What Have I Done Well?

To plan for the future, you have to reflect the past. Many seem to focus on “not good or bad” things when they reflect the past. I would suggest you do the opposite. Thinking about your accomplishments, even small ones, give you more energy. No matter how bad a year is, there are always something we did good. All you need to do is to bring them back from your memory. When you list them out, you can say

Hey, not bad. Looks what I have done well.

Do not find the bad things. Because you will find many. Everyone does. Everyone has good time and bad time.

Write them down. Write them down. And write them down.

What Do I Want to Improve?

It is time to think about the future. Think about your goals, about your desire. Regardless of how you done in 2017, 2018 comes with the fresh air.

Some choose to take on the bad things in 2017 and improve in 2018. I do not think it is a good idea. You cannot change the past. In stead of dragging the bad things along into a year fresh year, why not start over again? Just list out what the hell you want in life and go for them from the ground up.

Setting goals is an art. There are many articles you can read on the internet. But be careful! Because you might be overwhelmed by the amount of information, the steps, the advices. The result is that you might not know how to start.

I would suggest the goals should be specific. Forget about S.M.A.R.T goals. Let’s say you want to improve your health. It is too general. What if you set this goals, by the end of 2018

  1. Run 10KM in 1 hour
  2. Do 50 pushup.

That’s it! How are you planning to accomplish that? That is for another day of planning. You will figure out the methods when you progress towards the goals.

If you do that, you know how 2018 looks like when it finishes.

 

Is that easy? Yes and No. Because

It is easy to do. It is also easy NOT to do.

When I talked about the idea with some people, they told me.

  • Yeah! you’re right. I will do it when ….
  • You are not in my position.
  • I am fine with my life

All kinds of reactions, they are all right. However, the end results are different. What you get tomorrow depends on what you decide today.

What if my suggestions bring you some good result in 2018? Who knows! Unless you give it a try.

Your time, your life, your decisions!

Thank you for your time reading my blog.

Farewell 2017! Welcome 2018!

In the Mind of a Developer

Working with a 5-6 years old system gives me a good chance to reflect on code written by other developers. When looking at an old code, even written by me, I often think “hmm what a mess! who wrote that code? what were they thinking?” That’s kind of things! The right attitude is that I should not have thought that. However, that is what’ve happened. To me, it is a good thing because I started to think of “I can do it better“.

Each codebase has its own story. This time I got a chance to look and troubleshoot another codebase. I decided to take a deeper step with questions to myself

What were the developers thinking? How would they end up in that design/decision?

The main point is for me to learn something. I am not interested in spending my time to criticise them.

The Story

Because of the contract and sensitive thoughts, I will rename and make up my terms. The system is a service that allows many systems call to log data. It has the same notion of any logging framework in .NET, such as log4net, NLog, … except this is a custom WCF service.

    public class LogCommand
    {
        public string Product { get; set; }
        public string User { get; set; }
        public DateTime CreatedAt { get; set; }
        public string LogMessage { get; set; }
    }

    public class LogEntry
    {
        public Guid ProductId { get; set; }
        public Guid UserId { get; set; }
        public DateTime CreatedAt { get; set; }
        public string LogMessage { get; set; }
    }
    public class LogCommandHandler
    {
        public void Execute(LogCommand command)
        {
            // Begin a transaction because we use NHibernate to talk with SQL Server
            var productId = CreateOrGetProduct(command);
            var userId = CreateOrGetUser(command);
            var logEntry = new LogEntry
            {
                ProductId = productId,
                UserId = userId,
                CreatedAt = command.CreatedAt,
                LogMessage = command.LogMessage
            };
            _session.Save(logEntry);
        }

        private Guid CreateOrGetProduct(LogCommand command)
        {
            // if this is a new product, create.
            // otherwise return existing product id
            return Guid.NewGuid();
        }

        private Guid CreateOrGetUser(LogCommand command)
        {
            // if this is a new user, create.
            // otherwise return existing product id
            return Guid.NewGuid();
        }
    }

There is more than above. But you get the idea. Here is the logic

  1. Get the right Product associated with the log. Insert a new Product record if a product is new.
  2. Get the right User associated with the log. Insert a new User record if a user is new.
  3. Insert a new LogEntry with the ProductId and UserId

And in the database, we have 3 tables

  1. Product: for products
  2. User: for users
  3. LogEntry: for log entries

The reason for having Product and User tables is to support searching from a WPF application (let’s call it LogViewer). At the LogViewer, users want to be able to choose Product from a dropdown. The same goes for users.

The system works as It is supposed to be …. until one day. When there are many concurrent calls to the service. It works unstable.

To cut the story short, the problem caused by the way it managed Product and User. When a production is created (but have not flushed to the database yet), it is put into a global cache to improve performance. When a next request comes in, the system will check the global cache first. Here is how the problem occurred

  1. Request 1: Create a new product, put in the global cache. But NOT commit transaction yet.
  2. Request 2: See that product in the global cache, it takes the product and assigns ProductId to the LogEntry. And it commits the transaction.
  3. The database foreign key constraint throws an exception because the ProductId has not persisted in the database yet.

Hmm? But Why?

The interesting part to me is the question I asked myself. Why? What brought the developer to that implementation?

Here is my theory.

Note: It is just me pondering my own thoughts as part of my learning practice.

Developers tend to focus on the technologies, on how to implement things. Many have been working with SQL Database for years. Thus, they have built a Relational Thinking Mindset. Let’s go back in time and try to imagine what they thought when they got the requirement.

We need to build a log service that allows us to store and search logs by product or user. A log entry will belong to a Product and be created by a User.

Oh cool! Got it. Then we will have 3 tables, one for Product, one for User, and one for Log. And we will have foreign keys from between Log and Product, between Log and User. Easy cake! Job done!

If I were him years ago, I would have done the same. What was missing? – The usage analysis.

Ok! Analysis

Move forward to now where I have years of developing, where I have a problem at hand, where I fight down the root cause. I meant I have so many information at my disposal. What questions would I ask? What concerns would I put?

What are the main operations?

  1. Write log
  2. Search log
  3. Get all products – for the search purpose
  4. Get all users – for the search purpose

What are the most frequently used operations?

  1. Write log

There is a good notion of CQRS in this service. The Write Log operation is Command, the rest are Query. Can we support queries without maintaining Product and User tables by ourselves in code? Yes, we can. SQL Server comes with the powerful concept: View.

By creating views for Product and User, the service can query on them. It gives the same result as maintaining tables.

Takeaway

What happens if we interrupt our default thinking process with

Hey! wait a minute!

That should be enough to allow us to think differently. It might help you start a questioning process.

When looking at a codebase, no matter how good/bad it is, try to reason the question

What were they thinking? How would they end up with the design?

I gain so much with this approach. So hope it works for you too.

%d bloggers like this: