git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/5] Add zlib decompress helper functions

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jan 10, 2008, 21:57 UTC
Message-ID
<alpine.LFD.1.00.0801101351250.3148@woody.linux-foundation.org>
In-Reply-To
<e5bfff550801101304m4f0b97baua6553c45772793b6@mail.gmail.com>
On Thu, 10 Jan 2008, Marco Costalba wrote:
>
> When decompressing a zlib stream use this
> helpers instead of calling low level zlib
> function.
I really *really* hate your naming.
> This is the first step in generalizing compress and
> decompress functions avoiding zlib directly calls.

If that's the goal, why keep the horrible "z_" prefix, and why the opaque and non-obvious "inflate"/"deflate" names?

I'd suggest that you just replace all "z_deflate_" with "compress_" and "z_inflate_" with "decompress_".

Yes, it would still leave zlib-specific stuff in there (the return codes, the "z_stream" type thing etc), but at least it would be a _step_ towards more readable code and code that is less obviously zlib-specific.

With those changes, I'd heartily recommend merging this even if we never actually switch away from zlib, if only because zlib has all these horrible names.

		Linus
[ How many people really know that "inflate" means "uncompress", without 
  having to think about it a bit?
  I guarantee that any computer person immediately knows the difference 
  between "compress" and "decompress" without even thinking, but ask 
  somebody what "inflate" vs "deflate" does, and they'll be able to answer 
  you, but they'll first have to think about an air mattress or something.
  Yeah, yeah, old-time zip users probably think the whole xxflate thing 
  makes sense, and I'm just grouchy because _I_ always have to think 
  about it. ]
Previous: Marco CostalbaNext: Marco Costalba
Message 2 of 3 in “Add zlib decompress helper functions”
  1. 1/5 Add zlib decompress helper functionsMarco Costalba, Jan 10, 2008
  2. Linus TorvaldsJan 10, 2008
  3. Marco CostalbaJan 10, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.