Why is D unpopular?

max haughton maxhaton at gmail.com
Fri Jun 10 19:52:15 UTC 2022


On Friday, 10 June 2022 at 19:37:37 UTC, H. S. Teoh wrote:
> On Fri, Jun 10, 2022 at 07:22:51PM +0000, mw via Digitalmars-d 
> wrote: [...]
>> How come the DMD frontend is in such terrible state?
>
> Because:
>
> 	https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/
>
> Selected quotes:
>
> 	[...] you can ask almost any programmer today about the code
> 	they are working on. “It’s a big hairy mess,” they will tell
> 	you.  “I’d like nothing better than to throw it out and start
> 	over.”
>
> 	Why is it a mess?
>
> 	“Well,” they say, “look at this function. It is two pages long!
> 	None of this stuff belongs in there! I don’t know what half of
> 	these API calls are for.”
>
> 	[...]
>
> 	Yes, I know, it’s just a simple function to display a window,
> 	but it has grown little hairs and stuff on it and nobody knows
> 	why. Well, I’ll tell you why: those are bug fixes. One of them
> 	fixes that bug that Nancy had when she tried to install the
> 	thing on a computer that didn’t have Internet Explorer. Another
> 	one fixes that bug that occurs in low memory conditions. 
> Another
> 	one fixes that bug that occurred when the file is on a floppy
> 	disk and the user yanks out the disk in the middle. That
> 	LoadLibrary call is ugly but it makes the code work on old
> 	versions of Windows 95.
>
> 	Each of these bugs took weeks of real-world usage before they
> 	were found. The programmer might have spent a couple of days
> 	reproducing the bug in the lab and fixing it. If it’s like a 
> lot
> 	of bugs, the fix might be one line of code, or it might even be
> 	a couple of characters, but a lot of work and time went into
> 	those two characters.
>
> 	When you throw away code and start from scratch, you are
> 	throwing away all that knowledge. All those collected bug 
> fixes.
> 	Years of programming work.
>
>
> T

No it really is bad. Some newer areas are ok but the quality of 
the code is overall just bad, relies on enormous amounts of 
mutability, doesn't have a proper opinion about how to resolve 
symbols (it only has 3 passes), tries to make decision before 
properly analyzing the problem etc.

The compiler is mostly reasonable semantically because D is a 
conventional language, but several key parts of the logic are 
either extremely old messy bits of code that basically cannot be 
easily changed or types with a very sloppy heritage that lead to 
an explosion of edge cases all over the place: Array, Struct, and 
Int32 are all considered to be the same type of thing according 
to the enum at the heart of the class that represents types, it's 
ad-hoc "eh just ship it code" that almost no one can be bothered 
to fix because they've either been scared off from working on the 
compiler because of aforementioned warts or because they've tried 
to divide and conquer the cleanup efforts and been told no.

Probably 40% of the bug fixes of the kind you posit are *because* 
of the frontend being unreliable.


More information about the Digitalmars-d mailing list