October 29, 2012
On 10/29/2012 2:49 AM, Jacob Carlborg wrote:
>> You'll see the same complaints from the same people appearing for C code
>> being linked, which does not have mangled names.
>
> You still don't get any source location.

It's usually pretty obvious, but when it isn't, I use:

    grep -r symbol_name *.d

or whatever search function your IDE has.


>> http://www.digitalmars.com/ctg/OptlinkErrorMessages.html#symbol_undefined
>
> That's only for optlink.

True, but the suggestions for what to do next apply to any linker.


>> *Every* programmer should know what a linker does.
>
> I agree with you, but again, that's not the world we live in. On the other hand,
> why does, say, an PHP (insert your favorite dynamic programming language that
> doesn't use a linker) programmer need to know what a linker is?

Because it's a fundamental tool for programmers, despite PHP not using it. It's like knowing what a CPU register is.
October 29, 2012
On 29/10/2012 18:38, Walter Bright wrote:
> On 10/29/2012 2:49 AM, Jacob Carlborg wrote:
>  >> You'll see the same complaints from the same people appearing for C
> code
>  >> being linked, which does not have mangled names.
>  >
>  > You still don't get any source location.
>
> It's usually pretty obvious, but when it isn't, I use:
>
>      grep -r symbol_name *.d
>
> or whatever search function your IDE has.
>
>
>  >>
> http://www.digitalmars.com/ctg/OptlinkErrorMessages.html#symbol_undefined
>  >
>  > That's only for optlink.
>
> True, but the suggestions for what to do next apply to any linker.
>
>
>  >> *Every* programmer should know what a linker does.
>  >
>  > I agree with you, but again, that's not the world we live in. On the
> other hand,
>  > why does, say, an PHP (insert your favorite dynamic programming
> language that
>  > doesn't use a linker) programmer need to know what a linker is?
>
> Because it's a fundamental tool for programmers, despite PHP not using
> it. It's like knowing what a CPU register is.
Haha, I know a lot of professional programmers who do not know the difference between the stack and the heap but still are able to write useful code.
You really seem to be lurking way too much on newsgroups with knowledgeable people ;)
October 29, 2012
On Sunday, 28 October 2012 at 20:59:25 UTC, Walter Bright wrote:
> On 10/28/2012 1:34 PM, deadalnix wrote:
>> As Andrei stated, the linker's native language is encrypted klingon.
>
> It baffles me that programmers would find "undefined symbol" hard to make sense of.

_D3yeah9whats82__T4soS36_D4hard4toFZv9__lambda1FNaNbNfiiZbVE3understand9about12this

;-)

Seriously though, it's irrelevant. The fact is a lot of programmers, especially new programmers or ones from programming languages that don't use linkers find link errors scary and confusing.

Pretending otherwise gets us nowhere.

Saying it baffles you why things are this way gets us nowhere.

Saying that "they should understand" gets us nowhere.
October 29, 2012
On 10/29/12 2:10 PM, Peter Alexander wrote:
> On Sunday, 28 October 2012 at 20:59:25 UTC, Walter Bright wrote:
>> On 10/28/2012 1:34 PM, deadalnix wrote:
>>> As Andrei stated, the linker's native language is encrypted klingon.
>>
>> It baffles me that programmers would find "undefined symbol" hard to
>> make sense of.
>
> _D3yeah9whats82__T4soS36_D4hard4toFZv9__lambda1FNaNbNfiiZbVE3understand9about12this
>
>
> ;-)
>
> Seriously though, it's irrelevant. The fact is a lot of programmers,
> especially new programmers or ones from programming languages that don't
> use linkers find link errors scary and confusing.
>
> Pretending otherwise gets us nowhere.
>
> Saying it baffles you why things are this way gets us nowhere.
>
> Saying that "they should understand" gets us nowhere.

I agree (and was about to post something very close to this). I've heard many times about this particular baffling, and it's one of those cases in which clearly people who are otherwise competent have quite a bit of difficulty. So one reasonable resolution is "well that's how people are, and that you think differently doesn't solve the matter one bit, so let's see what steps to take on improving it".

From what I can tell here's how to solve linker error issues:

1. Automatic demangling of the symbols involved must be in place.

2. For undefined symbols, there must be reference at source file and line level of where they are referred - /all/ places!

3. For multiply defined symbols, there must be reference at source file and line level for each definition.

I understand there are technical difficulties in implementing the above, but that doesn't justify being baffled.

Being baffled is not an option.


Andrei
October 29, 2012
On Mon, Oct 29, 2012 at 07:05:33PM +0100, Faux Amis wrote:
> On 29/10/2012 18:38, Walter Bright wrote:
> >On 10/29/2012 2:49 AM, Jacob Carlborg wrote:
[...]
> > > I agree with you, but again, that's not the world we live in. On the other hand, why does, say, an PHP (insert your favorite dynamic programming language that doesn't use a linker) programmer need to know what a linker is?
> >
> >Because it's a fundamental tool for programmers, despite PHP not using it. It's like knowing what a CPU register is.
> Haha, I know a lot of professional programmers who do not know the difference between the stack and the heap but still are able to write useful code.

