Learning With D

2011-05-22 Thread Jesse Phillips
Hello,

I am making this announcement since there is an article contest and this might 
fit into that. I started writing what I hoped would turn into a fairly complete 
book. I am releasing the current content under the creative commons license. If 
this is reasonable for submission in the contest the great, but I just thought 
it would be good to get what I have out there while a number of other articles 
are going to be getting some attention. Now on to the details.

This book is intended to teach programming from the ground up. As such it isn't 
about comparing languages or discussing specific features. We all know D would 
make a very good first language, and I want to provide some material that makes 
this possible. And I really want the user to go from first time Python 
programmer to basic C programmer.

While I am no where near complete and I really have never worked out an 
outline, I am providing both a PDF and a tex file for those that actually know 
what they are doing. One approach that I think many will like is the Common 
Errors sections which is meant to help people identify what the compiler is 
saying when things go wrong.

http://nascent.freeshell.org/programming/D/LearningWithD.pdf
http://nascent.freeshell.org/programming/D/LearningWithD.tex


Re: Learning With D

2011-05-22 Thread bearophile
Jesse Phillips:

 We all know D would make a very good first language, and I want to provide 
 some material that makes this possible.

This is a very interesting experiment, thank you for writing it.

Regarding languages to be used as first language for adults or near-adults, I 
think there is no very good language for this purpose (for children the 
situation is better, there are many Logo variants, some graphical languages, 
etc). And even if you invent a language very good for this purpose, probably no 
one uses it, there are no libs and ecosystem for it, so it keeps being a mostly 
useless and buggy toy. I don't see many ways out of this situation.

Bye,
bearophile


Re: Learning With D

2011-05-22 Thread Ali Çehreli

On 05/21/2011 11:12 PM, Jesse Phillips wrote:

 I started writing what I hoped would turn into a fairly
 complete book.

Thank you for doing this! :)

 This book is intended to teach programming from the ground
 up.

I have some experience in doing the same. Just like teaching in the 
classroom, no matter what style or detail has been chosen, readers will 
find the material anywhere from very easy to exteremly difficult. :)


One (draft of an) article on teaching programming that had struck a 
chord with me has been


  http://www.cs.mdx.ac.uk/research/PhDArea/saeed/paper1.pdf

They divide the students in three groups. They argue that the ones that 
are successful in programming are the ones who can form consistent 
models for unknown phenomena. (Not their exact words, but what I got out 
of the paper.)


 We all know D would make a very good first language

Agreed. Although there are so many high level concepts in the language, 
starting to write simple programs is very easy. For example, one can go 
a long way without even knowing that pointers exist. Additionally, 
having to introduce the concept of a reference type earlier makes it 
easy to explain pointers later on.


 And I really want the user to go from first time Python
 programmer to basic C programmer.

I think, that is a more accurate description than the one in Chapter 1: 
(expected starting experience of none). I can imagine that some people 
will find your book a little too fast. (And others will find it too 
slow! :))


 One approach that I think many will like is the Common Errors
 sections which is meant to help people identify what the
 compiler is saying when things go wrong.

That is going to be very helpful.

Thank you,
Ali



Re: Learning With D

2011-05-22 Thread Daniel Gibson
Am 23.05.2011 01:29, schrieb Ali Çehreli:
 On 05/21/2011 11:12 PM, Jesse Phillips wrote:
 
 I started writing what I hoped would turn into a fairly
 complete book.
 
 Thank you for doing this! :)
 
 This book is intended to teach programming from the ground
 up.
 
 I have some experience in doing the same. Just like teaching in the
 classroom, no matter what style or detail has been chosen, readers will
 find the material anywhere from very easy to exteremly difficult. :)
 
 One (draft of an) article on teaching programming that had struck a
 chord with me has been
 
   http://www.cs.mdx.ac.uk/research/PhDArea/saeed/paper1.pdf
 
 They divide the students in three groups. They argue that the ones that
 are successful in programming are the ones who can form consistent
 models for unknown phenomena. (Not their exact words, but what I got out
 of the paper.)
 
 We all know D would make a very good first language
 
 Agreed. Although there are so many high level concepts in the language,
 starting to write simple programs is very easy. For example, one can go
 a long way without even knowing that pointers exist. Additionally,
 having to introduce the concept of a reference type earlier makes it
 easy to explain pointers later on.
 

I think explaining pointers first (including you have to dereference it
to get to the thing it's pointing at, to show the difference between
pointer and pointee) may be a better idea.
After that you can say and objects of classes are reference types, they
behave like pointers but don't need all the ugly syntax

And I think http://www.youtube.com/watch?v=i49_SNt4yfk is a great video
explaining pointers ;)

 And I really want the user to go from first time Python
 programmer to basic C programmer.
 
 I think, that is a more accurate description than the one in Chapter 1:
 (expected starting experience of none). I can imagine that some people
 will find your book a little too fast. (And others will find it too
 slow! :))
 
 One approach that I think many will like is the Common Errors
 sections which is meant to help people identify what the
 compiler is saying when things go wrong.
 
 That is going to be very helpful.
 
 Thank you,
 Ali
 



Re: Learning With D

2011-05-22 Thread Emil Madsen
On 22 May 2011 22:26, bearophile bearophileh...@lycos.com wrote:

 Jesse Phillips:

  We all know D would make a very good first language, and I want to
 provide some material that makes this possible.

 This is a very interesting experiment, thank you for writing it.

 Regarding languages to be used as first language for adults or near-adults,
 I think there is no very good language for this purpose (for children the
 situation is better, there are many Logo variants, some graphical languages,
 etc). And even if you invent a language very good for this purpose, probably
 no one uses it, there are no libs and ecosystem for it, so it keeps being a
 mostly useless and buggy toy. I don't see many ways out of this situation.

 Bye,
 bearophile


Well about learning a programming language as your first; I really think its
worth considering that several universities (AU atleast) introduces their
students to programming, using java, simply because it offers several
pedagogical learning tools alike; Greenfoot, that makes the introduction
more of a game than really an exercise.

I honestly think, it would make D more attractive as a first language to
learn, if it had these 'pedagogical' teaching tools.

-- 
// Yours sincerely
// Emil 'Skeen' Madsen


Re: Learning With D

2011-05-22 Thread Ali Çehreli

On 05/22/2011 04:36 PM, Daniel Gibson wrote:


And I think http://www.youtube.com/watch?v=i49_SNt4yfk is a great video
explaining pointers ;)


Yes, funny. :) But as some of the comments show, there are bad practices 
like not initializing the pointers. I wonder whether the person who 
wrote the accompanying code has experience with pointers. ;)


Also, the fact that the pointee is allocated with 'new' is adding 
confusion to the already confusing matter. Allocating by new is a 
lifetime issue and has nothing to do with being a pointee. It also makes 
one wonder whether the int should not be guarded by a smart pointer.


Ali