std.regexp vs std.regex [Re: RegExp.find() now crippled]

Jonathan M Davis jmdavisProg at gmx.com
Tue Nov 16 11:24:02 PST 2010


On Tuesday, November 16, 2010 10:30:03 Steven Schveighoffer wrote:
> The standard library should not have something to please everyone.  If
> there is 5 different styles to do the same thing, it will be a failure.

Agreed. Ideally, the standard library would be very uniform in approach. That 
makes it easier to learn and use. If it's schizophrenic about it's approach - 
especially if it has multiple ways of doing everything - then it's going to be 
much harder to learn and use. Everyone would be asking why you'd choose one way 
over another and what the differences between them are. It would just cause 
confusion.

Ranges are a key element of how Phobos does things in D2. The truth of the 
matter is that if you want to effectively use Phobos, you're going to have to use 
ranges. If ranges aren't appropriate for a particular module or problem, then 
they shouldn't be used, but Phobos is generally being built around using them, 
and the more of Phobos which functions in essentially the same way, the easier 
it will be to understand, learn, and use.

The old code is indeed available for modules which are going to be 
deprecated/removed, and the license is usually Boost, so you're pretty free to 
do what you want with it if you prefer it. And there's nothing wrong with 
creating your own libraries if you'd prefer. Plenty of folks have done that in 
the past.

The standard library needs to be fairly uniform in approach, however, and some 
of the current modules are older and don't follow that approach or have 
licensing or design issues which were not addressed in the past. Once all of 
those modules have been updated, replaced, or removed, Phobos will be more 
uniform and its parts will interact better. And over time, it's unlikely that 
modules will continue to be deprecated like that. It's happening now because D2 
Phobos is still fairly early in its evolution.

- Jonathan M Davis


More information about the Digitalmars-d mailing list