Sunday, April 1, 2012

The US Tax Code should be written more like software!

After wasting our 2nd straight weekend working on our taxes, I've come to two conclusions:

1)  The US Tax code is too complex, but I don't think it will ever be greatly simplified since it gives people with money ways to pay less in taxes

2)  If the US Tax code needs to so complex, it should be written more like software and less like a legal code.

Think about it:  All of the rules are basically an algorithm.  In fact, a lot of the rules say things like "Subtract line 34 from line 30 and write the result in line 35".  That's not even sophisticated enough to be called an algorithm!  It's just describing a basic spreadsheet operation.

Many states, as well the IRS, provide PDFs with editable cells.  But, these editable PDF cells don't update one another like a spreadsheet (i.e. if Line 7 is an input into a calculation that produces Line 10, changing Line 7 doesn't affect Line 10; you have to re-do the math yourself).  And there's no way for these PDFs to reference one another.  So, if the state tax code requires the adjusted gross income (AGI) from the federal 1040, there's no way to tell the state income tax PDF, "go get Line 37 from the federal 1040".

I really think that we need a richer format for PDFs that the IRS and the states should use to write their tax forms.  This format (Tax-PDF?  ePDF?  tPDF?  TDF?) should have the following properties:
  1. It's basically a spreadsheet with a bunch of text next to each line, so that it can carry its logic around very easily
  2. Each Line can be named (Line 37, Line 4, etc) and lines can be exposed for export into other forms
  3. You can import Lines from other documents, i.e. "import Line37 from US-1040-2011-v1;" or something like that
  4. Each cell knows if it's been imported from another document, entered into this form but could have been imported, calculated based on other values in this document, or entered into the current form because it cannot be imported from elsewhere.
  5. There can be a standard "interface" of lines to be exported can be used by brokerage houses and banks for 1099-INT and 1099-DIV forms to make importing these forms into other documents very easy
  6. If you put a bunch of these files into one folder, you can weave them together to get them to import information from each other
  7. As many common situations as possible are encoded in these documents as sub-modules.  There should be a set of standard situations (marriage, divorce, birth, death, moving between states, etc) that all state documents are required to implement, and they have to document them in the same order, using the same FAQ.  It should be clear where a state's formulas deviate from the standards of other states.
  8. The format should be "patchable", so that bugs can be fixed by having a new version of the document update or patch a faulty older version.
  9. Any box should serve up useful meta-information if you ask it, such as what other boxes contributed to it, and what situations that box is relevant for (i.e. does it matter if you're married filing separately?  is it relevant if you were a part-time resident?  What if you were in the military?)
  10. All of the worksheets (Schedule A, Schedule D, etc) can also be written in this format, and then imported by the 1040. 
  11. You can convert the document into a web form (javascript or whatever)
Basically, this would be a different way to write tax documents.  Instead of writing the tax code as words and then sticking boxes at the end of the words, you write the code like it's a spreadsheet, and then label the cells of the spreadsheet.  If you're careful it can still be printed out and used by hand, but it doesn't have to be.

I assume that turbotax already does a lot of this, but turbotax is constantly faced with converting a textual tax code into fancy spreadsheets.  I want the tax code itself to be written as a spreadsheet first, using a flexible standard that states, banks, and brokerages can all use.  The spreadsheet can still look like a PDF, but the entire logic of the tax code is inside it.

In fact, it might be possible to write a fancy PDF parser that converts a lot of the tax code into a spreadsheet.