There are books that are mastered by half, you feel like a hero. And very rarely does it happen that in the middle of a book you regret that there is so little left. The book The Old New Thing - this is the very rare case.
The closer to the end, the more I wanted to read. Therefore, bonus chapters that are not on paper, but are on the site, came in handy.
It is already becoming a tradition that blogs go through literary processing and are published in the form of a book. So here. Raymond Chen is the author of
The Old New Thing blog of the same name, located on
MSDN Blogs . Apparently, the blog should be very popular.
I learned about the author and the book from Joel Spolsky's articles (“
Joel on Programming ”, “
Best Software Development Examples ”). As I understand it, Raymond Chen is a “dad” of Windows, he “molded” it. And you can hardly find anyone who knows more about the insides of the system.
There are such knowledge that you will not get from anywhere else, except from others. The book has a lot of information of this kind. After reading it, much more you begin to appreciate how much invisible work invested in Windows, how hard it was to make it so that users were comfortable. And do not throw rotten tomatoes at me: the last Windows I dealt with was the 95th. Since then, I have been working exclusively on Linux. But this does not mean that it is necessary to throw mud at the alternative operating system. Even if it has shoals.
For jambs, in actual fact, are often a historical legacy left for backwards compatibility. For example, special files like CON and PRN. Initially, it turns out, they were a very useful hack. There are even convincing explanations for what has always enraged me: interpreting the BIOS clock as local time, not GMT; overwrite the boot sector when you install Windows.
In addition to explaining where these or other features come from, there are a lot of funny stories. I was especially amused, as after sticking a lace, the system said: “A new device has been discovered: the Boeing 747”.
All this is interspersed with deep technical heads. They also reveal the subtleties of the usual things, for example, dialog boxes or a message manager. Useful reading for all GUI-programmers, and not only under Windows. For me, this is the first book that answers the question “why it works this way,” and not just describing how to do something.
The big chapter is devoted to the internationalization of programs and disassembly with input-output in different encodings. For me, a little new, but those who have not yet "burned" on exotic letters, learn about some of the difficulties of life.
I heard a lot about the fact that the function pointer cannot be placed in an int, but I could not think of why. Thanks to the discussion of the insides of Visual C ++, I now know: a pointer to a member function of a class can be very tricky, it won't fit into an int.
Pleased with the use of tools for other purposes. For example, how to draw a filled rectangle? Use the Rectangle function? Or maybe FillRect? So, it turns out that the ExtTextOut function is the most convenient and efficient.
In discussing the issues of performance I was impressed by the disassembly with memory. Were considered traditional approaches that are used when it is necessary to cache and think lazy. It turned out that in such cases, memory for cache is consumed very inefficiently. The experiment showed that the used part of the cache is only 2%, and the rest is lost! A small change in the algorithm dramatically changed everything, and the cache was used by more than 98%, often close to 100%. It turns out that a cache with a bad algorithm is just another name for a memory leak.
Speaking of leaks. How to understand where it happens without using special tools? It turns out there is a surprisingly simple and very successful way. We take a dozen addresses and make a memory dump. With a probability close to 100%, there are leaked objects. It remains only to look at the printout and find a frequently repeated pattern. This is a leak. Practitioners physicists rule.
The bonus chapters tell you what tricks the Windows developers had to go in order to get some software to work under their system. These stories would decorate the
WTF . So the next time, before shouting “Windows must die,” think about whose curved hands they have done, and try to read The Old New Thing.
Links