return to table of content

A Canadian payroll dependency chart

mmastrac
67 replies
2d1h

It's a shame that we don't have open formulas in code form published by the government. The only way that I know how to do this reliably is using the web form provided by the CRA here: https://www.canada.ca/en/revenue-agency/services/e-services/...

As you can imagine, doing this by hand is quite painful and error-prone.

Topgamer7
42 replies
2d

I want something similar for my mortgage calculation. For example I cannot get my bank (TD Canada) to inform me of how much each payment goes towards my principal. I'm pretty sure I've calculated it properly, however the number is often in the 10's of dollars off from what the bank reports my outstanding balance is after a payment is made.

Also don't get me started that I can't use an api to get my account details and statements in Canada.

cachvico
12 replies
2d

    Also don't get me started that I can't use an api to get my account details and statements in Canada.
Anyone know if there's any ongoing effort to this effect - i.e. to force banks to implement a common API for querying data held in their accounts?

A brief search reveals that Canada is of course missing from https://en.wikipedia.org/wiki/Open_banking

franga2000
5 replies
1d22h

Don't be fooled by the "open banking" propaganda, we've had it in the EU for years and we're still scraping web apps like in the old days.

<Rant> I tried to get API access to my bank account and was told by my bank that Open Banking is not for physical persons. I tried to the same for my nonprofit and was told that only licensed PSD2 TPPs ("third-party providers") can use it. The national bank issues those licenses, but provides no information on what the process for obtaining one is. I called some friends and got in touch with someone at a major payment services provider, who explained that to get their license, the national bank insisted on them having essentially unlimited-coverege insurance - something no insusrer in the country was even willing to sell at any price. They managed to get the insurance from elsewhere in the EU and whole process cost them "six figures". Even after that, you still don't get full access to their own accounts, because the whole API is built on the idea of connecting customers with fintech apps, so there are a bunch of limitations intended for privacy and security that don't make any sense in a "I want full access to my own account" scenario. All the advice I got was "just keep scraping". How the fuck do they dare call that "open" banking?!? </Rant>

axus
2 replies
1d22h

Crypto-currency was a test-run for what happens when you put a financial transaction API on the public Internet. And those servers were written by smart people with no regulatory compliance to worry about.

franga2000
0 replies
1d22h

Cryptocurrency is so wildly different from normal money in so many ways, that any attempt to look at just the "open API" aspect of it is futile.

Or do you see any conclusions about "money APIs" that can be reasonably made from crypto?

cachvico
0 replies
1d16h

Result is a massive ecosystem, so yes it proves the point (regulation aside).

viraptor
0 replies
1d10h

I wouldn't even trust the API with the numbers. The CSV and OBX published by a number of banks I used were always broken in some interesting but obvious ways. Minutes replacing months (someone mixed up %m/%M), values with cents appended twice for international transactions, unique IDs in OBX rolling over every month, and many others. Unless the same API is used for their legal reporting, I don't have a reason to expect it's better. Scraping the pages was way more reliable.

cachvico
0 replies
1d16h

Believable.

itsoktocry
1 replies
1d23h

Anyone know if there's any ongoing effort to this effect - i.e. to force banks to implement a common API for querying data held in their accounts?

Literally in the news as we speak!

https://globalnews.ca/news/10195005/canada-banking-changes-2...

What it ends up looking like, who knows.

cachvico
0 replies
1d16h

hah! Nice. Although, $100 says we're gonna fsck it up.

Aerbil313
1 replies
1d14h

Weird, is Open Banking only a thing in Turkiye? I have all my bank accounts added to my primary bank’s app, though it’s read only and I can view balances and transactions.

cachvico
0 replies
16h23m

Going out on a limb to say ironically it's easier for the developing world to implement this stuff because they're so much less entrenched to begin with. Have also seen this in South Africa for example.

j45
0 replies
1d23h

Canada is working on Open Banking from what information is out there - although it will be important to confirm that the Canadian interpretation of Open Banking is the same or compatible with other nations, which in no way is guaranteed just because it's called the same thing.

ensemblehq
0 replies
1d23h

Consulted in the space about 3 years ago. Regulatory powers lack tooth. Most large banks are not ready (i.e. poor security, complex backend, no scalability, etc.) and are scrambling to find solutions while begging for my time. Also, lots of discussion and jostling and fear of what might happen when it goes live. No one can truly agree on the legal framework as well so feels like much work to be done.

Was also part of the implementation phase in the UK and the regulatory powers there definitely sped things up.

ipaddr
9 replies
2d

What is your mortgage amount and what is rate?

Say your mortgage is 300,000 and rate 5%. You would pay 15,000 in interest. Subtract from your total yearly payment say 25,000. You pay back 10,000 a year divide by 12 for months or payment period to get the amount.

j45
7 replies
1d23h

Canadian mortgages are a bit different than the US.

First, they renew their interest rates every 5 years over a 20-30-40 mortgage. Think of it as mandatory refinancing.

Unlike the US where a homeowner can lock in a low interest rate for a very long time.

guhidalg
6 replies
1d22h

That sounds terrifying. Do people just pay them off within quickly if interest rates rise?

mikem170
1 replies
1d22h

It would be terrifying for any bank to give people 30 thirty year loans at historically low interest rates (because of the interest rate risk - rates have nowhere to go but up, and the bank could easily be upside down for most of the loan), so the U.S. government subsidizes/backs most mortgages (fannie and freddie). This tends to increase the cost of housing while taxpayers are taking on the interest rate risk instead of the banks.

The U.S. is an anomaly with these loans. Most countries don't do this 30 year fixed low rate mortgages like the U.S. It simply doesn't make sense for lenders to underwrite long loans at low rates.

j45
0 replies
1d18h

Agreed, but technically, the loan is written at time of interest, and for that period it can provide a certain kind of stability in housing prices as well.

As 2008 taught us, other ways can come up to try and make money.

zo1
0 replies
1d11h

A lot of mortgages here in South Africa do this every three months. We have ce tral bank interest rates which are relatively stable (except recently), and mortgages are given out as a function of that rate (e.g. rate + 2.4%). After the central bank rate changes, at the next three month period they use the new rate to adjust your mortgage payments.

throw0101d
0 replies
1d21h

That sounds terrifying. Do people just pay them off within quickly if interest rates rise?

Variable rate mortgages were a better bet 88% of the time between 1950 and 2000:

* https://wowa.ca/static/fixed-vs-variable-study.pdf

Post-2000 variable did fairly well as well.

It's the recency bias of the last 1-2 years that have people really freaking out about it.

red-iron-pine
0 replies
1d3h

you're usually fixed to a specific payment during that 5 year term. you can't pay it faster without paying a penalty. the bank expects their profit of X and by God they're going to get it.

during the re-up you can throw down extra money, but that's because it's an open contract, essentially.

j45
0 replies
1d18h

Paying off mortgages quickly is often a topic, how much faster it happens compared to the US is another thing.

Typically, you decide on how you are going to approach the interest rate, and for how long. Owners can lock in for a fixed interest rate, or a variable rate that changes with prime. Term is most often 5 years, but latesly shorter or more flexible mortgages are more popular, sometimes between 2-4 years, and some folks who might take a risk on a 5+ year mortgage rate.

The variable rate mortgages out performed fixed rate mortgages for nearly 15-20 years. The tables turned in the past year or two.

prosaic-hacker
0 replies
2d

There is a twist in Canadian law regarding mortgages. Quoting from the page linked below. --- Canada’s Interest Act states the following about amortizing mortgages: “... the principal money and the rate of interest chargeable on that money, calculated yearly or half-yearly, not in advance.” --- This page does go into the detail a little more. https://wowa.ca/how-is-mortgage-interest-calculated

It may not be authoritative but you can start with https://laws-lois.justice.gc.ca/eng/acts/i-15/page-1.html which should be.

cperciva
7 replies
2d

FWIW, being off by 10s of dollars sounds to me like different ideas of how to count days. Banks sometimes use calendar days, sometimes business days, and sometimes a fictitious calendar with 12 months of 30 days each.

burnished
3 replies
1d21h

Yes, you'd call that the calendar convention if I remember correctly. The one you are referencing is called 30/360 for 30 days in a month, 360 days in a year.

MichaelZuo
2 replies
1d21h

Would different departments within a bank use different calendar conventions?

cperciva
0 replies
1d20h

Absolutely. Even within one department, since accounts often originated from different institutions.

burnished
0 replies
1d9h

Good question! I don't know, though it wouldn't surprise me if different products offered by the same bank used different calendar conventions. Calendar conventions are an accounting practice though, so different departments wouldn't interpret the same loan differently due to differing conventions.

