A User's view of Hledger

Learning about hledger

What is the difference between “iadd” and “add”?

Now that I have both “iadd” and “add” working to enter my transactions interactively (see last week’s post for details), I can comment on some differences between between the two.

First, though, the similarities. Both programs work. I can use either program with relative ease to enter transactions.

That said, my experience is that each program has some advantages that the other doesn’t have. Here are the ones that I observed:

Advantages of “add”

Adding multiple transactions with the same date is often slightly easier. For example, let’s say that you have 4 transactions to add, all of which have yesterday’s date. After you enter the first transaction, the second defaults to yesterday’s date. So, for the 4 transactions, you enter the date for the first one and accept the default date for the next 3. On the other hand, “iadd” defaults for each transaction to today’s date.

After you select a description, “add” shows you a whole transaction, i.e., the one it will use for the defaults. Therefore, you see ahead of time the defaults it will use for the accounts and the amounts.

When you start “add,” it reminds you of basic instructions, such as entering a “<” to go one step backward. You don’t need to press a special key to bring up the instructions. They are just there at the beginning.

Advantages of “iadd”

If the current date is near the beginning of a month and you are entering transactions for the previous month, an “iadd” shortcut is to enter just the day of the month, and the program figures out that the month is last month. For example, if today is June 3, and you need to enter a transaction for May 30. You enter “30” for the date, and “iadd” sets the date as May 30 of the current year. By contrast, “add” would enter the date as June 30.

With “iadd,” you see a complete date when you start typing a date. For example, after you enter “3” for the date, it shows you the complete date. You can then press enter to accept the date shown. Or you can continue typing to adjust the date to the one you need.

When you start typing in the description field, you immediately see a list of matching descriptions that you have used in the past. You can continue typing to narrow to just one description, or you can select one of the matches.

Ditto the above for typing account names. This can be handy when you have an account such as expenses:home:repair. You can type R-E-P, and expenses:home:repair will be shown along with any other accounts with the letters R-E-P in them.

You can call up the instructions specific to “iadd” in the middle of entering a transaction. With “add,” if you have entered several transactions, the instructions will have likely scrolled off the screen.

Finally, I find that iadd is easier to use when adding a comment.

In summary

Both programs work well, but they don’t function identically. As a result, there are times when one will work slightly better than the other in a given situation. Nothing major, but it’s nice to know the differences.