On 9 October 2013 09:05, Walter Bright <newshound2@digitalmars.com> wrote:
On 10/8/2013 12:34 PM, Jonathan M Davis wrote:
I think that it's clear that for some projects, it's critical to minimize the
GC, and I think that it's clear that we need to do a better job of supporting
the folks who want to minimize GC usage, but I also think that for the vast
majority of cases, complaints about the GC are way overblown. It becomes an
issue when you're doing a lot of heap allocations, but it's frequently easy to
design D code so that heap allocations are relatively rare such that they
aren't going to be a serious problem outside of code which is performance
critical to the point that it would be worrying about the cost of malloc
(which most code isn't). Personally, the only time that I've run into issues
with the GC is when trying to do use RedBlackTree with a lot of items. That
has a tendancy to tank performance.

So, yes, it's problem. Yes, we need to improve the situaton. But for most
situations, I think that the concern about the GC is way overblown.

+1

Some years ago, a colleague of mine moonlighted teaching remedial algebra at the UW. She'd write on the board:

   x + 2 = 5

and call on a student to "solve for x". The student would collapse in a stuttering heap of jelly, emitting sparks and smoke like a Star Trek computer. She discovered that if she wrote instead:

   _ + 2 = 5

and would ask the same student what goes in the blank spot, he'd say "3" without hesitation.

In other words, the student would only see the words "solve", "x", and "algebra" which were a shortcut in his brain to "I can't do this" and "gee math is hard." She found she was a far more effective teacher by avoiding using those words.

I realized the same thing was happening with the word "template". I talked Andrei into avoiding all use of that word in "The D Programming Language", figuring that we could get people who were terrified of "templates" to use them successfully without realizing it (and I think this was very successful).

We have a similar problem with "GC". People hear that word, and they are instantly turned off. No amount of education will change that. We simply have to find a better way to deal with this issue.

I think there is certainly an element of this. When someone identifies something in their code that consistently causes issues, they tend to ban it, rather than try and understand it better.
I will admit to being absolutely guilty of this in the past myself. We banned STL and the template keyword outright (not so uncommon in the games industry). But the problem is not so simple as taking the time to understand something thoroughly...
People often forget that programmers work in large teams, and typically, about 30-40% of those programmers are junior, and a further 30-50% are just average-joe programmers for who it's a day job, and don't really give a shit.
The take-away is, if a couple of guys grapple with something that's a consistent problem and find a very specific (possibly obscure) usage that doesn't violate their criteria, they then have a communication issue with a whole bunch of other inexperienced or apathetic programmers, which I can assure you, is an endless up-hill battle.
It's usually easier to ban it, and offer a slightly less pleasant, but reliable alternative instead. Unless you feel it's a good use of time and money to have your few best senior programmers trawling through code finding violations of standard practise and making trivial (but hard to find/time consuming) fixes on build nights.

The (existing) GC definitely fits this description in my mind.