The kind of code the average "professional" programmer produces is ... shall I say, underwhelming? It's the kind of thing that makes me consider career switches. Raising the bar for programmer qualification will do the world a lot of good.


T

-- 
In theory, there is no difference between theory and practice.
October 29, 2012
On 2012-10-29 19:05, Faux Amis wrote:

> Haha, I know a lot of professional programmers who do not know the
> difference between the stack and the heap but still are able to write
> useful code.
> You really seem to be lurking way too much on newsgroups with
> knowledgeable people ;)

I completely agree. I can probably count the number of PHP developer who know what a CPU resister is on one hand. Let me add to that: Ruby, JavaScript, Python and a bunch of other languages.

-- 
/Jacob Carlborg
October 29, 2012
On 2012-10-29 20:00, H. S. Teoh wrote:

> The kind of code the average "professional" programmer produces is ...
> shall I say, underwhelming? It's the kind of thing that makes me
> consider career switches. Raising the bar for programmer qualification
> will do the world a lot of good.

Absolutely. The bar is not set very high.

-- 
/Jacob Carlborg
October 29, 2012
On 2012-10-29 19:19, Andrei Alexandrescu wrote:

> I agree (and was about to post something very close to this). I've heard
> many times about this particular baffling, and it's one of those cases
> in which clearly people who are otherwise competent have quite a bit of
> difficulty. So one reasonable resolution is "well that's how people are,
> and that you think differently doesn't solve the matter one bit, so
> let's see what steps to take on improving it".
>
>  From what I can tell here's how to solve linker error issues:
>
> 1. Automatic demangling of the symbols involved must be in place.
>
> 2. For undefined symbols, there must be reference at source file and
> line level of where they are referred - /all/ places!
>
> 3. For multiply defined symbols, there must be reference at source file
> and line level for each definition.
>
> I understand there are technical difficulties in implementing the above,
> but that doesn't justify being baffled.
>
> Being baffled is not an option.

Well said.

-- 
/Jacob Carlborg
October 29, 2012
On 29/10/2012 20:00, H. S. Teoh wrote:
> On Mon, Oct 29, 2012 at 07:05:33PM +0100, Faux Amis wrote:
>> On 29/10/2012 18:38, Walter Bright wrote:
>>> On 10/29/2012 2:49 AM, Jacob Carlborg wrote:
> [...]
>>>> I agree with you, but again, that's not the world we live in. On
>>>> the other hand, why does, say, an PHP (insert your favorite
>>>> dynamic programming language that doesn't use a linker) programmer
>>>> need to know what a linker is?
>>>
>>> Because it's a fundamental tool for programmers, despite PHP not
>>> using it. It's like knowing what a CPU register is.
>> Haha, I know a lot of professional programmers who do not know the
>> difference between the stack and the heap but still are able to write
>> useful code.
>
> The kind of code the average "professional" programmer produces is ...
> shall I say, underwhelming? It's the kind of thing that makes me
> consider career switches. Raising the bar for programmer qualification
> will do the world a lot of good.
>
>
> T
>
I am not sure that less programmers would be a good thing for the world.

But, I have seen people who know all the ins and outs of their machine create horrible code which I will never allow to merge and people who barely know what a pointer is generate very clean, readable and usable code.
October 29, 2012
On Mon, 29 Oct 2012, Andrei Alexandrescu wrote:
> On 10/29/12 2:10 PM, Peter Alexander wrote:
> > On Sunday, 28 October 2012 at 20:59:25 UTC, Walter Bright wrote:
> > 
> > Seriously though, it's irrelevant. The fact is a lot of programmers, especially new programmers or ones from programming languages that don't use linkers find link errors scary and confusing.
> > 
> > Pretending otherwise gets us nowhere.
> > 
> > Saying it baffles you why things are this way gets us nowhere.
> > 
> > Saying that "they should understand" gets us nowhere.
> 
> I agree (and was about to post something very close to this). I've heard many times about this particular baffling, and it's one of those cases in which clearly people who are otherwise competent have quite a bit of difficulty. So one reasonable resolution is "well that's how people are, and that you think differently doesn't solve the matter one bit, so let's see what steps to take on improving it".
> 
> From what I can tell here's how to solve linker error issues:
> 
> 1. Automatic demangling of the symbols involved must be in place.
> 
> 2. For undefined symbols, there must be reference at source file and line level of where they are referred - /all/ places!
> 
> 3. For multiply defined symbols, there must be reference at source file and line level for each definition.
> 
> I understand there are technical difficulties in implementing the above, but that doesn't justify being baffled.
> 
> Being baffled is not an option.
> 
> 
> Andrei

There's another angle to this:

1) It's been stated more than once that one of the goals for D is to achieve a user base of over 1 million users.

2) I assert that there aren't more than 1 million programmers with the level of expertise and experience required to understand what happens during compilation to a sufficient degree that they feel comfortable with the tool chains that D (and c and c++) have today.

Conclusion, the tool chains must get more user friendly.