40 years ago, when I was dabbling with programming, I wrote a program for online communication that was impervious to online virus attacks. When I tell people that, they give me a skeptical look and say "Well, you must be rich then". In reality, writing software that doesn't enable viruses is a whole lot easier than writing software that can allow a virus to take over your computer.
The overwhelming majority of people who use a PC have no need to have their computers controlled via a third party over a network connection, yet operating system software is written to allow this kind of control. Writing software for exchanging multi-media data, which is all we really want for our web based activities, is fairly straight forward and could be easily set up to discard viruses rather than turn over control to them. Data that appear on the network port will be displayed or filed according to type (text, video, sound, etc.). If a program, which is what a virus is, appears at the port your software should simply file it away as a program but not automatically install it and run it. Enabling a virus to take over your computer takes extra programming involving setting up and installing the code in a special area of memory and then turning control over to it. If this "extra programming" isn't included as part of your operating system that poor virus won't be able to automatically run.
Unfortunately, operating systems are designed to allow businesses access to your computer. It is this access that allows busnesses to view your files and change your settings without your knowledge, and it is what allows viruses to operate. I wonder how much of my computer's resources, and how much of the bandwidth I'm paying for, is being used for their purposes rather than mine. At the same time these "legitimate" businesses are accessing my computer they are compromising it's security and exposing it to virus attacks. And think of all the time your computer spends running antivirus software instead of doing the tasks you want it to do everytime you use the computer.
Look at the recent case where a hacker was able to take nude pictures of Miss Teen USA by remotely watching her through her own computer's camera without her knowledge. I'm sure it's happened more than just this one time but in this case the guy got caught only because he tried blackmailing the girl.
Sorry about the rant. This is one of my main gripes about computers and I like to vent about it every once in a while. The bottom line is that software giants can easily write software to prohibit online viruses from automatically infecting your computer. This new software would make your computer faster and more efficient and eliminate much of the need for time wasting virus scans and firewalls that interfere with your network speed. The only thing that is stopping them is the fact that they can make money by mining your personal data.