Blog post: What D got wrong

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Dec 19 02:02:43 UTC 2018


On Tue, Dec 18, 2018 at 06:53:02PM -0700, Jonathan M Davis via Digitalmars-d-announce wrote:
[...]
> I confess that I do tend to think about things from the standpoint of
> a library designer though, in part because I work on stuff like
> Phobos, but also because I tend to break up my programs into libraries
> as much as reasonably possible. In general, the more that's in a
> reusable, easily testable library the better. And with that approach,
> a lot less of the code for your programs is actually in the program
> itself, and the attributes tend to matter that much more.
[...]

My recent programming style has also become very library-like, often
with standalone library-style pieces of code budding off a messier,
experimental code in main() (and ultimately, if the project is
long-lasting, main() itself becomes stripped down to the bare
essentials, just a bunch of library components put together).  But I've
not felt a strong urge to deal with attributes in any detailed way;
mostly I just templatize everything and let the compiler do attribute
inference on my behalf. For the few cases where explicit attributes
matter, I still only use the bare minimum I can get away with, and
mostly just enforce template attributes using the unittest idiom rather
than bother with writing explicit attributes everywhere in the actual
code.


T

-- 
He who sacrifices functionality for ease of use, loses both and deserves neither. -- Slashdotter


More information about the Digitalmars-d-announce mailing list