Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A lazy way to do this is to take the current price as the non tariff price and assume any increase in price is based on tariffs.


Some Amazon programmer tomorrow

priceIncrease := (newPrice - oldPrice) / oldPrice var trump_tariff bool

if priceIncrease > 1.0 { trump_tariff = true }


Please don't use if:s to assign boolean literals, just do it:

    const trump_tariff = priceIncrease > 1.0
also saves you from not initializing the variable in the default/other case. :)


This was just someone showing you what the "Amazon programmer" was doing, and hence a deep cut reference to the likelihood of it being poor quality code :)


If you really wanted to look like Amazon codex you would write Java :)


I see I missed an opportunity to make it even funnier.


    const
I feel you may underestimate how often they change.


not to mention the mix of snake_case & camelCase


In the original code, trump_tariff is a sticky value. If that’s intended/not intended, the above introduces/fixes a bug.


If statements are great because they are highly readable.


Seems novel and kinda “going out on a limb,” sort of unlikely for a big entity like Amazon, right?

I wonder if they will just allow their suppliers to add in an additional “my tariff costs” number, which the supplier can compute however they want and be responsible for. (This would be on top of the main tariff price, the one paid directly by Amazon, which of course they’ll have receipts for).


Then increase the price!


That would also be quite a misleading way to do it.


I’m sure it would be off in some cases, but “quite misleading” seems like an exaggeration: the economy was steadily growing and there weren’t any major drivers of inflation other than Trump’s massive tax hike.


There are other sources of price changes - commodities prices, exchange rates, taxes in originating countries, costs of transport....


Yes, but how many of those dramatically jumped recently? Two years from now, sure, you’ll have to ask about other things but it’s not like the commodities market had other massive upsets this month.


Oil has varied in a range of about 23% in the last few weeks, and the USD to CNY rate. Raw material for many things (like plastics) and obviously used for transport.


Oil has gone down, though, and the primary driver for the volatility was the tariffs. It’s not like there was a big change in production or something like the pandemic causing millions of people to change their driving habits.

Again, the question is simply what non-tariff factor would explain non-trivial prices over a month? If there isn’t one, it doesn’t seem unfair to attribute the increase to a huge policy change.


> Again, the question is simply what non-tariff factor would explain non-trivial prices over a month?

Having the most economically clueless US president in a century and watching his erratic behavior in real time.

Tariffs are only a small piece of the puzzle.


Oil has primarily gone down. Demand destruction tends to do that.


It went up then down. Either way, its still makes the assumption that "price change is purely due to tariffs" inaccurate - it just changes the direction of the error.


I don't think it takes much thinking to realize how misleading this is. I'd really be interested in Prime Day when tariffs are decreasing everything


Can you give an example? Usually short term price fluctuation would be in response to something like a sudden change in market demand or something like a natural disaster lowering production but nothing like that seems to have happened other than the largest tax increase in U.S. history and the demand shock from the federal cuts should be lowering prices, not raising them.


> Usually short term price fluctuation would be in response to something like a sudden change in market demand or something like a natural disaster lowering production

That's theoretical economics, meanwhile in the real world, retail stores change the prices of goods depending on the weather or holidays.


And in your theory thousands of vendors around the world all randomly did this in the same direction at the same time? It’s not like chocolate eggs before Easter are the only thing going up while the rest of the economy is chugging along like normal.

Similarly, weather could explain the decline of winter gear sales in the northern hemisphere or specific commodities being hit by a storm but that wouldn’t affect the whole economy and we’d all have seen coverage of some epic monsoon or drought if it was that impactful.


I just gave you examples of the most common reasons for price changes that your mental model wasn't taking into account.

Prices vary based on many more factors than what you think it does, that's it.

> all randomly did this in the same direction at the same time

Who says it's random? Most of the variation is very likely linked to the US government actions, but the first order effect of actual tariffs is far from the only way the Trump administration is messing up the economy. In fact, the mess started long before the tariffs actually went enforced and it didn't stop when they where suspended.


Price fluctuation doesn't usually depend on market demand or natural disasters. How you got that idea is beyond me.


All I’m talking about is basic supply and demand: if prices suddenly go up significantly, that usually means that there is either a big change in demand or the supply has become limited and buyers are having to pay more. A big natural disaster can cause that if it affects agricultural supply, shipping, or factory production (e.g. years ago, flooding in Thailand caused hard drive prices to double[1]).

My point was simply that since nothing like that has happened, prices spiking is almost certainly due solely to the tariffs.

1. https://www.techspot.com/guides/494-hard-drive-pricewatch-th...


The problem is that you are invoking a crude theory in a simplistic fashion that has with very little predictive power over the real world.

It's as if you told a guy working in a ski station that “the temperature cannot be above 0°C as there's snow everywhere and everyone knows that snow melts above zero”.

It's not how it works, and the economy doesn't work in the simplified fashion you seem to believe it does either. You cannot reason from first principles using “basic supply and demand” arguments like that any more than you can make statements about the weather using the second law of thermodynamics.

Price change all the time for variety of reasons, seasons being one of them (that's why CPI figures are said to be “seasonally adjusted”, BTW).


> The problem is that you are invoking a crude theory in a simplistic fashion that has with very little predictive power over the real world.

I appreciate the mix of unwarranted condescension with the assertion that the theory that sudden tariffs cause sudden price increases doesn’t have predictive value, when basically every sober analyst predicted what we are seeing now.

It’s not exactly a secret that prices fluctuate seasonally but what we’re seeing now is spread across the entire economy, suddenly, and in sectors which do not normally experience that seasonal volatility.


> what we’re seeing now is spread across the entire economy, suddenly

Including in sectors that aren't affected by tariffs at all, that's the thing.

> the assertion that the theory that sudden tariffs cause sudden price increases doesn’t have predictive value, when basically every sober analyst predicted what we are seeing now.

You are misunderstanding. Tariffs will cause price increase with certainty. But so will lowering the USD value on FX markets, and so will adding massive uncertainty to businesses (including, but not limited to, the prospect of higher inflation in the near future), etc.

Tariffs will cause price hikes, but attempting to measure tariffs effect by observing price variations simply cannot work.

Real life prices are influenced by much more than just supply and demand.


I've been convinced for a while that teaching economics broadly is a mistake, people who have taken a minimum amount of economics class do in fact understand less how the economy works than people who don't…


People that actually have ran a business and priced stuff generally have a better idea of how pricing works


Exactly.


I don’t think they are going to do some novel calculation or go out on a limb much at all.

I mean, passing along tax information is a political act (in the same way not showing items on the shelf with sales tax, and then including it on your bill is an anti-sales-tax political statement—the point is to blame the government for an annoying surprise), but it is (I think, at least) widely seen as sort of… normal acceptable behavior in the US.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: