Sadly, this is a long way from being production-ready. It really does take a lot of work to create a reasonably feature-complete tax preparation software. Purely judging by 2020 standards, since that's what's nominally supported:
* Forms 1099-R and SSA-1099 are unsupported. Retirees, or anyone that took a COVID-related distribution, can't use this.
* Form 1099-G Box 1 is unsupported. Many people took unemployment during the pandemic, and need to report that income on their return.
* Prior-year earned income for ACTC and EITC is unsupported. Many folks earned more in 2019 than in 2020, and could get larger tax credits by computing the credits using their 2019 income.
* Schedule C is unsupported. Many folks have at least some self-employment income. [1]
Thanks for those points. How would you suggest prioritizing implementation of each item?
It has been nice working with new contributors that have specific knowledge of such issues. The core team is two people, and we're lucky to have new contributors come with specific knowledge in different areas. So, ideally, we could wait for someone with domain expertise to come along. Failing that when have time we pick off the next most important-seeming thing and add it.
To be honest, it depends on how much time you plan to spend on this.
If this is only dozens or low hundreds of person-hours, then just do things at your own pace. Don't worry about releasing a viable product. I'd guess that you find adding tax forms fun. But it's probably not fun to update every form each year, respond to bug reports, and handle other support requests, all under the time crunch of tax season.
Of course, if you have thousands or ten thousands of hours instead, you should be able to support everything I listed, plus the features you'd find in other tax software. With that amount of time, you should be able to do enough market research yourself to figure out what to prioritize.
To pick on one of the more recent PRs that landed, I would think easily 80% of the value of "legislation into TypeScript" would be *annotating* that source code with the citation where followers on could verify the calculation and teaching future contributors to fish
To come back to a technical discussion, I thought the best practice was not to use floating point numbers for currency, and that goes "double" for JS's `Number` which like everything else in JS is kind of loosey-goosey about accuracy anyway: https://github.com/ustaxes/UsTaxes/blob/v0.1.4/src/irsForms/...
I have doubts about the floating point issue just because all values on the tax forms are calculated using floats and then rounded to the nearest whole dollar. But if there's even a possibility that an intermediate calculation could flip a x.49 to a x.50 and change the rounding, then I agree we should switch to a library.
About the contributor guide, we just tried to write it to be as welcoming as possible to new contributors. With respect to "'ask in discord' for the actual content of the tax calculations", I'm just not sure what you mean. That document isn't really relevant to tax calculations. We will give the document another look though based on your feedback.
I’m sorry but this discussion is startling. Currency calculations and accuracy are critical, why would anyone use this if there’s even a chance it gives incorrect results? Once you research the topic you’ll see why JavaScript based languages haven’t been used generally. There are solutions for currency math in js like dinero.js:
> I'm just not sure what you mean. That document isn't really relevant to tax calculations
I guess that's true if the only kind of contribution one wishes is for React or docker or rust-lang fixes, but the issues list currently contains "schedule E" and "HSA 8889" which don't sound like React or "general purpose" software contributions: they sound like changes or contributions to the tax calculations
If someone on HN has a passion for fixing those items, which section of the contributing guide tells them how to code up "schedule E" in a way that is going to be accurate and have its PR accepted? Saying whether new contributions require an accompanying test, and the testing strategy, seem also just absolutely beyond critical to me for a tax calculation system
Maybe all of these are, in fact, covered in discord. I grant that I'm just not a "hop into chat" kind of person, because I find it chaotic, the search is usually oppressively terrible, and it means someone needs to be available at the same time that I have the question
As long as Intuit can lobby for the tax code to be complex and the process to be slow, painful, and manual, there aren't going to be any viable options that aren't just other commercial alternatives to TurboTax.
I have not yet become that nihilistic, but I do think it would require a pair of a subject matter expert and then someone with reasonable software engineering chops to pull it off. Starting by not using a dynamically typed language, IMHO
I figure if M:TG can be implemented, surely the tax code can, too, even if it requires an "expert system," or machine learning, or NLP or something other than 1,500,000 lines of C++ or whatever TurboTax is written in
---
Actually, that's also an interesting question: surely the IRS doesn't rely on an army of people with calculators and pencils to verify said returns, so I wonder if a well placed FOIA request would cough up their COBOL source code they use?
> Starting by not using a dynamically typed language, IMHO
This is written in TypeScript.
As with most everything the problems with why it hasn't been done are unrelated to someone not selecting the "right" language to do it in.
> Actually, that's also an interesting question: surely the IRS doesn't rely on an army of people with calculators and pencils to verify said returns, so I wonder if a well placed FOIA request would cough up their COBOL source code they use?
As mentioned is has to do with lobbying from the major tax companies. The "Free File" program was created out of an agreement the IRS wouldn't create such software usable by folks if the tax companies offered their existing software to most that needed it. https://www.propublica.org/article/inside-turbotax-20-year-f...
Exploitable bugs in the COBOL implementation would almost certainly be matters of national security, so I somehow doubt they'd open up the code!
Joking aside, I think the commonality between collectible card video games and legal code is the notion of "code as data." The record that tracks, say, a Shadowverse or MTG card (not going to mention the other obvious example, especially not today), associates it with artwork, ensures that display logic and other-card-interaction logic is normalized with minimal duplicated data, allows it to be hotfixed, tracks its state through various QA stages, automates fuzz testing with many combinations of other cards... all that has analogies to what would be needed here.
It's a rule engine where every field is a node in a directed graph (of course it's the tax code so it's not an acyclic graph, who are we kidding) but there are ways to analyze that. But, the same way a AAA game studio has ways to manage semi-trusted contractors (and, it would seem, even less trustworthy creative directors) and ensure quality at scale, one could imagine a crowdsourced system for rule verification. The "product" is less a tax form filling system and more of a distributed version control system and CI platform. You solve that, you solve a lot.
To me, a significant part of the commonality is the preciseness of the text, and how much of an impact that can make. Many legal cases hinge on the exact phrasing of a law, and sometimes you don't realize the choice of a word is significant.
Another part is that it's hard to program them in a sane way because the rules are arbitrary. It's possible to code how the rules are, but it's impossible to guess how they'll change in the future. Two things you assumed would never interact might need to interact in the future. Two things you thought would never stop interacting might suddenly stop.
I'm not an accountant, but in the Magic world, you would assume that the turns go in a set order, right? Nope, there are cards that reverse the order of turns permanently. You would assume that a player always controls their own turn though. They don't though, there are cards to let you take someone else's turn. There are also cards that let you play the cards out of other peoples' hands.
I looked at coding it, and it turned into spaghetti pretty quickly. Everything has to have ways to interact with everything else, and testing becomes incredibly difficult because of the sheer number of ways these things can interact. And it's hard to make even the most basic of assumptions because they're liable to change at any point. There are no "laws of physics" that at least define a set of possibilities.
Ideally an open-source project where hundreds of contributors can add small contributions based on their specific knowledge might produce a viable non-commercial option.
recently I complained to a coworker about the state not having an equivalent free file fillable forms and he piped back "thank Intuit for that". I thought what do they have to do with any of that? Just seemed totally disconnected to me. Then this year when I was free fillable forms filing and using the Brave browser I saw all this add blocked junk and checked it out and wow it was all stuff from Intuit. I would have never guessed that free file fillable forms is an Intuit product, it's pretty well hidden the relationship. If you dig around the website you can uncover the origins but it's not obvious with any branding and what not.
I think governments outsourcing software development is fairly common? I've worked on a government (intranet) site in the past as a contractor, we didn't add any branding so nobody would know who the developer is unless they did a FOIA request. Though I don't know if the lack of branding is due to design choice or contractual requirements.
They already have experience creating tax software so it seems like an obvious choice to outsource to.
Your government should just offer something like this. In my country I just check the data they collected to make sure it's correct (and until now it always has been) and click 'OK' - taxes done.
That’s an oversimplification. For example, how do you expect your home government to know about incomes/dividends/gains that you earned in other countries. And that’s just one example.
Is it? That's how taxes work in pretty much every other country aside from the US. They send you a proposed tax and ask you to check if it looks correct.
It's just that in the US, companies like Intuit lobby to keep the tax code as complicated as possible so they can sell tax filing software.
Americans have grown up with complicated tax codes, so that's all they know. They don't realize it can be better.
Here in the UK the vast majority has very simple income (i.e. just salaries). The employer reports the income and taxes taxes and passes it directly to HMRC (our IRS equivalent). By the end of the year for the vast majority HMRC knows how much you've paid in taxes and how much you've earned, and automatically gives you a rebate in case you've overpaid, or adjusts your tax code next your to pay what you still owe (if it's not a big amount).
If you have additional income, dividends, gains and under certain other circumstance, you're liable to fill out a tax return (self-assessment as it's called). It's a very simple form that contains information that applies to the vast majority of those who need to do their self-assessment. After you've sent it back, they'll calculate if you've overpaid (and compensate) or underpaid (and require you to pay what you owe) or neither. It is trust based but they do audits up to 7 years back, and if have lied or made mistakes, then you'll be liable.
The few richest of the richest who fall outside the above two (they still need to do a self-assessment) probably have a completely different process but it doesn't matter because they have the resources to hire firms to figure it out.
Here in the UK, minimum wage workers do not have to do a self-assessment. Only certain circumstances require you to return a self-assessment, some of those circumstances include earning over 150k or having income beyond your usual PAYE income (e.g. dividends etc). A majority of workers don't need to deal with any tax returns or whatnot. At the end of the year they simply either get a rebate or asked to pay what if they've underpaid. Some of those who underpaid don't even need to worry as their tax code is adjusted to include what they owe in their next tax year allowing the payment to be spread over a year.
In the case of this specific country, relatively easily since the country has enough clout to impose reporting requirements[1] on financial institutions outside of its borders.
Hi,
GDS in the UK has done a lot of work around use of language and design to simplify services like this, it's worth having a look at some of their blog.
In particular, there was a big change from thing-gov-cares about to verbs, so instead of just "fill in a XYZ" you get "I want to do X".
I understand here, you need to think about the particular gov forms, but it's also good to surface some things that are user centric, to funnel them to the right place.
Someone else has already noted this: Don't use the native Javascript Number type for calculations involving currency. There's some great reading available online on this subject.[1][2]
There are various libraries around that can facilitate precise decimal arithmetic in Javascript. A well known one is BigNumber.js (https://mikemcl.github.io/bignumber.js/)
A great quote that I found on StackOverflow regarding this issue and wrote down:
"When you are dealing with things that are measured (speed, distance, weight etc.) rounding is OK as the accuracy of the original measurement is probably less than the accuracy of your calculation, and users accept that the final number is still an estimate even if its a good estimate.
When you are dealing with things that are counted (money, people, ICBMs) rounding errors are a disaster. There is always an arithmetically correct answer, and, often the accuracy of this answer is enshrined in regulation, treaties and tax law. Providing a slightly wrong number gets you a free ticket into the Kafkaesque world of auditors, tax collectors and government inspectors; you may never escape with your sanity intact." - James Anderson
Thanks for the write-up. I thought we would be protected because calculations are done using decimal places and then the final return is prepared using rounded integers.
But we have heard this a few times, so I think it would be good to make it explicit somewhere that it's done this way, or switch to bignumber. Do you think if all our calculations are done using decimal places, and then numbers are rounded to integer dollars on the final PDFs, that we'll still have errors?
if you can find a way to use only integers within that range, you can do it safely in plain JS.
for example, units of integer microdollars (one millionth of a dollar) allows you to deal in amounts up to $9 billion without exceeding the safe integer limit. if you want a larger range than that, you need to make a corresponding reduction in precision (such as using millidollars).
or, switch to a full-blown bignum / arbitrary precision library.
Good general rule. However, if you are doing some kind of general economic modeling, with estimated parameters all around, not claiming to represent anyone's accounts or ledgers, I suspect an exception applies.
"When you are dealing with things that are measured" ... or wild-ass guesses.
And I doubt demographers and actuaries are all using integer arithmetic for projecting technically integer-count human-life outcomes.
Calculating taxes: Be careful and conventional, as you say.
Can this application actually e-file? From what I see it can help you fill out various tax forms, but you would need to manually file it (print/mail it in) rather than e-file. Is that correct? From the research I did, it seems that being able to e-file requires that you go through a complex process to get approved by the IRS (PDF: https://www.irs.gov/pub/irs-pdf/p3112.pdf)
I think there are multiple hurdles to getting e-file to work.
The biggest hurdle in my view is that e-file requires an intermediary between the payer and the IRS. One of the benefits of this program is that it runs on the user's computer without a backend.
Ideally the IRS would allow people to e-file without an intermediary. There is www.freefilefillableforms.com, made by intuit, and we may be able to interface with that.
But for now we just haven't figured this part out yet, and we'd probably need community help to get there.
No data transacts to any server. It's just a static client side site that stores data in your browser's LocalStorage. And it does run on desktop as a standalone application (5 MB!)
Have a look at the source, there is no server for this at all, it's a front-end only app. It's published via Netlify. You can also run it on docker locally.
I am programming Swiss tax software. Always interesting to see such initiatives (latest one in Switzerland: taxly.ch). What I do not understand is: Why would anyone want to do that job for free?
Same reason anyone does open source: by doing a bit you hope to lower the activation energy for people to participate and you hope to conquer a big problem with the sheer weight of multiple people.
Schedule D is implemented, and the long-term capital gains worksheet calculations are done, but 8949 and individual non-reported positions are not implemented yet.
Filing taxes can be an incredibly easy process. In Sweden, the majority of people have such basic tax filing that they only need to approve data collected by the Swedish IRS. The entire process takes a few minutes, is done online or through SMS and involves exactly 0 accountants.
The situation in India is far, far better than the one in the US.
The Income Tax Department has provided free filing software since the mid-to-late 2000s. Earlier it was Excel-based. Then they introduced Java-based tooling. Finally, they added in-browser filing for simpler returns (ITR 1).
The problem in India, as always, is not the software, but the laws/rules. If your case is complex and you don't know all the applicable rules, you are going to need professional advice. And professionals have access to professional filing software.
* Forms 1099-R and SSA-1099 are unsupported. Retirees, or anyone that took a COVID-related distribution, can't use this.
* Form 1099-G Box 1 is unsupported. Many people took unemployment during the pandemic, and need to report that income on their return.
* Prior-year earned income for ACTC and EITC is unsupported. Many folks earned more in 2019 than in 2020, and could get larger tax credits by computing the credits using their 2019 income.
* Schedule C is unsupported. Many folks have at least some self-employment income. [1]
[1]https://quickbooks.intuit.com/self-employed/report/
As for software I can recommend to an end user:
https://www.irs.gov/filing/free-file-do-your-federal-taxes-f... https://www.myfreetaxes.com/
And for comparison, a more complete solution from an independent creator:
https://sites.google.com/view/incometaxspreadsheet/home