The main reason is that programmers have solid and stable incomes. On this path, the better your technical skills, the higher your income, but this isn't necessarily true in other industries.
Basically, a guy in his 20s who works hard and is willing to put in the effort will keep improving his skills throughout his life, and his income will naturally follow. This is different from people in other industries. The unique nature of the profession ensures they are always learning and honing their skills, so their incomes naturally rise along with it, and there's a sense of achievement. To use the proper Zhihu phrase: programmers = potential stocks.
Didn't Maggie Cheung say that a serious man is the sexiest?
But a programmer's world is relatively dull; it's basically work during the day and reading and studying after work, so their social circle naturally becomes smaller. When they were in college, they weren't like liberal arts students who dressed up stylishly and went to parties everywhere; women were a problem for them. But let me tell you a little secret:
Almost all jokes about programmers online, especially the ones about women, are basically self-deprecating jokes written by programmers themselves. Don't take them seriously.
Do you really think programmers get the chance to fix computers for beautiful women? The truth is, they might not even have a few friends of the opposite sex, let alone beautiful ones. Life is too cruel...
PS: Among programmers, there are very few with greasy faces and bald heads. Most of them look pretty presentable once they tidy themselves up, and their looks are generally above average in a crowd. Big IT companies also have their own gyms and trainers. Among the programmers I know, quite a few are in good shape, and quite a few play guitar or photography. Of course, that doesn't stop them from still failing to find girlfriends...
Source: Zhihu