fadesibert
1 replies
2d

BTW - the fictitious calendar is very often used in bond repayments - e.g. https://www.lawinsider.com/dictionary/bond-payment-dates

It has historically been used to allow for bonds to have uniform repayments across maturities (when the principal of a bond becomes due) - useful in the context of a bank wanting to hedge risks such as interest rate risk, repayment risk (if the bond is callable it can be paid back early, which means the bondholders have cash yielding ~0% instead of whatever the bond yield was)

Mortgages, though not traditional bonds (in that it's not a sophisticated company borrowing) are, depending on the jurisdiction, treated as bonds because they get packaged up and sold as bonds - the underlying bit of financial engineering that, after serious perversion, gave us the 2008 credit crisis

throw0101d
0 replies
1d22h

BTW - the fictitious calendar is very often used in bond repayments - e.g. https://www.lawinsider.com/dictionary/bond-payment-dates

Some sample calculations at:

* https://www.bondsavvy.com/bonds/accrued-interest-calculation

See also perhaps:

* https://www.investopedia.com/terms/d/daycount.asp

jbs769
0 replies
1d23h

Having been through this exercise as a former employee of a bank calculating this exact thing, this makes sense to me so is hopefully helpful for the poster.

MattGaiser
3 replies
2d

Anecdotally, the bank often cannot tell you how much. It has come up multiple times on /r/personalfinancecanada that the bank isn't really sure or generates a few different calculations. I also worked for a mid sized Canadian bank where the advisors couldn't consistently do it either.

bluefirebrand
1 replies
2d

If you're on a fixed rate mortgage it seems like this should be trivial...?

Variable rate throws it out of whack of course.

ponector
0 replies
1d23h

Having a mortgage with 3-months variable rate bank sends a new schedule everytime rate changes.

New schedule is calculated with new rate and consists of payments till the end of the term, with additional info about interest and principal amounts.

Same if you do additional payment into the principal - they will give you a new schedule.

mikepurvis
0 replies
2d

That seems odd given that you can walk into your branch any time and get a payout statement that will tell you a total outstanding number. The statement is valid for the next 30 days or whatever, and any fees or penalties are itemized on it— anyone who has paid off their mortgage due to either windfall or sale will have gone through this process.

rootusrootus
0 replies
1d23h

Is this something particular to how Canada does mortgages? In the US, a bog standard mortgage is 12 payments a year, with all interest for the month accruing on the 1st day of each month. It's pretty trivial to put that into Excel and use the IPMT function (and related ones like PMT) to spit out the interest being paid in a given month. It's always been dead-on accurate for me.

Maybe this is just one little upside of mortgage terms in the US being dictated mostly by the gov't through fannie mae and freddie mac.

j45
0 replies
1d23h

While open banking is on it's way in Canada it still might be a few years until the API is available.

Mortgage Calculators are sadly something that appear to need to be build by hand in Excel

humanlion87
0 replies
2d

I was in the same boat. I ran into similar discrepancies until I realized that I was not accounting for the number of days in the month correctly.

One option is to call the mortgage department and ask them to provide the split. When I asked the agent why I couldn't see it online, she mentioned their system is not setup to show this information. No idea why. Pretty frustrating.

franga2000
0 replies
1d23h

Also don't get me started that I can't use an api to get my account details and statements in Canada.

Can you do that anywhere else? Even under the EU's "open banking" system, this is basically impossible unless you use an intermediate that charges absurdly high fees, because they themselves had to pay hugr licensing and insurance fees to be granted access to the "open" APIs. The only other way is scraping, which I imagine is just as possible in Canada as everywhere else.

burnished
0 replies
1d21h

Are you using the correct date convention? That can cause small differences in both the duration of the interest accrual period as well as the daily interest rate for that period

If they aren't providing you complete information there is probably a Canadian authority you can reach out to, though you may just need to go higher up the food chain at your bank - accounting can be a little arcane and the people you are speaking to may simply not know.

That being said being off by tens of dollars is absurd, the error is likely in your calculations, and I feel it is their duty to make how they calculate your interest owed plain to you.

ape4
0 replies
1d22h

Apologies if you're already aware... In Canada you'll get an annual statement showing how much principal is paid off. So you can interpolate future payments from that. (Of course, it could be better)

abe_m
0 replies
1d21h

First of all: I fully agree with you. The calculation should be listed explicitly in the mortgage documents.

I've also struggled through figuring it out on my own, and the two things that got me to less than a dollar of difference were: 1) "Mortgage" in Canada is a specific legal term used for fixed term mortgages that compounds every 6 months. Therefore, to get your effective annual you take you have to convert it: ((1 + nom_rate/2)^2)-1 2) You then take your effective rate, divide by the days in the year to get your daily rate. You then take your daily rate, multiply it by your outstanding principle, and multiply it by the number of days since your last payment. That result is the amount of interest you pay, and the rest of your payment goes to pay down principle.

In practice, I have a monthly payment, and just divide my annual effective rate by 12, and call it close enough. The extra precision of daily vs monthly isn't worth the extra complexity in the spreadsheet.

akira2501
8 replies
1d20h

It's a shame that we don't have open formulas in code form published by the government.

I completely disagree. Then you're just handing them a mechanism to make this as complicated as they possibly can. Taxes should be simple enough to be fully understood by the people paying them.

I'm not some algorithmic tool for the government to abuse when it's failed to balance it's budgets and I should not _need_ software to figure out something so basic as a deduction in wages.

doing this by hand is quite painful and error-prone.

It's a shame there isn't a law forcing the government to make this possible.

ibejoeb
5 replies
1d20h

I don't understand what you mean. You're beholden to the law regardless of whether you understand it. The government ought to be required to create a reference implementation if for no purpose other than to prove that it is indeed possible to implement.

phpisthebest
3 replies
1d20h

the government should be barred from implementing a law or regulation that requires "reference implementation " to prove it is "possible to implement"

If it needs such a thing it is too complex and should be repealed

crote
1 replies
1d20h

Over in The Netherlands we're seeing the opposite happen. Seemingly trivial laws are getting rejected because the responsible Ministry considers it "too difficult". In reality it's most likely just politically inconvenient.

For example, it was deemed "impossible" to adjust student loan interest rates, because the software would take two years to modify. Either they are completely incompetent, or they are deliberately lying for political reasons.

So yeah, refusing a law because it is "too complex" won't work either.

rocqua
0 replies
1d10h

Lots of our dutch bureaucracies have comprehensively failed and are barely treading water. There is no capacity to do the current job, let alone any new changes.

The only way out is by accepting that the current state is unacceptable, and working on a long and slow fix, during which we don't say "this is unacceptable therefore we require immediate changes". This will fuck people over. But not making those changes properly will fuck people over even more.

We might be on an administrative brink. That takes a radical approach to fix.

ibejoeb
0 replies
1d20h

OK, well, in spirit I can see how that sentiment arises. For practical purposes, though, no matter how simple a calculation, if a government requires that I do it, I want to see precisely what it's demanding. It is unreasonable to be put in the position of guessing.

ohthehugemanate
0 replies
1d14h

You are speaking about different objectives. Quite apart from the basic "(how) does it work logically" which published formulas address, simplicity can be an objective in itself.

For example, Germany has one of the most complex income tax codes in the world, with an average compliance burden of 136 hours[1]. That's a hit to national competitiveness and GDP, and worth addressing in its own right.

[1] https://taxfoundation.org/blog/germany-tax-g7/

lozenge
0 replies
1d20h

Ah yes, because the current system is incentivising them to keep it simple... otherwise we'll vote for the simple taxes party... which party is that again?

gorky1
0 replies
1d20h

You're right, and it's extremely hard to undo.

Once you have that complexity, you'll always be taking away something from somebody by simplifying.

So all simplifications end up as additional "if" clauses, defeating the purpose.

patrickmay
4 replies
1d23h

All laws should be expressed in code. It would quickly show how many either conflict with each other or are incoherent.

mcmoor
1 replies
1d15h

And then there's other comments here that mocks people who think law as code hence you can cheat/glitch through it. They say law in the end is run by humans and there's something called "intent" that will still catch you. Tbf I lean more to law as code side myself and this intent thing sounds like arbitrary enforcement.

rocqua
0 replies
1d10h

Arbitrary enforcement is a requirement for fair laws. It's why the quality of judges matters.

penguin_booze
0 replies
1d23h

This exists, but I haven't dug deep enough to know better: https://github.com/CatalaLang/catala.

kelseyfrog
0 replies
1d20h

It wouldn't even work if the universe was expressed as data.

Unfortunately there will be an input layer that requires predicates or measurements that cannot avoid ambiguity.

Ignoring that, there's Godel's Incomplete Theorem to deliver the final blow. If integer arithmetic cannot be complete and consistent, a set of laws governing society has no hope. If you disagree, you'd at least have to admit that such a set of laws could not include integer arithmetic, and could certainly be no more complex than integer arithmetic. I'd posit that such a restriction renders such a project impossible.

We've chosen completeness (every action can be rendered legal or illegal) over consistency. The alternative - consistency - would make some actions legally undecidable.

j45
4 replies
1d23h

It could be a github repo.

There are likely some digital government projects and software providers who's software might be a good fit for this kind of thing.

yard2010
1 replies
1d23h

Why stop there, one monorepo could hold all the laws and receive PRs from the ppl, cutting down the middle man (politicians) leaving just the bureaucracy

j45
0 replies
1d18h

This is a joke - I doubt it will work, fewer people to fight over interpretations :)

