为什么 Windows API 不如其他 API 直接?
在我看来,Windows API 并不像您想象的那么简单。对我来说,它们是有点令人费解的时尚?
这是保持向后兼容性的效果吗?
Microsoft 的主要目标是推动开发人员使用 ATL/MFC、VB 和/或 .net 等更高级别的抽象吗?
这是我第一次使用 Win32 API,像 FindFirstFile
这样的调用让我坚定地相信 UNIX 哲学,即 API 似乎可以用 10% 的努力实现 90% 的灵活性。然后,似乎有一些独特的情况需要在 *nix 类型的机器上使用诸如 fcntl
之类的调用,它们将成为 Windows 上实际调用的组成部分。
...或者我只是缺少一个基本范例?
The Windows APIs don't seem to me to be as straight forward as you might expect. To me, they are somewhat convoluted fashion?
Is this is an effect of keeping backwards compatibility?
Is Microsoft's main goal to push developers to higher level abstractions like ATL/MFC, VB, and/or .net?
It's my first time using the Win32 API and calls like FindFirstFile
are making me a firm believer in the UNIX philosophy where the APIs seem to accomplish 90% of the flexibility at 10% of the effort. Then again there seems to be some unique cases that warrant using calls such as fcntl
on *nix type machines where they'd be integral to the actual call on Windows.
... or am I just missing a fundamental paradigm?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
需要记住的几件事:
它是大约 20 年前设计的,主要基于十年前设计的早期版本的 Windows。
它基于 C,因此 GetString() 函数需要具有如下设计
而不是
任何其他语言都会有。
A few things to keep in mind:
It was designed about 20 years ago, and was largely based on earlier versions of Windows which were designed a decade before that.
It's based on C, so a GetString() function will needs to have a design like
instead of the
that any other language would have.