朋友的建议

来源:互联网 发布:冬的诗词 知乎 编辑:程序博客网 时间:2024/04/30 05:36

I learned standard C++ one year ago. C++ is a good programming language for a beginner to learn. I want to become a WINDOWS programmer, so I began to learn WIN32 API two weeks ago. It is a very different language from C++, so I was quite uncomfortable with it. Because WIN32 API is encapsulated by Microsoft (although I dont like Microsoft, but I had to learn it for cash.), so many functions were strange to me. I memorized some function names, but then new problems came. What was the problem? Windows mechanism itself was the problem. It is very difficult for a newbie like me. I confused  some new keywords like HANDLE, CreateWindow(), and why must I fill RegisterClass() in every program? If I want to create Multi Window, should I write LRESULT CALLBACK WndProc() one more time in my program? All these problems were really difficult. But, now I feel better. I start understood how to do WIN32 SDK programming, and what WINDOWS Mechanism is. Thats all. I want to say thanks to Programming Windows (a book by author Charles Petzold), it taught me many things. I will stick to learning WINDOWS programming. If you like that, we can talk together. I welcome and appreciate any suggestions you may have.

                                                                                                                                    Shawn

I guess I fail to see the point of the post... but oh well. Anyway, personally, I don't care for using any API. I will use them as I need, but I prefer to stay as much within the language I am using as much as possible. The windows API really isn't that differant in its use than any C type function though, I dunno why it threw you off. The hard part is learning how the OS works and understanding the prerequisites that each function will have that the programer has to satisfy.

Also, if you don't like windows, then why do you want to become a windows programmer? Personally, I have worked on many programming projects and typically my role was to write the actual algorithms to be used, and then provide documentation on their use that the GUI guys then used and tied the gui to the functions that I wrote. These ranged from basic data handling and stoarge (mini proprietary filesystems) to algorithms like simulated annealing or ANT algorithms. I am sure that could find a similiar job if you made algorithms your focus. The windows API may be confusing at first, but there are many programmers out there who can use it, but much fewer out there who have truly mastered algorithm creation and optimization, especially in complex fields.

this is really the granularity trade-off. c++ programmers *think* that they need low level access to functions, but many of us dread working directly with the WinAPI due to the error-prone nature of the endeavor. MFC was intended to be a solution to this, but most of us dreaded using it because it was bloated. a better answer has been .NET, which has abstracted the mechanics of setting up a GUI into a nicer API... you can still dig into the details should the need arise, but you don't have to re-invent the wheel each time you start an application.

Krellor

原创粉丝点击