I remember in my pursuit of learning about change management and digital transformation, someone tried to explain that too many bureaucracies ultimately have one goal - to ensure their survival at any cost. Maybe not so different than politicians in that way.

brailsafe
1 replies
1d23h

It's worth noting that the Government of Canada and various other gov orgs do have GitHub repos where they already host a variety of algorithms, configs, the design system, and a few others, so it would be good to add something like this.

https://github.com/canada-ca https://github.com/statcan

The Bank of Canada even has one where they host various economic models

https://github.com/bankofcanada

j45
0 replies
1d18h

This is nice to see and learn about!

layer8
1 replies
1d22h

Germany has been publishing standardized flowcharts with named variables and formulas for payroll calculation for a long time (at least since the 1970s — hence the notation employed): https://www.bundesfinanzministerium.de/Content/DE/Downloads/...

gorky1
0 replies
1d21h

That's very cool, but that's taxes only.

For social security, you have to get certified by a completely different set of bureaucrats with partially incompatible requirements:

https://gkv-ag.de/

The simplifications, they are additional! (Usually.)

amomchilov
0 replies
1d13h

The French invented their own DSL for their taxes: https://github.com/MLanguage/mlang

Galanwe
0 replies
1d23h

The issue is too pervasive, having a formula published won't solve it.

You will need the historical formulas, as well as all the underlying data, not even accounting for the publication delays and errors, missing informations, discretionary classifications, etc.

What we need is all that data and code in an introspectable flow of code and data:

<downvote>a blockchain, containing both your data and the smart contract used to perform the computations</downvote>.

FpUser
0 replies
1d23h

Same here. I just take the form

rsaz
17 replies
2d1h

Are there any countries with good, reasonable tax systems? I'm only familiar with Canada and the USA, both of which are a bit of a mess, though seemingly in different ways. I'd be very interested in hearing what the process is like in other places.

jqpabc123
8 replies
2d1h

The EU has VAT (value added tax) which is added to each purchase.

At the end of the year, there is nothing to report and nothing to pay.

It doesn't get much simpler than this.

koliber
3 replies
2d1h

The original post is about income tax. While VAT is a tax, it is not an income tax.

jqpabc123
2 replies
2d

The post I responded to asked:

     Are there any countries with good, reasonable tax systems?
VAT is a reasonable alternative to income taxes but neither the question nor my response ever specified "income".

xav0989
0 replies
1d18h

Many places, Canada included, have both a VAT-like sales tax and an income tax.

ska
0 replies
1d19h

Most places a VAT is not instead of income tax but instead of sales tax. Do you know of anywhere with VAT but no income tax?

aftbit
2 replies
2d

The EU doesn't have income tax? I think that's false.

jqpabc123
1 replies
2d

Neither the question nor my response ever specified "income".

aftbit
0 replies
1d22h

At the end of the year, there is nothing to report and nothing to pay.

That is what I was reacting to. You still need to file taxes in the EU right? I know they have streamlined it a lot in most countries, but there is indeed something to report, no?

Fidelix
0 replies
2d

Not even remotely correct.

Each country in the EU has different income tax systems and other types of tax. VAT is just one aspect that generally doesn't cover even half of the tax burden.

OP is talking about the overall tax system.

dkga
1 replies
2d1h

Switzerland tax law is pretty straightforward and the cantonal (local government) tax authorities are known for being very helpful in explaining things to taxpayers in doubt, an experience I had more than once.

bradley13
0 replies
2d1h

I dunno, the sheer size of our personal (Swiss) tax return is daunting - and we are pretty ordinary. Maybe not as insane as the US, but "simple" would be different.

xnorswap
0 replies
2d

Depends on your circumstances. The UK seems reasonable for most.

For the employed, you let your employer worry about it. You might occasionally get given a "tax code" which essentially equates to your tax free allowance. If that happens you just let your employer know and they'll sort it, and you can confirm by checking your payslip.

If you're determined to have over or underpaid tax (e.g. your income went down unexpectedly), your tax code for the following year will be adjusted so that you'll end up clawing back the money over time.

Unless you are self employed or have special circumstances, then you'll avoid having to file a "self assessment" form.

And to be clear, the "special circumstances" are nothing like the US' system of hundreds of different "deductions".

Even if you do have to fill in a self assessment form, you can do so with an online form, which actually takes into account answers rather than making you manually have to do things such as "Skip section 5 if you have put a number of in section 4b or a number less than 3340 in section 2a" that the US forms love to make you do.

Filing my US taxes is literally 99% of all paperwork I have to do each year, and I don't even earn enough to actually have to pay anything. Yet I still have to calculate everything, then write down the right numbers in the "foreign earned income exclusion" boxes, then tally it all up to make sure it's still zero, then make sure I've copied the right numbers to the right boxes and haven't mistakenly transposed any numbers, then copy those zeroes down to the right boxes through the rest of the 1040.

The UK has had this system for decades, it has had online tax filing since 3 July 2000. It's had PAYE (pay as you earn tax, i.e. tax deduction at source) since 1944.

The UK feels stagnant as heck, so I wouldn't recommend people actually move here, but its tax system is trivial to the point of ignorable if you're employed.

swamp_donkey
0 replies
2d

I’ve filed a few returns in new zealand and it seemed pretty simple, I was a simple case though

sira04
0 replies
2d

The Faroe Islands have the best one according to this article I read recently https://prospect.org/world/best-tax-system-on-earth-faroe-is...

pzduniak
0 replies
2d

In Poland there are some complexities when you run a company / employ, but as an employee it's relatively straightforward UX where you click through a government-operated "income tax fillings wizard" and either just OK a pre-filled declaration or add a couple missing items. Paper filling is a bit more complicated, but I think you can get help at the tax office to get 1 or 2 forms sorted out.

For self-employment I send 2 documents per month regarding my expenses (which is somewhat easy if you understand the rules), plus one or two summaries per year. Hiring is a bit more complicated, I only file simplified declarations for employing private people as contractors. Otherwise I'm pretty much a worst case scenario as I file 7 different yearly declarations covering most possible sources of income defined in the law. It's not that bad, but it could be better.

Running a company can be practically automated with an online accounting SaaS, including payroll. Laws tend to be relatively understandable and there isn't much complicated math. Most of the recent confusion was around shitty laws poorly implemented and then partially reverted by our previous government. I did not enjoy that, but there were some decent online writeups explaining how to proceed.

michael1999
0 replies
2d

Not sure what good means. Nobody likes to pay tax.

If you mean legible, common-law taxation is going to be messy by nature. Civil-law jurisdictions will be more legible. France has published formulas for theirs.

If you mean simple, Estonia deliberately chose a simplified foundation for their post-Soviet era -- a tripod of land-value tax (not a property tax); flat income tax with some basic deductions; and VAT. They are new enough that exceptions are probably modest. https://en.wikipedia.org/wiki/Taxation_in_Estonia

Tade0
0 replies
2d

I can give you a primer on the system for independent contractors in Poland:

-Flat minimal monthly pension contribution either filed as a business expense or just deducted from gross income - subtly different, but functionally the same as long as you have income. Calculated as the pension contribution of someone making 60% of the average wage - the exact number is published on an annual basis.

-Income tax: every January you can select one of several schemes:

1. Two brackets - 17% and 32% with the first 30k PLN ($7k USD) tax-free and ability to file taxes together as a married couple, in which case you effectively average out your and your spouse's incomes and pay taxes accordingly.

2. 19% flat rate, no tax-free range, no rules like for marriages.

3. 12% flat rate, mostly same as 2., except on top of that you can't file business expenses. There a few different rates in this scheme, but IT generally falls under the group charged 12%.

