People move to piracy due to lack of affordability and options.
I am from one of those countries where we pretty much cannot afford "legal" content. In my shitty town the median salary is something like $300, at least half of which goes towards paying rent if you don't have your own house, while we're being asked to pay prices that were established for developed countries with median salaries at 10× of ours or above.
Steam is one of very few exceptions and it's really popular here even among students and such (just like everywhere else).
Basically, if you want to charge me $50 for the book, you're not losing anything, simply because I cannot afford it anyway. Imagine if you had to pay $500 for books, $600 for movies, etc.
For example, The Pragmatic Programmer costs $10 in Indian stores, while it costs $50 in US.
Not making a moral judgement, just adding color.
I would, as, in most cases, code alone doesn't really make money.
Less obvious but just as relevant would be Snowflake, Clickup, etc letting me just deploy and host their software in our data center instead of relying on their cloud.
This is typical strawman stuff.
If you feel bad about privacy, pay a random author half the Amazon price of your library and you’ll be a better person than somebody who meekishly shovels Bezos a ton of money in misguided morality. One that makes reading an exclusive right of the wealthy.
For non-academic books, I don't know how things works, maybe there is a mechanism where the author can gain revenue from selling books. So I always pay for them and the priated copy I downloaded is just for archival.
I work at a large national library and teach at a university, so have to deal with copyright issues every day. Everyone agrees copyright is broken.
I release all my personal code under MIT license, and if someone does want to violate that license by not attributing me I am completely fine with that.
I want a book; I don't want to pay for it; so I pirate it.
And then I go about my day without ever thinking about it again.
Especially on HN, where I think a lot of our livelihoods depend on writing and charging for closed source code that can technically be infinitely distributed.
How many of us would be happy to open source all our code, provide easy ways for people to download and deploy, and then leave a PayPal link in the footer asking for donations? Why should authors be any different?