[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sockets Layer Counter Proposal



From: "Aaron W. Hsu" <arcfide@xxxxxxxxxxx>
Subject: Re: Sockets Layer Counter Proposal
Date: Thu, 11 Oct 2012 16:23:28 -0400

> I think it is worth dropping strict correspondence to the POSIX names
> and just providing a consistent naming convention that maps the shared
> structure to more reasonable names in Scheme.

It sounds good on surface; in reality, we have to work with dozens
of different libraries written by different people, and unless all of
them conforming the same rules, one "reasonable consistent convention"
plus another "reasonable consistent convention" makes an inconsistency.

I won't say existing names are reasonably consistent.  But bringing
in another "consistency" won't make the situation any better, unless
you're determined to go forward renaming every foreign symbols with
the same rule.  Good luck when you write Xlib, GL and Gtk bindings.

> If someone wants to know
> how to get the equivalent constant, then they can look it up in a
> table.
> So, SOCK_STREAM → socket-domain/stream, for example.

Most programmers who has worked on sockets can read and write
SOCK_STREAM without looking at anything when it's needed.
Why make them look up extra table?

More importantly, when you try to debug other person's
code and stumbled on some unfamiliar flag in the dark corner
of socket interface---say, some socket opions or socket ioctl
calls---it's quick to search manpage and web it when you can
deduce the original name.  With special naming, you search that
name, find out the original name, and search the original name
again; this two more steps is very stressful when you have
to troubleshoot by the deadline, for the new name doesn't bring
benefit but just being an obstacle.

--shiro