Healthcare contributions depend on tax scheme chosen above and are calculated as a percentage of gross income from the previous month minus deductions and expenses.

1. - 9%, 2. - 4,9%, 3. - 3%.

That is mostly it. Regular employees have more complicated rules with employer contributions on top of gross income and small deductions like for living sufficiently far from the workplace, having an internet connection and whatnot, but they don't add up to much.

faustocarva
14 replies
2d1h

"except anyone resident in Quebec, Nova Scotia, Yukon, or Ontario"...it is essentially 75% of Canada!

munk-a
9 replies
2d1h

Quebec is essentially a different country altogether - there are a legion of strange HR rules and requirements that are entirely specific to QC.

tharmas
8 replies
2d

Yes, and heavily subsidized by other parts of Canada via transfer payments.

munk-a
7 replies
2d

Well transfer payments are a lot more complicated than some folks would have you believe - Canada as a nation benefits from all our parts being within a common business zone so while some areas are mineral rich other areas have strong service economies that have needed help through the pandemic.

switchbak
5 replies
2d

"Needed help" because the powers of the day decided to lock down the economy far past any reasonable length of time. I suppose if I quit my job I "need help" feeding myself too.

Another example is Quebec sitting on a gargantuan natural gas reserve, but preferring to keep it in the ground because it's more advantageous to simply receive payments from other provinces (Alberta). Carbon/emission considerations aside, this shows just how broken the incentive structure is for equalization payments between provinces.

But that's just the tip of the iceberg as far as Canadian governmental issues go, and it's hard to know where to start improving things.

p_j_w
4 replies
1d23h

Carbon/emission considerations aside

This seems like a massive thing to just throw aside.

cmrdporcupine
2 replies
1d22h

He's also neglecting to mention what a mammoth hydroelectric powerhouse Quebec is, because of that, they have a giant surplus of electricity that makes their utility bills extremely cheap relative to anywhere else in North America, helps manufacturing businesses and gives them the ability to export power, to boot.

Meanwhile Alberta burns (and leaks) natural gas and coal and gripes because the rest of the country is punishing them for it, and complains to high heaven that we're not making new markets for them (or others) to burn and leak more of it.

Quebec and Ontario have prioritized manufacturing over resource extraction, and that benefits their population.

CarRamrod
1 replies
1d19h

Well, if Quebec is the economic powerhouse you claim it is, then surely they will be just fine if the equalization payments stop, right?

xav0989
0 replies
1d17h

The whole point of the equalization payments is to level the playing field regarding the budget of provinces. The formula has to do with the amount of provincial taxation that a province charges its residents versus the rest of Canada. Given that the Quebec income taxes are higher, the province receives transfer payments. Some of the Federal income tax that Quebec residents pay ends up going to the province, so it's not just coming out of the income tax of non-quebec residents.

switchbak
0 replies
22h25m

Sure, but I'm talking specifically about incentives here. If it wasn't for the inverted incentive structure that benefits them (also from fossil fuels, but that money comes from Alberta), I'm sure they'd be more than willing to extract that resource.

tharmas
0 replies
31m

Canada as a nation benefits from all our parts being within a common business zone

But there is no Free Trade between Provinces (Inter-Provincial Trade). Canadian Provinces have more Free Trade with the USA and Mexico than they do with each other. Canada isn't really a country in the economic sense. And aren't there restrictions on professions like Engineers and Nurses such that you can't just pick up sticks and go to work in another Province? There's bureaucratic paperwork to fill out before you are good to go.

cperciva
3 replies
2d1h

To be fair, Nova Scotia, Yukon, and Ontario each only add a handful of extra nodes. I just didn't want to bother with those because I'm in BC.

Quebec is a different matter; far more complicated to calculate payroll deductions for there.

cmrdporcupine
2 replies
2d1h

And if the crazy proposal from the UCP in Alberta to divorce from the CPP and have their own pension system (like Quebec) is successful, it will get even crazier.

Imagine the complications of moving back and forth between provinces. Or seasonal work, etc.

cperciva
1 replies
2d1h

There's several pages of formulas for dealing with people moving between CPP and QPP. So glad I don't have to deal with those.

cmrdporcupine
0 replies
2d1h

I was born in Alberta and lived there for the first 24ish years of my life, I didn't contribute much when I was there, but it would be something. I shudder to imagine the complications of trying to claim the amounts from that once I retire -- if that proposal happens. Pure insanity.

sdwvit
13 replies
2d1h

Props to the author. At this point, CRA should just post a reference implementation of all the formulas, so that small businesses can benefit from it.

betaby
5 replies
2d1h

They won't. They have no mandate to provide a clear answer.

cmrdporcupine
3 replies
1d22h

Honestly, I've always found CRA friendly, competent, and responsive.

But, I also don't run a small business, and am just a tax payer. Though when I had a small consultancy and corporation they were also actually fine to deal with.

betaby
2 replies
1d15h

Do you have kids? If so, did you try to deduct extracurricular activities? I did and was audited, also 100% of my friends were audited for the kids related deductions. Anecdata of course. Also I find Canadian personal taxes are way too complicated. I can think only of Italy where allegedly personal taxes even more complex.

nayuki
0 replies
1d11h

You're throwing around the word "audit" far too casually. In all likeliness, you and your friends were not audited. The CRA probably asked you to submit supporting documents such as receipts and other written records to prove your claim, as you are legally required to do.

An audit is much more severe and generally involves an in-person interaction and seriously combing through all your accounts and transactions. https://www.canada.ca/en/revenue-agency/services/forms-publi... , https://www.bnnbloomberg.ca/what-s-the-difference-between-a-...

cmrdporcupine
0 replies
1d14h

I used to do those deductions for my kids, yep. Never had a problem.

I seem to recall from the last 4 or 5 filings that those deductions are gone now. The only thing I had to do each year was figure out the capital gains on my RSUs (in USD, so a bit fiddly). And now this year I have nothing like that, so it's just "here's my RRSP contributions, and yes, those T4s look like mine, confirmed, ok bye"

j45
0 replies
1d23h

Bureaucracies gotta bureaucracize.

cperciva
4 replies
2d1h

It would be very nice if they would publish a libreoffice spreadsheet, yes.

Heck, it would be very nice if they would create a libreoffice spreadsheet, even if they don't publish it. If they had to read their own document, it would probably be far better written.

derefr
3 replies
2d

If they had to read their own document, it would probably be far better written.

Perhaps not; I've always had a strong impression, whenever reading documents derived from tax policy, that the "architecture" of such documents is the way it is mainly for maintainability.

Which is to say: the effective tax code at any given moment, is the emergent result of the interactions of all the current tax laws on the books. And there are many such laws. And those individual laws can be updated or repealed; and new laws can also come in that, through a few simple statements, make sweeping changes to the meanings of other laws.

As such, the tax-filing instructions, ideally, have to be constructed in such a way that they cope efficiently with someone being able to pull a single jenga-block out of the tower that is tax law, that topples over a whole slew of other instructions and definitions. The team of tax lawyers and technical writers that maintain the instructions should not have to sit down and rewrite every instruction on every schedule/form, just because one of the core definitions changes. Because that's gonna happen a lot! Every year, even!

If I was in charge of a team of (automation-minded) lawyers and technical writers maintaining the tax-filing instruction repository, I'd probably, ideally, want to factor out the instructions into separate modular files per law — with each file acting as a sort of Aspect-Oriented equivalent of Javadoc. (Or, actually, something very much like Inform 7. See e.g. https://i7-examples.github.io/Bronze/source_1.html)

So you'd see:

• Paragraphs that interpolate definitions as constants from other laws' modules;

• paragraphs that have implicit AOP hooks for other laws' modules to inject additional language into;

• the ability of a law to override specific sentences or wording of the language of the laws so far;

...and so forth.

This would be hell to read, but it'd sure make the job of dealing with changes in the law easy. (And it wouldn't be something you'd really read anyway — more often, it'd be something you'd carefully poke at, while watching the compiled result change live in a split pane. Like writing LaTeX in LyX.)

---

To be clear, I don't imagine that any existing set of tax-form language is actually maintained using some weird AOP DSL.

Rather, I imagine that the maintainers are manually doing the same business process that use of such an AOP DSL would formalize.

They're maintaining a very non-intuitive "storage architecture" for all the instructions that go into these forms, to minimize re-working when the law changes; and then — mostly manually, but maybe with a bit of Excel — collating them together into new schedules and forms each year.

And it's that "storage architecture" — despite not being something as rigid as source code — that still nevertheless forces the language of the instructions into the form you see at tax-filing time, with the weird grammatical shapes, the distant definitions, etc.

j45
0 replies
1d23h

I hadn't considered maintainability as something to consider in this area - appreciate the deep dive.

The saying bureaucracy can't help but beget bureaucracy is another thing that comes to mind.

hoosieree
0 replies
1d23h

Real life is imperative, dynamically scoped, all global variables, and every instruction contains an implicit branch.

btilly
0 replies
2d

I have a simpler theory.

The law is the way it is because of the influence of lobbyists. Those lobbyists include lobbyists for companies that do things like payroll. They would like the system to be complex to provide a regulatory moat that keeps other businesses from competing with them. And by siding with this or that special interest that cares about their piece more than how sensible the whole is, the law is easy to turn into a mess.

ska
0 replies
2d

Another comment pointed to this web form: https://news.ycombinator.com/item?id=38843556

It’s not a downloadable sheet , looks like, but it’s something.

rozap
0 replies
1d23h

Why would they do that? If it's all out there in the open, then everyone can find bugs/issues and then they'd have to deal with them.

Also they'd probably lose a lot of revenue they collect from fines.

Personal anecdote about how you don't fuck with the CRA. Back in college in I got "free" room and board for year because I was a resident advisor. When I, an idiot 20 year old, filed my taxes, I did them wrong and under reported by around 1k. First time doing Canadian taxes as a US citizen. A few years later I got a fine for around $5500, which was a huge sum for a college kid working part time. Turns out BC can match the fine levied by the CRA. In hindsight, I would have been better off just not having that job - I think I would have come out ahead. For the rest of the time I lived in Canada I hired a CPA.

The IRS is warm and fuzzy by comparison. At least if you screw up, the fine is proportional to the amount you under report. (unless you're super rich...but that's a different thing)

narrator
12 replies
2d1h

Being someone who has some experience with tax law, the cycle of tax complexity goes like this:

1. Tax law is passed.

2. Really smart CPAs and Tax Lawyers figure out ways to legally avoid paying taxes.

3. Tax people issue regulations intended to close those loopholes.

4. Administrations change and they want to win votes and tweak the economy so they lower some taxes and add tax breaks.

5. New administration comes in and selectively reverses previous administration's program because of politics.

6. If the tax is international tax, then add really smart tax lawyer doing multi-jurisdictional tricks to lower taxes (e.g Double Irish With a Dutch Sandwich[1]) , governments trying to encourage multi-nationals to do business there by adding incentives to their tax code, the OECD coming in and trying to standardize tax stuff across jurisdictions to prevent this, individual pairs of countries doing tax treaties with each other, etc.

[1] https://www.investopedia.com/terms/d/double-irish-with-a-dut...

cperciva
8 replies
2d1h

None of this complexity is from trying to plug tax loopholes. Most of it is from politicians wanting to name things.

For example, for decades Canada has had a "personal amount" tax credit -- for arcane reasons, rather than saying "the first $X of income isn't taxed", the lowest tax bracket starts at $0 but there's a non-refundable credit equal to the lowest tax rate times $X. Then a politician came along and said "we should increase the personal amount so that people can earn more money without paying taxes... but we don't want to decrease taxes on the top 1%". So now we have a "personal amount" which depends on your income. Similarly, in BC we have the "BC Tax Reduction" which is an extra tax credit given to people with incomes between (roughly) $22k and $36k.

Both of those examples could have simply been implemented as tax brackets but voters get far more excited about a "Tax Reduction" than they do about a new tax bracket.

jessriedel
5 replies
1d23h

None of this complexity is from trying to plug tax loopholes. Most of it is from politicians wanting to name things.

The effect you describe is very real, but "loop hole closure" is certainly a source of complexity too, e.g., the US's insane alternative minimum tax (AMT), which nearly duplicates the amount of tax work to be done by insisting you compute your taxes under a second set of assumptions. The idea was to make sure people who were using "loopholes" (or just like, reasonable features of the tax system) to pay at least above a certain amount.

Of course, the sane solution would have been to choose tax policies that combine together reasonably. As always, loopholes (in the sense of "unjustly low" amounts of tax) are much more likely to be created rather than fixed by complexity.

TimPC
4 replies
1d21h

AMT is also completely insane when it interacts with legitimate deductions and deferrals that aren't loopholes. For instance stock options from start-ups for stock that can't yet be sold.

quink
3 replies
1d17h

Ah, yes, what a horrible, awful burden the... consults notes... top 0.4% of taxpayers in the richest country on the planet are being asked to live with.

I'll go find a tiny violin so I may weep for them.

Edit: Hang on. I was wrong, I apologise. It would be a subset of those 0.4%. Now I'll have to find an even tinier violin.

Edit 2: Investopedia says "The AMT is charged when you exercise your ISOs, hold on to your shares, and sell them after the calendar year in which they were awarded to you." OK, TimPC, can you just straight up tell me what size violin I should be aiming for?

cbsmith
0 replies
1d16h

I think it's 0.1% of house holds, but it's not strictly the top 0.4% who are impacted. The more you make, the more likely it is that you are impacted, but your household income can be just a couple hundred thousand a year and you could be impacted.

amarshall
0 replies
1d14h

Investopedia is misleading. AMT applies unless they were exercised and sold within the same tax year. AMT thus applies to the vast majority of pre-IPO ISO exercises. Many of those people are not in the top 0.4% incomes (I assume that’s what you meant). Further, this specific AMT scenario is taxing unrealizable gains, since the asset is effectively unsellable.

TimPC
0 replies
1d3h

Regardless of whom it applies to, the situation is deeply unfair. I get that the left is fine with being unfair to the rich and doesn't care at all about writing bad policy anymore as long as the victims of the bad policy are not their in-group but for those of us who aren't radicals and do actually care the situation is concerning.

Investopedia is misleading because the tax event occurs before the sale. You don't pay AMT in the year you sell you pay AMT in the year you exercise. With RSUs for example, the default behaviour is a portion of your stock is instantly sold to pay the tax and if you want to you can override this and pay the tax through other means. But with Stock Options in a company that is not yet traded you aren't able to do that. The government is unwilling to take shares as well. Instead you pay AMT based on a fictional VC valuation. This means a software engineer who started early at a company and got a 1% stock package in a company that grows to $100 million can only exercise their stock options if they pay taxes on the $1 million in stock. That's a crazy expense that isn't in any way fair or reasonable, and can lead to people forfeiting their stock options entirely since the stock itself pays for $0 of this expense.

s: I'm sure the left is happy with the outcome that engineers in the top 5% of incomes forfeit a bunch of money to investors in the top 0.01% of incomes. /s

p_j_w
1 replies
1d23h

Both of those examples could have simply been implemented as tax brackets but voters get far more excited about a "Tax Reduction" than they do about a new tax bracket.

Doesn't sound like the problem is entirely on the politicians here.

int_19h
0 replies
1d15h

The temptation of populist pandering is always there, but the whole point of representative democracy is (supposedly) that politicians can resist it and do the right thing regardless.

phpisthebest
1 replies
1d20h

I have a problem with calling explicit exemptions, call outs, and other things as "loop holes" as if they were no intended to be used to avoid taxation.

This is simply incorrect, organizations, people, and groups all lobby the government to include their pet line item as an exemption, deduction, or credit.

These are not "loop holes" and a CPA or tax lawyer having the knowledge to fully utilize all of them is not " legally avoid paying taxes" as those taxes where not owed in the first place.

In order to get to the point where paying the correct amount of taxes you owe by law is "using loophole to avoid taxes" one has to assume 100% of all income is belongs to the government and we are just figuring out how much the government is going to allow us to keep. I reject that

amarshall
0 replies
1d14h

Loopholes exploit ambiguity or complexity in rules in ways that betray the authors’ intent. Following this definition, there’s no need to conclude that “100% of all income belongs to the government”.

pembrook
0 replies
1d7h

You could stop all of this at Step 1 by just having a flat tax. On everything. The loopholes only exist due to the unnecessary complexity of tax laws.

Preferential treatment for investments over labor? No. Preferential treatment for real estate? No. Preferential treatment for corporations over people? No. Preferential treatment for 3-legged nymphs who live in a flood zone? No. …Etc.

Then the market would be free to allocate human efforts to those which provide the most value.

The amount of human productivity wasted over this topic is insane. Millions of people devoted to creating complex riddles and then disentangling and/or manipulating those riddles—-with zero proof there’s any beneficial outcome from said complexity.

orzig
11 replies
2d

I'm in the US but I'll say for sure that things like this are about half the reason I haven't hired any employees for my LLC. I wish I could, but I'd be de facto hiring an accountant as well!

