RE: [PHP-DEV] Concern around growing complexity in engine - hash table specifically

From: Date: Thu, 09 Apr 2015 15:16:55 +0000
Subject: RE: [PHP-DEV] Concern around growing complexity in engine - hash table specifically
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-85758@lists.php.net to get a copy of this message
Fancois, On Apr 9, 2015 10:16 AM, "François Laupretre" <francois@php.net> wrote: > > > De : Anthony Ferrara [mailto:ircmaxell@gmail.com] > > > > If we were using a pure abstraction (only accessing the hash table > > information through the public API), then fine because it's isolated. > > However, many extensions and even places in core access hash table > > structure directly (as can be seen by the updates needed by > > https://github.com/php/php- > > src/commit/2b42d719084631d255ec7ebb6c2928b9339915c2). > > Meaning the complexity isn't encapsulated. > > IMHO, that's the main problem. If a piece of code is accessed through an official published API only, its internal complexity can grow, provided the API still provides the same services. So, the first step should be to define and publish an 'official' full-featured API. We already have one. The public API defined in zend_hash.h (all methods and macros not prefixed with "_"). And my argument would be if code outside of zend_hash.(c|h) needs to access the internal hash table structure for anything (a public API doesn't serve the needs), then a new macro or API should be introduced for that use-case (so that it doesn't need to access the structure anymore). Anthony

« previous php.internals (#85758) next »