<div dir="ltr">On 9 October 2013 09:05, Walter Bright <span dir="ltr"><<a href="mailto:newshound2@digitalmars.com" target="_blank">newshound2@digitalmars.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 10/8/2013 12:34 PM, Jonathan M Davis wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I think that it's clear that for some projects, it's critical to minimize the<br>
GC, and I think that it's clear that we need to do a better job of supporting<br>
the folks who want to minimize GC usage, but I also think that for the vast<br>
majority of cases, complaints about the GC are way overblown. It becomes an<br>
issue when you're doing a lot of heap allocations, but it's frequently easy to<br>
design D code so that heap allocations are relatively rare such that they<br>
aren't going to be a serious problem outside of code which is performance<br>
critical to the point that it would be worrying about the cost of malloc<br>
(which most code isn't). Personally, the only time that I've run into issues<br>
with the GC is when trying to do use RedBlackTree with a lot of items. That<br>
has a tendancy to tank performance.<br>
<br>
So, yes, it's problem. Yes, we need to improve the situaton. But for most<br>
situations, I think that the concern about the GC is way overblown.<br>
</blockquote>
<br></div>
+1<br>
<br>
Some years ago, a colleague of mine moonlighted teaching remedial algebra at the UW. She'd write on the board:<br>
<br>
x + 2 = 5<br>
<br>
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:<br>
<br>
_ + 2 = 5<br>
<br>
and would ask the same student what goes in the blank spot, he'd say "3" without hesitation.<br>
<br>
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.<br>
<br>
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).<br>
<br>
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.<br>
</blockquote></div><br></div><div class="gmail_extra">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.</div>
<div class="gmail_extra">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...</div>
<div class="gmail_extra">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.<br>
</div><div class="gmail_extra">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.</div>
<div class="gmail_extra">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.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">The (existing) GC definitely fits this description in my mind.</div></div>