Re: Discouraging use of sync APIs

On Mon, 2015-02-09 at 10:57 +0000, Debarshi Ray wrote:
On Mon, Feb 09, 2015 at 10:47:37AM +0000, Philip Withnall wrote:
I guess there are two approaches: making async APIs easier to use; and
discouraging use of sync ones. I think the GAsyncResult framework we?ve
got is pretty good, and I can?t think of a way to simplify it.

One convention that I like is to use a _sync suffix for sync APIs,
instead of an _async suffix for async ones, because it lets me spot
synchronous calls with grep.

A little sad that there are things like g_file_read that are sync, not

We had a brief discussion about that at the DX hackfest, and I think the
consensus was that the current naming scheme (no suffix = sync, ‘_async’
suffix = async) is unfortunate, but has to be kept for consistency
reasons. It would be really confusing to switch to a new scheme while
keeping the old one. :-(


Attachment: signature.asc
Description: This is a digitally signed message part

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