News for hackers. Stuff that matters.
Re:Stop writing classes... by barrkel on Saturday March 17, 2012 @11:49PM (#3719040)
The sockets API would be much more future proof if C better supported polymorphism. That's usually the reason for using structs instead of arguments; in Windows, most API structs start with the size of the struct, effectively indicating the version. Makes binary compatibility easier when you add arguments in version n+1.

sockaddr_in is the way it is because of sockaddr, sockaddr_in6 etc. Judicious polymorphism could have led to fewer headaches converting IPv4 apps to IPv6.

There are no comments on this comment yet.