jweir
2 replies
2d

If you are considering hiring and the hire is a developer or at all involved in research and experimentation make sure you are well versed in Section 174.

You could be on the hook for a large tax bill since you have to write off developer expenses over 5 years – this is true whether an employee or contractor.

Hopefully it will be repealed* – but if not it is one of those things that no one would expect to exist since it is in the words of Senator Wyden "stupid."

https://www.law.cornell.edu/uscode/text/26/174

* edit It won't be repealed but a law can be created to ignored it until a future date. Once on the books, because of accounting, it is very hard to remove a tax law.

shutupnerd0000
1 replies
2d

My guy, you're replying to someone that said theyre not considering hiring

orzig
0 replies
2d

That's fine, I appreciate it! We're all conversing in public, and I'm sure it will be useful to someone.

And besides, this information makes me even more happy with an opinion I already have - isn't that what the internet is for?

IG_Semmelweiss
2 replies
2d

If you ever consider to, *given the remote work trends*, consider this:

I'd place high importance on the employee state to the state you are hiring them out of.

Some states are a nightmare to deal with. For example, NJ, CA, NY and OH. Once you are registered in X state, your company is fair game to be pursued for any kind of perceived (lack of) compliance by that state, long after that employee has left you for another job. For example, you could earn a large fine for not filing to report you have no staff in the state.

States that I found were lovely to deal with were ID, TN, and TX.

Generally speaking, its highly recommendable to hire employees from your state only for this reason. I would not hire unless you are absolutely needing to.

pnw
0 replies
1d23h

I got a notice for unpaid back taxes from some state agency in California for a company that had been sold over a decade earlier, merely because we had one part-time employee in California for a few months.

newZWhoDis
0 replies
1d22h

This. I never hire anyone from NY or CA out of principle.

pnw
0 replies
1d23h

This is why PEO's like Justworks are great IMHO. You can offer the big company benefits experience without getting ground to dust by federal/state/local regulations. I can't imagine going back to the old way at any small company.

pcthrowaway
0 replies
1d23h

If the issue is figuring out payroll (rather than accounting complexities that arise from having additional expenses), you can also hire via remote.com or deel.com, even if hiring domestically, as long as your employee is either salaried or operating as an independent contractor (not actually an employee in that situation though)

Employers of record ensure compliance with all local laws and basically just bill you the employee's fully loaded cost, plus their service fee

jjeaff
0 replies
1d23h

As far as calculating payroll and remitting payments to the proper agencies federally and in their respective states, that shouldn't be a hindrance at all. There are countless payroll service companies that will do all the calculations and remittances for $30-$50 a month per employee. You definitely don't need an accountant for regular payroll.

hn_throwaway_99
0 replies
1d23h

