On 4 December 2010 15:18, Abigail <abig...@abigail.be> wrote: > On Fri, Dec 03, 2010 at 05:08:42PM -0800, chromatic wrote: >> On Friday 03 December 2010 at 16:53, Leon Timmermans wrote: >> >> > We do, honestly. I'm tired of having to explain to newbies why the >> > official perl documentation is not strict friendly, when I tell them >> > they should use strict. **I don't know how to explain that to them**, >> > it simply doesn't compute. >> >> You've had the "But I copied and pasted it directly from the documentation, >> and now my program doesn't work anymore!" discussion too? > > > The point of the documentation isn't to supply a number of code fragments, > so newbies can program by just cut-and-pasting.
I consider that an incorrect assertion. It would be correct if you said "The point of the documentation isn't JUST to supply a number of code fragments". I would argue that one of the points of the documents is to do exactly that. The documentation has other purposes, but one of them is to help beginners learn to program. I don't think there is any debate on that as I have seen quotes from Larry basically saying the entire language was designed to make it easy for beginners to be productive. It seems to me having a usable set of code fragments is part of that. > The examples are code *FRAGMENTS*. Some assembly required. We cannot guess > what the scope of the variables in the code that's cut-and-pasted anyway. Well, that is not entirely correct. Some /are/ full blown programs. And IMO as such should use some of what I would consider to be the less controversial aspects of newer style. I think maybe there is some dividing line between examples which are meant to be succinct and demonstrate only one particular thing, and larger examples which while intended to demonstrate some particular issue, or whatnot, should probably also be usable by beginners as building blocks, and be a *solid* foundation for building on - and to me, that DOES I am afraid mean a different style than Tom's. I'm thinking here in particular of global filehandles, and lexical scoped variables. I respect that Tom sees things differently, but I feel on these two at least that he is wrong. And the arguments I have seen from him in regard to justifying his position on these ones isn't to me very compelling. > But I guess the general population is dumbing down in at an alarming rate. Whatever. :-) If one reads various literature of the past, well, as long as humans have been writing stuff down there is always someone bemoaning the dumbing down, the loss of tradition, the loss of manners or whatnot of the previous generation. I bet there is a cuneiform tablet out there in some deseret somewhere basically saying "These upstart kids have no respect and no clue".... :-) > Cookbooks need detailed instructions, including pictures, on how to peel > potatoes before boiling them, That is more an indictment of the fast-food era than a question of dumbing down. If the only potato you ever saw in your life came out of a box, or presliced from the freezer.... > newbies can only program by cut and pasting piecemeal chunks. I don't buy that. Lots and lots and lots of programmers, including well known ones, started off by typing example programs into their computers. I remember the first programs I wrote when I was a kid were direct copies from the manuals that came with the Pet computer. They amounted to small routines that made it look like a ball was bouncing around the screen. I then learned that I could combine them in interesting ways, and eventually wrote a game. I never would have gotten there if the code didnt work as printed in the manual. Later in my career I have learned several languages by cutting and pasting code snippets that I found from places to achieve the results I needed - I bet a LOT of people learn Javascript that way, and learning by trial and error. I am convinced that of the people on this list besides maybe yourself, that each one has learned at least one language this way. Makefiles anyone? HTML Markup maybe? SQL possible? Javascript? Maybe Python? Maybe even C. I think the examples, except when very short, or where it would clearly distract from the intent, *should* be building blocks intended for beginners to reuse. Everything we can do to expand the usage and audience of Perl is good for those of us who are professional Perl programmers - it means we will have a Job for a long time coming. Even if it is just repairing crappy code. :-) So just think of it this way, you just might be arguing against something that one day will make your job a lot easier... ;-) Lets not forget that the audience for these things may well be children, they may be professionals with no real programming knowledge, they may be people whose only knowledge of programming is Visual Basic for Applications. They wont just be graduated computer science professionals. cheers, Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"