"with" should be deprecated with extreme prejudice

Nick Sabalausky a at a.a
Mon May 18 12:53:57 PDT 2009


"Nick Sabalausky" <a at a.a> wrote in message 
news:guscm2$2jff$1 at digitalmars.com...
> "Don" <nospam at nospam.com> wrote in message 
> news:gurkuo$17nv$1 at digitalmars.com...
>> Nick Sabalausky wrote:
>>> "Don" <nospam at nospam.com> wrote in message 
>>> news:gur1ec$18a$1 at digitalmars.com...
>>>> If warnings exist, libraries must not do anything that creates a 
>>>> warning. They are NOT optional.
>>>
>>> That's only true if a compiler (such as DMD) is only capable of treating 
>>> warnings as errors.
>>
>> No. Users complain if library code generates warnings. Because a user 
>> cannot make their code warning-free if the libraries they use are 
>> generating warnings.
>
> They can if they use a prebuilt version of the library, a lib/a/dll.

Warnings are optional built-in lint tools (kinda like how we already have a 
built-in doc tool, built-in code generation tool (ie, mixins), built-in 
profiling/code-coverage, etc). And it's pretty difficult to claim that lint 
tools are bad. So deciding that (optional) warnings are bad just because 
some people might get warnings from a non-pre-compiled lib and then bitch 
about it is a rather large case of "throwing away the baby with the 
bathwater".

And even aside from pre-compiled lib's (which admittedly probably wouldn't 
work for template-using libs, although I consider that more a problem with 
the existing obj/lib formats than anything else), there are still other 
solutions that don't "throw away the baby with the bathwater". Like maybe a 
switch that only enables warnings for anything in the same package as 
"main". Or "-warn=this.package.only", or "-nowarn=tango", etc.

And before anyone notices that I've filed a bug report in tango for a 
warning despite my "complaining about warnings in libs is silly" stance, 
I'll point out that I've filed bug reports for warnings in libs *only* 
because DMD refuses to allow warnings to actually be treated as warnings (or 
at least until bugzilla #2567 (with patch) gets taken care of). Yes, under 
current versions of DMD, fixing warnings are manditory for libs. But that's 
only because DMD's current handling of "warnings" is one hell of a bizarre 
anomoly (ie, In DMD, "warnings" are really "optional errors" at this point, 
*not* true warnings. And yes, *that* kind of so-called "warning" *is* a bad 
thing).





More information about the Digitalmars-d mailing list