A friend told me that, as a computer programmer in the United States, I should not buy long-term disability (LTD) insurance. He basically said that I could never receive benefits, because there is almost no physical ailment that could prevent me from doing my job. Is that correct?
You can use a good personal disability policy that has strong own occupation coverage. Like doctors get. And disability policies like that don't just cover physical ailments like knee problems. They cover cognitive problems too. In addition to what Ron mentions - consider stroke (major or minor), any illness or injury that leaves you with temporary or permanent head pain, any illness or injury that leaves you with temporary or permanent brain damage, mental illness of moderate to strong severity (which can develop at any age for many reasons beyond your control) - these things can happen to programmers for sure.
Group disability policies typically have any occupation coverage: Can you sit on a stool and say "would you like fries with that?" You're not disabled: get a job, case closed. Some group coverage (I've seen it in high-tech) and some less expensive personal policies have weak own occupation coverage: "So, you've been working as a neurosurgeon, can't do that anymore, yes, I get it, but: how about reviewing patient files for an insurance company to see if it should pay for a procedure - you've been trained to do that so off you go! Yes, I get that the pay is significantly lower, what's your point? Off you go!" Or it might have a time limit: "Yes, we paid you for 3 years because you can no longer do neurosurgery but now that gravy train is over, Walmart is hiring greeters - no more checks for you!" So you've got to make sure you're getting what you think you're getting when you purchase this.
(Other tips are available around the web on what else to look for in these policies.)
w.r.t. short-term disability: that depends entirely on the state of your bank account and savings and how long you're willing to draw down on that in case you're out of work for weeks (maybe, say, vestibular neuritis knocks you out for between 2-3 months (or longer) - that's a "physical" disease that programmers can get (ask me how I know)).
The cognitive reasons I mentioned above are what I fear most and are why, as a programmer, I've had a personal long-term disability policy for over 3 decades.
No, I'm a programmer and I have LTD and STD insurance. What happens if your hands get maimed? Go blind? Major back problems preventing you from sitting? Paralysis? I can think of a ton of things that would keep me from programming...
There is no law that would prevent you from buying LTD insurance as a programmer.
Wow, that's ... optimistic. Is this person young? They infamously have a false sense of being immortal.
Many co-workers (and half the people I dated) back in the day, had disabilities which constricted their computer use. Pay attention to your own circle of friends - I bet there are more than you noticed, they just don't talk about it much.
There are a variety of such injuries or conditions, and some are occupationally induced.
Read my lips. Some are caused by using computers.
That's why on any mid-size or larger enterprise, there will be an Ergonomics Team who will try to nanny you about the layout of your workstation. I'm sure you find those people trite and annoying, but they're trying to prevent what did happen to my sweetie, who had to go on permanent disability due to getting carpal tunnel due to bad ergonomics. There was a civil judgment, but it was poor due to the difficulty of proving causality.
So yes, it can happen, and you can even do it to yourself (or an employer can do it to you).
tl;dr: disability insurance is not necessarily for being unable to work forever, it is meant to be a stopgap for being unable to work some amount of time. (Ultimately, your friend is incorrect)
This is a theme throughout, figured I'd add it to the beginning too: all numbers and policy interactions are examples, check the policies offered.
Private disability insurance is meant to cover you being unable to work for some amount of time. STD is for you being out up to 2 months (for example). LTD is meant for longer outages (when a claim starts may depend on you having STD: if you have STD, LTD starts after it expires; if you don't, LTD starts after 6 months (all examples, read the policies)).
For example, let's say you have an accident that causes you to miss 8 months of work (but the damage won't prevent you returning to work).
- STD+LTD: you start collecting STD in a week, covers you for 2 months, then LTD starts, covers you for the remaining 6 months, then you go back to work.
- just STD: start collecting in a week, collect for 2 months, get nada for 6 months, go back to work.
- just LTD: get nada for 6 months, get LTD for 2 months, return to work.
That is idealized though, there's good reasons that insurance companies are as reviled as they are =\
Shamelessly stealing this from other answers (for completeness): Depending on policy, it may cover mental health conditions preventing you working.