Like another comment said, there are reasons payroll companies exist, and these days there are tons of services that make this easy to do, compliantly. E.g. there is a good reason like the majority of small/medium-ish sized business I know use Gusto because they make it really easy to add contractors or employees (and I'm not specifically pitching Gusto, there are a lot of competitors you can search for). While these products aren't free, the benefit of their SaaS model is that it's a per-employee cost that can grow with you.

danjc
0 replies
1d23h

Doesn't a PEO like ADP make this a lot easier?

maelito
11 replies
2d1h

In France, these rules are available as a website, an API, a NPM package, and raw rules in the https://publi.codes language.

https://mon-entreprise.urssaf.fr/développeur

spydum
6 replies
2d1h

thats pretty cool, I wonder though what the implication is if there is a bug or package hijacking? Are you expected to cross check the calculations and they are only offered as a convenience, and not authoritative?

cbarrick
3 replies
2d1h

The formulas are published in a programming language called M. There is an open source implementation [1].

There is currently no legal guarantee of any kind about the correctness of the code produced by the Mlang compiler, or by the results produced by the interpreter of Mlang. However, authors have been in contact with DGFiP to validate Mlang, and the system passes all the private DGFiP tests as of Sept. 2022 for the version of the source files responsible for computing the tax on the 2018, 2019, 2020 and 2021 income.

[1] https://github.com/MLanguage/mlang

adolph
1 replies
2d

MLanguage in this context is not M, aka MUMPS.

MUMPS ("Massachusetts General Hospital Utility Multi-Programming System"), or M, is an imperative, high-level programming language with an integrated transaction processing key–value database. It was originally developed at Massachusetts General Hospital for managing hospital laboratory information systems.

https://en.wikipedia.org/wiki/MUMPS

mattgrice
0 replies
1d21h

Useful comment. Unfortunately M or MUMPS is still in active use at EPIC, etc. Far too many good grads of midwest schools get sucked into working for EPIC or the insurance mines in Des Moines, Omaha, etc. UW Madison, UIUC, and Michigan are way too good of schools to be sending their grads to work on medical records or insurance.

maelito
0 replies
1d19h

No it's not. M is a very old programming language created by "Bercy", for the "Impôt sur le Revenu".

Mon-entreprise is coded in publi.codes, a more recent language.

Mon-entreprise is focused on the social contributions (payroll), subject of OP.

MrPatan
1 replies
2d

Do you also worry that rogue employees or literally anybody with the keys to the office of a printer could have been changing the texts of laws as printed in official publications and books for the past few hundred years?

If not, why not?

spydum
0 replies
1d20h

Way? I thought the op was saying the French government published the code. Totally different if not.

woobar
1 replies
1d19h

Is this a toy? I get this warning on the English version of that website:

"Calculations are indicative. They are not a substitute for actual statements from Urssaf, the tax authorities or any other organization."

[1] https://mycompanyinfrance.urssaf.fr/developer/iframe?module=...

maelito
0 replies
1d19h

The code of this relatively recent project wasn't promoted (yet ?) as the internal official closed-source calculator.

simonw
0 replies
2d

Here's that NPM package: https://www.npmjs.com/package/modele-social and https://github.com/betagouv/mon-entreprise

This is incredible. I absolutely love the idea of official, government-supported machine readable versions of these kinds of rules.

ingenika
0 replies
2d
nampas
9 replies
2d1h

That's funny, I made something similar a few years ago for the IRS

https://nampas.github.io/tax-map/

mmsc
3 replies
2d1h

Very very cool. Is there a word for a directional graph in this circular form? Also, is every edge unidirectional, or are there some bidirectional edges? I would hope (and assume) there's nothing bidirectional, but...

chipaca
1 replies
2d1h

From the looks of it that's been generated by `circo`, which is part of GraphViz and describes itself as a “filter for circular layout of graphs” and

       circo  draws graphs using a circular layout (see Six and Tollis, GD '99
       and ALENEX '99, and Kaufmann and Wiese, GD '02.)  The  tool  identifies
       biconnected  components  and draws the nodes of the component on a cir‐
       cle. The block‐cutpoint tree is then laid out using a recursive  radial
       algorithm.  Edge  crossings within a circle are minimized by placing as
       many edges on the circle's perimeter as possible.   In  particular,  if
       the  component is outerplanar, the component will have a planar layout.
       If a node belongs to multiple non‐trivial biconnected  components,  the
       layout puts the node in one of them. By default, this is the first non‐
       trivial component found in the search from the root component.

mmsc
0 replies
2d

Doing a bit more digging, it's using cytoscape[0] which is similar to graphviz. If you search your favorite search engine with "Cytoscape Session Viewer", you'll find many websites displaying the same type of graphs (select layout: circle).

FYI, circo doesn't always output a circle. I recently created https://github.com/MegaManSec/SSH-Snake/blob/main/tools/SSH-... using circo.

[0] https://cytoscape.org/

Pathogen-David
0 replies
2d

You can generate them using Graphviz's circo layout engine. https://graphviz.org/docs/layouts/circo/

According to them/Wikipedia, the layout's name is simply "circular layout". https://en.wikipedia.org/wiki/Circular_layout

tantalor
2 replies
2d1h

This is the worst version of Planarity I've ever seen, congrats.

fragmede
1 replies
1d22h

For those that haven't played it, Planarity is a graph untangling game.

https://www.jasondavies.com/planarity/

tantalor
0 replies
1d2h

This version is really good

tamimio
0 replies
1d17h

Yet the economy is in debt with trillions

mp05
0 replies
2d1h

Dear lord, that's frightening.

transcriptase
5 replies
2d1h

The fun part about being Canadian is that you get to compete with the entire world for remote jobs with Canadian companies, but no company based outside of Canada wants to deal with hoops required to hire a remote employee based in Canada if they don’t already have a presence here.

funksta
1 replies
2d

Try finding work as a sole proprietor contractor, remotely for a US company. It's cheaper for them vs hiring an in-office employee, and with higher US tech salaries and currency conversion, you'll generally come out ahead too

j45
0 replies
1d23h

A foreign company doesn't need to make it easy to hire an employee who is a Canadian.

If there is an advantage to a Canadian to be employed from a foreign company, it's maybe a bit more up to them if they want to do a bit to stand out a lot.

A single person corporation in Canada akin to a professional corporation like a doctor or lawyer may have is not out of the question, especially with the advantages it can provide.

ska
0 replies
2d

This is pretty true most places, hiring non contract (e.g. full time) employees in a different country is a pain in the ass. Europe is trickier than Canada, fwiw, on average at least.

These days there are a number of companies that specialize in simplifying this, including liability shields, but of course for a fee.

Honestly it’s easier to do it as consulting or freelance contracts, but that puts the employee in exactly the same position as OP. Still, for e.g. typical tech jobs an account to sort it all out for you will be maybe 3k or so, many will opt for that.

busterarm
0 replies
2d1h

I know one L.A.-based company that hires tons of remote Canadians, especially in engineering, because they're cheaper...but they're essentially a payroll/business accounting company.

1letterunixname
0 replies
1d22h

This sounds like an under-exploited business opportunity for Canadian staffing and consulting companies. Where there is difficulty for some, there is defensibility for others.

choeger
5 replies
2d1h

This demonstrates how any algorithm, software or not, works: Start with something desirable or necessary and add complications until you end up with a mess that can be used to yield arbitrary results, drive outsiders into madness, and summon some lesser demons if read in a chanting manner.

Now what could be done about this? The obvious answer is refactoring. That's what politicians promise in election campaigns and junior software developers demand when encountering a new code base. It's rarely ever done in practice because no one can disambiguate unnecessary from desired features and complexities. The second answer would be a clean implementation in some more formal framework (a statically typed language, a theorem prover, ...). That second solution often fails when attempted because the system is already unsound. Fortunately, no one cares about those "weird corner cases" and everything is left as-is until someone runs away with a million dollars or so.

cmrdporcupine
4 replies
2d1h

In actuality the CRA and recent federal gov'ts have done a lot to simplify taxes in Canada. It's way simpler these days. Though obviously this payroll stuff is an exception.

10-15 years ago there were piles of special exemptions carved out for all sorts of things (mostly to buy votes.) These days, if you don't have self-employment or foreign investments, etc and are just the typical paycheque-receiving wage slave, filing taxes is trivial and mostly automatic.

The bulk of the complication in the above graph seems to do with the fact that Canada is a highly federal system, with provinces having various relevant powers and oddities carved out as a result of that. That, and the existence federal employment insurance and pension plan systems.

switchbak
2 replies
2d

"trivial and mostly automatic" - but not so automatic that it's done for you, as in some other countries. And that's by design - Intuit still wants their cash cow providing that sweet sweet revenue every tax season.

cmrdporcupine
1 replies
1d20h

I don't see how Intuit has any pull on Canadian tax law or influence with the CRA. And there are plenty of alternatives. I used ufile.ca for years, way cheaper. And honestly, just picking up the form and doing it yourself is all my parents did for years.

I'm pretty sure we'll see what you're asking for within the next 5-10 years. With them already having the T4s, etc. I don't see why they couldn't have you login to their site, confirm everything, and submit.

switchbak
0 replies
22h27m

According to someone who worked for a popular accounting software company, Canadian tax law is amongst the most complicated in the world. Many companies benefit from this, and it's long been shown that they lobby to keep it this way (in the USA at least). Assuming similar motives and incentives in Canada isn't a particularly big stretch.

But if what you describe comes to pass - even just for simple returns for individuals - I'll be pleasantly surprised.

nayuki
0 replies
1d10h

In actuality the CRA and recent federal gov'ts have done a lot to simplify taxes in Canada.

Sorry, as much as I want to believe this, I have loads of evidence against it:

* I have PDFs of all my annual personal income tax returns. Looking at one year to the next, each year tends to add a couple of line items (as designed in the CRA form - not talking about my personal line items), and each year has a chance of adding a page or two to the overall return package.

* Line numbers got two extra zeros appended in tax year 2019. e.g. Line 121 became Line 12100.

* Ontario has had a surtax for decades instead of rolling it into the marginal rates.

* TFSA was introduced in 2009. FHSA was introduced in 2023. Need I say more?

* The Working Income Tax Benefit, introduced in 2007, now named the Canada Workers Benefit, acts like a pseudo basic personal amount. It would be better to meld this into the marginal tax rates.

* The CPP introduced an "enhancement" in 2019 as an extra line item instead of rolling it into the existing rate table. This is a disingenuous way to present a new tax, and a way to obfuscate it.

* Canada Training Credit, introduced in 2019, adds a page to the tax return.

* Ontario health premium, introduced in 2004, adds just over half a page, instead of rolling it into the marginal rates.

In light of all this, all I can see in the tax code is an ever-expanding morass of complexity that is an enormous time and brain drain on law-abiding taxpayers.

robertlagrant
4 replies
2d

I think what's clear is that regardless of how complex this appears, we should never blame mistakes or loopholes arising from this complexity on the law makers. Only on tax payers.

j45
3 replies
1d23h

And the cost.

robertlagrant
2 replies
1d7h

It would be nice if accountancy fees were tax-deductible.

j45
1 replies
1d2h

Corporations can, not people. Maybe because the size of revenue from both groups.

robertlagrant
0 replies
23h2m

Possibly. But if they were tax-deductible from people, it'd be a nice downward pressure on more complex rules on getting money from people.

dangerboysteve
4 replies
2d

Last time I looked at Canadian payroll services, many were very affordable. Why bother spending the time on this ?

robertlagrant
1 replies
2d

Why should calculating how much money to give the government cost money?

dangerboysteve
0 replies
2d

Because of the time it takes to record and distribute everything and pay the government.

gus_massa
0 replies
2d

He likes solving almost imposible math problems.

chrisfosterelli
0 replies
2d

Paying for something helps but doesn't entirely free you from a responsibility to understand this flow. Because an employee is going to ask you why they have X on their payroll and not Y like they calculated on their end and then you have to spend an afternoon reverse engineering everything the tool did because "our payroll tool just did it like that" isn't a very professional answer.

neilv
3 replies
2d

Several years ago, I worked through my US IRS tax return forms by coding the data and calculations in Scheme. The representation ended up being that each form line value was a Scheme procedure that called other such procedures, which was one way to enforce dependencies. (Fortunately, there were no cycles in the dependencies, like the article author found in their CRA payroll deductions work.)

I don't have the code handy, but the procedures typically looked like this:

    (define (form-1234-line-22--foo-income-dollars) 234.00)
    
    (define (form-1234-line-23--taxable-bar-income-dollars)
      (max (+ (form-1234-line-22--foo-income-dollars)
              (form-1234-line-21--baz-income-dollars)
              (form-1234-schedule-x-line-10--total-blort-dollars))
           0.00))
It was a lot of work, but (since I used error placeholders for many code paths my own data wouldn't exercise) not that much more work than I had to do anyway, for doing my returns with just the PDF forms and instructions. (The extra work came when I had to enter and double-check the form data manually in the official format, for this one-off exercise.)

I did this exercise to see what it would look like, would it save me time/headache, and did it suggest anything about DSLs for this kind of work (say, for domain experts to codify and maintain something more formal and checkable than the form instructions or tax code).

cdcarter
1 replies
2d

Did you take advantage of the homoiconicity of scheme to make this happen?

neilv
0 replies
1d20h

In this case, I was first seeing what could be done with basic Scheme algorithmic programming language mechanisms (e.g., using procedures and the magic of toplevel definitions).

Then, after seeing how tax form logic ended up that way, one direction would be to define a DSL that makes that easier to work with. For example, if we find everything can be implemented as these procedures, or with maybe with an additional concept (such as to handle cycles like in the article), a simple first step DSL might be another s-expression language that has magic variables that are more akin to spreadsheet cell references, in that the dependencies are evaluated in order. And it might also do things like populate a hashtable with the cached values for application use (e.g., PDF form-filling). That DSL might be implemented as a simple `syntax-case` or `syntax-parse` transformer. If that works and could, we could optimally make it more palatable/marketable/politic by defining a keywords-and-whitespace grammar that parses by transforming those syntax objects to syntax objects in our intermediate s-expression DSL (which transforms to the basic Scheme code approach we worked out originally).

There are other valid ways (say, you want tax law logic to be definable dynamically at run time). Though some involve `eval`, which I discourage. https://lists.racket-lang.org/users/archive/2014-July/063597...

jdmichal
0 replies
1d23h

I used to do the same with just Excel. First sheet called 1040, one row per line. Schedules and worksheets got additional sheets, so I could easily pull in the values from and to other sheets.

CaliforniaKarl
3 replies
2d1h

It’s charts like this why payroll providers exist. See the relevant _Bits About Money_ post at https://www.bitsaboutmoney.com/archive/payroll-providers-pow...

j45
2 replies
1d23h

It's still math and the standardizing to ensure what payroll providers submit is correct is still checked by the government, who could provide said standard.

worik
1 replies
1d21h

When things get complex even the payroll providers get it wrong

Where I live (New Zealand) holiday pay got complex, and quite a few civil service payrolls got it wrong (IIRC by a few different providors). It tooke years for anyone to notice, and has taken years, and billions, to put right.

Keep it simple. Please

j45
0 replies
1d18h

Payroll providers absolutely still get it wrong but not always because it's too hard.

I joke, but a little serious when I say asking bureauracies to get details correct, quickly and consistently might be too much, let alone with software that could threaten jobs and meetings. Canada had a payroll implementation failure in government that received international attention: https://en.wikipedia.org/wiki/Phoenix_pay_system

Having implemented more than I've wanted to - too many are still anchored in the past on a mainframe, abstracted away with a web and/or mobile app.

Still worse, many payroll providers, particularly one of the very largest in Canada, actually still processes payroll according to a "model" that's manually run. It's an excel model, run manually by people. You deal with people directly. Do anything off a beaten path? Guess which model to win.

sidcool
2 replies
1d23h

How does one even begin Designing a software system for such a complex process! The impact of a bug in such system would be huge!!

jeffrallen
0 replies
1d23h

I once spent an hour removing a few cents' error in a salary-computation and then 2 weeks implementing the correct one-time payment to 200 staff in order to make them whole from a couple years of incorrect salaries. The whole thing cost about $2000, so each individual adjustment was small, but we had to do it with transparency and humility to maintain worker happiness.

j45
0 replies
1d23h

It would need to be flexible, auditable, historical (each year ran it's version).

So, basically, no software devs really at the business analysis layer. The process mapping has to be the code. Decision making in the process mapping has to be editable.

It's quite doable and present with some of the current software packages that operate in the finance / insurance / banking / government / enterprise space.

Imho, how software has historically been created for business is now broken. Software used to aim for a fixed, or slowly changing operating model, and the pandemic kind of introduced a bunch of ongoing change.

Software will become more malleable as a result.

bigdict
2 replies
2d1h

Would be nice to have an open source implementation of this.

jqpabc123
1 replies
2d1h

Yes but unlikely because this is an example of the Open Source "black hole" where nothing escapes because developers don't find such specialized business applications very interesting.

This requires constant updating and maintenance because tax laws are always changing.

busterarm
0 replies
2d1h

This kind of thing is the bread and butter of SaaS companies though.

It's also exactly the kind of thing companies _wouldn't_ use open source for because if the code gets the tax law wrong they have nobody to transfer liability to. Once you have a corporate entity backing a subscription service, insurance underwriters can understand what's going on and you can finally manage your risks.

Joel_Mckay
2 replies
1d20h

Doing your own taxes is like doing your own dental work.

You will never be able to keep up with the legal, bureaucratic, and financial changes. Whatever a local competent accounting firm charges, they will almost always recover their cost in a commercial return.

If you have under 12 employees, than ADP payroll can work in some situation.

nayuki
1 replies
1d10h

Taxes are a social construct; teeth aren't. Some taxes are simple enough that a grade schooler can do it. For example, very few people would find difficulty in applying Ontario's 13% Harmonized Sales Tax to general retail purchases. Why shouldn't we aim to have an accessible and equitable tax system that doesn't require dedicated experts ("priests") to interpret?

Joel_Mckay
0 replies
1d5h

lol, most fail to understand there is an intricate relationship with the corporate tax and credits system. It is a full time job figuring out the retention of company treasure, handling capital losses constructively, and legal posture preparation to minimize risk.

While founders-syndrome tricks people into thinking they can do anything... they can't do everything... and often end up doing nothing when bankrupt.

You can learn the hard/expensive/painful way, or do things the easy way the first time to retain more cash to invest back into the firm,

If you are an employee filing a T4, and or a shareholder filing your T5... there is still a minefield of mistakes that can trigger taxable events. Depends how much you can legally retain, but the tax systems are often similar to a crime of omission in that it ensures you will miss most opportunities. These rules are complex on purpose.

Best of luck, and don't drop the soap =)

SurgeArrest
1 replies
1d19h

Tax laws as well as other laws, need to have a requirement to be rewritten from scratch and re-approved every 10 years or so, such that no law or regulation is complex enough that an elected official can't describe it in full before voting on it.

AmericanChopper
0 replies
1d19h

It will never happen. Tax law is complex by design, partially because it seeks to do things that are simply impossible, and partially because anybody with enough power to influence changing it benefits from the complex quagmire of ambiguous laws. The complexity allows the IRS to run roughshod over most people and businesses, but the truly powerful can do almost anything they want if they pay for enough advisors and lawyers. The system is in a perfect equilibrium in that respect.

I personally think that if a government fails to enforce a law to a reasonable standard, then the law should be invalidated. Which is probably quite similar to your idea, and addresses the problems created by discretionary enforcement. But that will never happen either.

swalberg
0 replies
1d13h

I used to run a small payroll company in Canada, everything was done in Rails.

Call it brute force but every time the rules updated I'd run scraper against the CRA calculator that would calculate payroll across a variety of provinces and pay ranges and output it as rspec. Then i could test that i was compliant and hadn't missed a rule or typoed a value.

phailhaus
0 replies
1d23h

Graphs are terrible for visualizing dependencies. Even a reasonable system can "look messy" when rendered this way. I'd be more interested in seeing what this would look like as a tangled tree. [1]

[1] https://observablehq.com/@nitaku/tangled-tree-visualization-...

nb_key
0 replies
1d22h

Canadian Federation of Independent Businesses (CFIB) has a more simpler template for small business. https://www.cfib-fcei.ca/en/tools-resources/payroll-deductio...

mrloba
0 replies
1d22h

It's a running joke in our org that we should always vote for a new government. Keep making the dependency graph messy and we'll keep having a job

mensetmanusman
0 replies
1d15h

Excited for a future where arbitrary complexity is dealt with by millions of personalized LLMs that completely simplify any regulatory hurdle by grasping an intention and figuring out the rest.

juujian
0 replies
2d1h

Very nice chart. Since the bubbles are wider than they are high, I would have probably changes the direction from left to right. Which in graphviz in theory (but only in theory!) takes just one line.

jerf
0 replies
2d

Are there any loops?

I extend this question to all the people who have posted their own graphs of other similar things.

jeffrallen
0 replies
1d23h

Would be interesting to have a constitutional requirement on government to be able to explain taxes to citizens in a declarative language with a max complexity of N bits of information.

Railroad unions: you want an exemption for your members? Write a diff and go to war with hedge fund managers to get the bits you need to implement your boondoggle. :)

I'm reminded of the "delta this build causes in bytes of flashrom" reports you see at the bottom of a compile job on embedded platforms.

from-nibly
0 replies
2d

The solution is not to automate or codify any of this, it's to remove it. This is utter nonsense. What problem could this possibly solve other than widening the equality gap?

concordDance
0 replies
2d1h

I once made one of these for HMRC's self assessment tax calculation[1], it had about a thousand nodes.

[1] https://assets.publishing.service.gov.uk/media/5dfa35f4e5274...

chad_purposecpa
0 replies
1d18h

CPA here. Probably can save you a lot of time, if you're in Canada, register for Wagepoint 2.0 and save a lot of grief. It's inexpensive and connects to QBO so your books are happy. Files and remits to CRA by itself. No need to deconstruct with code.

Ask me more here: www.purposecpa.ca

Evidlo
0 replies
2d

Devil's advocate: I have never seen a GraphViz plot that didn't look like spaghetti, so the fact that this plot looks like a mess doesn't mean much to me.

1letterunixname
0 replies
1d22h

Complexity is a signal of attempted fairness, selective corruption, or bureaucratic survival, stochastically mixed to conceal the latter 2.

Canadian and US governments have enough information to calculate taxes for you, but choose instead to impose all manner of additional complexity, cost, and time sink on taxpayers of varying degrees of sophistication because it's tradition. Norway has prepared statements automatically for taxpayers for 20+ years.