Using D

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 11 10:49:38 PDT 2014


On Fri, Jul 11, 2014 at 05:39:30PM +0000, Chris via Digitalmars-d wrote:
[...]
> Thanks. That's a nice list. This is what I was talking about, the
> experience with D, what you can achieve with it and how it compares
> with other languages. We need more of this. I have the feeling
> sometimes that to an outsider D might look like an eternally
> unfinished business. A nice playground for programmers, but not for
> production, which is absolutely not true. The GC issue is sometimes
> presented as "the language will stand or fall with this". As you noted
> and which is also my experience, the GC issue ain't that big. 90-95%
> of all applications can live with it.

Oh, and how did I forget UFCS? I think some of us were a bit hesitant
about this at first, but coupled with ranges, it has opened up a whole
new way of writing (and thinking about) your program:

	// UFCS FTW! ;-)
	auto formatYear(int year, int monthsPerRow)
	{
		return datesInYear(year)
			.byMonth()
			.chunks(monthsPerRow)
			.map!(row => row.formatMonths()
					.array()
					.pasteBlocks(colSpacing)
					.join("\n"))
			.join("\n\n");
	}

(Shamelessly quoted from my article:

	http://wiki.dlang.org/Component_programming_with_ranges

;-))


T

-- 
Don't modify spaghetti code unless you can eat the consequences.


More information about the Digitalmars-d mailing list