-
November 12th, 2011, 02:31 PM
#1
Why is winapi so messy?
I used WinSock2 a bit and it's just horrible how they can't even use types consistently. I'll bring a few examples.
int connect(SOCKET s, const struct sockaddr *name, int namelen);
Why is namelen an int when the ai_addrlen field of addrinfo is size_t?
int setsockopt(SOCKET s, int level, int optname, const char *optval, int optlen);
Why is optval char* and not void*? And again why is optlen not unsigned?
-
November 12th, 2011, 11:57 PM
#2
Re: Why is winapi so messy?
1. The winsock functions were not written by MS. They were first used back in the late 70s. For standardization sake, MS made the prototypes identical.
2. As for the majority of the Windows API, it was built function by function over time. If you separate when a function was created into time groups, you will see a logic. For instance, over the past few years, you will see a tendancy toward convenience functions and protecting the programmer from themselves. Kind of like the user permission stuff in Windows.
As a side note, I personally wish that MS would recognize the difference between:
A. joe blow and his laptop purchased for email and netflix.
B. a power user for business.
C. a developer who knows everything inside and out.
==============
-Erik
-
November 13th, 2011, 08:04 AM
#3
Re: Why is winapi so messy?
Originally Posted by egawtry
1. The winsock functions were not written by MS. They were first used back in the late 70s. For standardization sake, MS made the prototypes identical.
Are you referring to berkeley sockets? Winsock function prototypes actually differ from berkeley's prototypes. For example connect() actually uses socklen_t which is an unsigned type.
They should fix inconsistencies.
-
November 13th, 2011, 08:21 AM
#4
Re: Why is winapi so messy?
Originally Posted by Bssldr
Are you referring to berkeley sockets? Winsock function prototypes actually differ from berkeley's prototypes. For example connect() actually uses socklen_t which is an unsigned type.
They should fix inconsistencies.
Berkley sockets is a standardization of a what people had been using for a long time before that.
MS made it so a program typed in identical to one from back in the late 70s/early 80s would compile and run. They adhered to the now defunct POSIX standard.
At this point, they simply CANNOT change prototypes, half the programs on the planet would break. Every ten years or so, someone at MS tries, and makes a mess. The latest being the in and out added to the prototypes which crash all the older compilers. (They also tried to rename LPWSTR - mess there too.)
Learn to live with casting like the rest of us.
-
November 21st, 2011, 10:07 PM
#5
Re: Why is winapi so messy?
Originally Posted by egawtry
As a side note, I personally wish that MS would recognize the difference between:
A. joe blow and his laptop purchased for email and netflix.
B. a power user for business.
C. a developer who knows everything inside and out.
==============
-Erik
Fully agree. It would be great if during the installation of Windows we would be able to pick one of the three options:
-I'm a novice
-I'm an average user
-I'm an IT specialist
Thanks God (and Bill Gates) that at least they removed that stupid warning "Deleting the shortcut will not uninstall the application".
-
November 21st, 2011, 10:23 PM
#6
Re: Why is winapi so messy?
Why not use a 3rd party networking library? The interface would probably be superior and your code would be more portable as well.
-
November 22nd, 2011, 11:13 AM
#7
Re: Why is winapi so messy?
Originally Posted by srelu
Thanks God (and Bill Gates) that at least they removed that stupid warning "Deleting the shortcut will not uninstall the application".
My thanks to God is that they removed the warning on boot when the user checks are turned off. That was so frigging annoying! Every IT guy I know automatically turns it off nowadays.
-
November 29th, 2011, 05:27 AM
#8
Re: Why is winapi so messy?
Originally Posted by egawtry
As a side note, I personally wish that MS would recognize the difference between:
A. joe blow and his laptop purchased for email and netflix.
B. a power user for business.
C. a developer who knows everything inside and out.
-Erik
Probably my biggest gripe with Windows. And they didn't do all that great a job at fool proofing Windows for the low end user either. For that, Mac OS did a better job.
Though I think the unfriendliness to users who need/want to know the OS inside and out is one reason the available software for the Mac is still much less than what is available for Windows.
Bill
-
November 29th, 2011, 10:26 AM
#9
Re: Why is winapi so messy?
Originally Posted by wdolson
Probably my biggest gripe with Windows. And they didn't do all that great a job at fool proofing Windows for the low end user either. For that, Mac OS did a better job.
No arguments here. Dedicated hardware also makes it more stable.
Although I do dislike the Mac desktop GUI. Always having to go to the top of the screen for the menu is annoying. I suppose with a hardware GUI it is easier to implement though.
Originally Posted by wdolson
Though I think the unfriendliness to users who need/want to know the OS inside and out is one reason the available software for the Mac is still much less than what is available for Windows.
Again, no arguments. The main reason though is that the Mac is so expensive. That is why I don't have one.
Also that as a game machine, Macs are harder to program. They cannot be upgraded very easily with a new fancy video card either.
-Erik
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|