www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Please Vote: Exercises in TDPL?

reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering 
whether I should be adding exercises to the book. Some books have them, 
some don't.

Pros: As I'm writing, I've come up with some pretty darn cool exercise 
ideas.

Cons: The book gets larger, takes longer to write, and I never solved 
the exercises in the books I've read, but then I'm just weird.

What do you think?


Thanks,

Andrei
May 14 2009
next sibling parent Jason House <jason.james.house gmail.com> writes:
Andrei Alexandrescu Wrote:

 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering 
 whether I should be adding exercises to the book. Some books have them, 
 some don't.
 
 Pros: As I'm writing, I've come up with some pretty darn cool exercise 
 ideas.
 
 Cons: The book gets larger, takes longer to write, and I never solved 
 the exercises in the books I've read, but then I'm just weird.
 
 What do you think?
 
 
 Thanks,
 
 Andrei

I rarely do exercises, but I think they may be good for learning metaprogramming. It may even be a fun to use this list for providing exercises and solutions.
May 14 2009
prev sibling next sibling parent reply BCS <none anon.com> writes:
Hello Andrei,

 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm
 pondering whether I should be adding exercises to the book. Some books
 have them, some don't.
 
 Pros: As I'm writing, I've come up with some pretty darn cool exercise
 ideas.
 
 Cons: The book gets larger, takes longer to write, and I never solved
 the exercises in the books I've read, but then I'm just weird.
 
 What do you think?
 
 Thanks,
 
 Andrei
 

Pros: someone might use it in a metaprograming class :D cons: someone might thing it's /only/ a textbook.
May 14 2009
parent Sam Hu <samhudotsamhu gmail.com> writes:
Sorry for my stepping in since this is about  learning and I am a student who
is eager to learn D throughy and completely.
I highly recommand it is a must have if possible to include exercise.Students
need to do tons of homework to get familar with the new features.
I also recommand it is a "better-to-have" if possible to include data structure
and algorithm implemented in the said laguage.Interpret the implementation from
one laguage to another laguage is not a good idea esp. there is a big
difference between the 2.
If the volume and completion date is a problem,I would like to suggest separate
the textbook into several part,the foundamental,the data structure &
algorithm,the exercise & solution,so you can well plan your schedule and
publish one by one with no rush.

By large,I would like to use one high qulity & complete reference book/textbook
which including almost everything need to know  to guide me on the way to
programming D,esp. at present sturctured and systematic D learning source is so
precious.

P.S:I could not wait any longer for your book :D

Best Regards,
Sam
May 14 2009
prev sibling next sibling parent reply zkp0s <gerar1995 gmail.com> writes:
Andrei Alexandrescu wrote:
 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering 
 whether I should be adding exercises to the book. Some books have them, 
 some don't.
 
 Pros: As I'm writing, I've come up with some pretty darn cool exercise 
 ideas.
 
 Cons: The book gets larger, takes longer to write, and I never solved 
 the exercises in the books I've read, but then I'm just weird.
 
 What do you think?
 
 
 Thanks,
 
 Andrei

being filled of exercises, but some understandable exercises that might be (very) helpful. I think it would be great to see some appliances (step-by-step) of the lessons, somthing like "ordering with binary trees" in "arrays". By the way. Is d2 focused? is it like a textbook or a reference book? best regards, zk
May 14 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
zkp0s wrote:
 Andrei Alexandrescu wrote:
 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm 
 pondering whether I should be adding exercises to the book. Some books 
 have them, some don't.

 Pros: As I'm writing, I've come up with some pretty darn cool exercise 
 ideas.

 Cons: The book gets larger, takes longer to write, and I never solved 
 the exercises in the books I've read, but then I'm just weird.

 What do you think?


 Thanks,

 Andrei

being filled of exercises, but some understandable exercises that might be (very) helpful. I think it would be great to see some appliances (step-by-step) of the lessons, somthing like "ordering with binary trees" in "arrays". By the way. Is d2 focused? is it like a textbook or a reference book?

D2 exclusively. Textbook modeled after K&R. Andrei
May 14 2009
next sibling parent reply grauzone <none example.net> writes:
 D2 exclusively. Textbook modeled after K&R.

Will D2 be finalized (similar to D1) when the book comes out?
May 14 2009
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
grauzone wrote:
 D2 exclusively. Textbook modeled after K&R.

Will D2 be finalized (similar to D1) when the book comes out?

That's the plan. Andrei
May 14 2009
prev sibling parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Andrei Alexandrescu wrote:

 By the way. Is d2 focused? is it like a textbook or a reference book?

D2 exclusively. Textbook modeled after K&R.

Will there be any GUI sections in D2 ? (or is that why they call it a textbook) --anders
May 15 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Anders F Björklund wrote:
 Andrei Alexandrescu wrote:
 
 By the way. Is d2 focused? is it like a textbook or a reference book?

D2 exclusively. Textbook modeled after K&R.

Will there be any GUI sections in D2 ? (or is that why they call it a textbook)

If you're asking whether TDPL will contain discussions on GUIs, it won't. The hope is that it will teach one D well enough to write programs effectively using any library, GUI or otherwise. Andrei
May 15 2009
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Andrei Alexandrescu wrote:

 Will there be any GUI sections in D2 ?

 (or is that why they call it a textbook)

If you're asking whether TDPL will contain discussions on GUIs, it won't. The hope is that it will teach one D well enough to write programs effectively using any library, GUI or otherwise.

I was just wondering whether it would cover any such libraries, but I understand that it won't. Thanks for answering, though. So, would there be any such libraries available for D2/Phobos ? Or maybe that can't be until the spec (or the book) is out... --anders
May 16 2009
parent Lutger <lutger.blijdestijn gmail.com> writes:
Anders F Björklund wrote:
...
 So, would there be any such libraries available for D2/Phobos ?
 Or maybe that can't be until the spec (or the book) is out...
 
 --anders

GtkD works with D2
May 17 2009
prev sibling next sibling parent Robert Fraser <fraserofthenight gmail.com> writes:
Andrei Alexandrescu wrote:
 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering 
 whether I should be adding exercises to the book. Some books have them, 
 some don't.
 
 Pros: As I'm writing, I've come up with some pretty darn cool exercise 
 ideas.
 
 Cons: The book gets larger, takes longer to write, and I never solved 
 the exercises in the books I've read, but then I'm just weird.
 
 What do you think?
 
 
 Thanks,
 
 Andrei

As long as they have solutions, they can supplement some examples.
May 14 2009
prev sibling next sibling parent reply "Nick Sabalausky" <a a.a> writes:
"Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message 
news:guibjc$2rha$1 digitalmars.com...
A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering 
whether I should be adding exercises to the book. Some books have them, 
some don't.

 Pros: As I'm writing, I've come up with some pretty darn cool exercise 
 ideas.

 Cons: The book gets larger, takes longer to write, and I never solved the 
 exercises in the books I've read, but then I'm just weird.

 What do you think?

Cons: I've never been much of a fan of them. Rarely look at them, and never do them. But more than that, I find opening a book and seeing of bunch of "exercises" and "end of chapter quizzes" rather off-putting. It typically makes a book come across as highly academic, and one of the (many) major problems with academia and academic texts is their tendency to follow a style of "Let's take their money (and double the price (or more) from what would typically be reasonable), and not actually give them any real information except (if we feel like it) some "info" that's incomplete, poorly explained, etc." I can come up with plenty of questions and problems on my own. If I buy a book (or take a class), it's because I want *answers* and *information*. If I want to work through it all on my own (and, hell, sometimes I do), then I can do that without f&*%^&* putting down the money for a book/class in the first place. Pros: "pretty darn cool exercise ideas", coming from Andrei? That does sound interesting. Color me intrigued. I'd say if you can do it without making it come across like an academic text at a flip-through, then go ahead. But don't go overboard, and definitely don't add those stupid/patronizing "exercises" that are really just questions which are blatantly answered earlier in the chapter (I hate those). An exercise is an exercise, but rewriting the same damn material in question form is just a waste of ink, paper and the reader's patience. Sorry...got a little carried away there... ;)
May 14 2009
next sibling parent reply grauzone <none example.net> writes:
 would typically be reasonable), and not actually give them any real 
 information except (if we feel like it) some "info" that's incomplete, 
 poorly explained, etc." I can come up with plenty of questions and problems 

Ah yes, if there are exercises, they should also give the solutions. In case of coding exercises, not only the source code, but with explanations. If not, it's utterly useless and should not be done.
 on my own. If I buy a book (or take a class), it's because I want *answers* 
 and *information*. If I want to work through it all on my own (and, hell, 
 sometimes I do), then I can do that without f&*%^&* putting down the money 
 for a book/class in the first place.

You pay for books? I just get them from the library. (By the way, how do intellectual property freaks deal with this?)
May 14 2009
next sibling parent BCS <none anon.com> writes:
Hello grauzone,

 You pay for books? I just get them from the library.

For how long? I've got 3m of text books on the shelf next to me (only one fo them not mine) and when I need one I don't want to go to the library to get it.
May 14 2009
prev sibling next sibling parent reply "Nick Sabalausky" <a a.a> writes:
"grauzone" <none example.net> wrote in message 
news:guikqi$adm$1 digitalmars.com...
 would typically be reasonable), and not actually give them any real 
 information except (if we feel like it) some "info" that's incomplete, 
 poorly explained, etc." I can come up with plenty of questions and 
 problems

Ah yes, if there are exercises, they should also give the solutions. In case of coding exercises, not only the source code, but with explanations. If not, it's utterly useless and should not be done.

Good point.
 on my own. If I buy a book (or take a class), it's because I want 
 *answers* and *information*. If I want to work through it all on my own 
 (and, hell, sometimes I do), then I can do that without f&*%^&* putting 
 down the money for a book/class in the first place.

You pay for books? I just get them from the library.

I was afraid someone would catch that ;) Yea, I do usually just use the library (especially for videos (Ohio has awesome libraries) but also books too). I guess I was talking more about classes and books that I think I'll want to hold on to for more than a few weeks (like TDPL).
 (By the way, how do intellectual property freaks deal with this?)

I've wondered that too. I suspect, in the case of books, they've either given up on it or never even thought about it. I mean, public libraries have been around a loooong time. Certainly longer that at least the US's copyright law (or the US itself, for that matter). Hell, longer than the printing press. (Interesting question: if the printing press and intellectual property had been around before libraries, would libraries have ever happened? I suspect not.) With periodicals, I don't think they'd care. If anything I'd think it does periodicals a favor. It's not like you can usually buy back issues, and even when you can it's probably just because they're just trying to clear out back stock. Plus a lot of there revenue is ad-generated. There's magazines that literally hand out subscriptions for free to anyone who know where to look, just to boost their circulation and thus increase ad revenue. But I've heard the MPAA and RIAA haven't been too happy about their stuff being in libraries. Not that I don't care though: With music, I've learned the hard way not to buy discs I haven't listened to first (even if I've previously been happy with the artist). And with videos, I'll be damned if I'm going to buy something that tries to shove advertisements, product placement (*COUGH* Star Trek 2009 *COUGH*), and prohibited user operations down my throat. I'll go back to VHS before I buy another disc that has prohibited user operations.
May 14 2009
parent reply dsimcha <dsimcha yahoo.com> writes:
== Quote from Nick Sabalausky (a a.a)'s article
 (By the way, how do intellectual property freaks deal with this?)

I suspect, in the case of books, they've either given up on it or never even thought about it. I mean, public libraries have been around a loooong time.

http://en.wikipedia.org/wiki/First_sale_doctrine Of course, the RIAA/MPAA fascists seem to be doing everything in their power to make sure nothing like a digital equivalent to the first sale doctrine ever exists.
May 14 2009
parent reply "Nick Sabalausky" <a a.a> writes:
"dsimcha" <dsimcha yahoo.com> wrote in message 
news:guinsl$g7v$1 digitalmars.com...
 == Quote from Nick Sabalausky (a a.a)'s article
 (By the way, how do intellectual property freaks deal with this?)

I suspect, in the case of books, they've either given up on it or never even thought about it. I mean, public libraries have been around a loooong time.

http://en.wikipedia.org/wiki/First_sale_doctrine Of course, the RIAA/MPAA fascists seem to be doing everything in their power to make sure nothing like a digital equivalent to the first sale doctrine ever exists.

That just made me think of something that never really occurred to me before: For a long time now (before optical discs), recordings (definitely videos, not sure about music) have been sold (ermm, excuse me, *cough* "licensed" *cough*) with the license restriction of "not for public viewing" (or something along those lines). But I'm not aware of books having a similar thing. I admit I'm purely speculating here, but I could easily imagine that restriction as being intended as a way to get around the first sale doctrine enough to prohibit library use. Oh, also, a large portion of the videogame industry also belongs in your statement above about the RIAA/MPAA trying to prevent a digital equivalent of first sale doctrine. There are a number of big-name people in the games industry that fully believe in first sale doctrine for videogames, but most of the industry has been very visibly moving towards a model (DRMed digital distribution) that would enable them to eliminate the second-hand market (despite the fact that the sales fairly clearly indicate that consumers usually prefer a physical medium). But the real scary thing is that many of these people are completely open about their, in many cases, outright contempt for the second-hand market. (Although some of them are a bit more veiled about it, like Nintendo, but in those cases their actions make their stance pretty clear anyway.)
May 14 2009
parent Sean Kelly <sean invisibleduck.org> writes:
Nick Sabalausky wrote:
 
 That just made me think of something that never really occurred to me 
 before: For a long time now (before optical discs), recordings (definitely 
 videos, not sure about music) have been sold (ermm, excuse me, *cough* 
 "licensed" *cough*) with the license restriction of "not for public viewing" 
 (or something along those lines). But I'm not aware of books having a 
 similar thing.

I believe that if you read a book aloud to an audience it counts as a performance of the work and the copyright holder is technically supposed to be compensated for it. But this happens about as often as DJs pay the RIAA for the use of records they play (ie. basically never).
May 14 2009
prev sibling parent BCS <none anon.com> writes:
Hello grauzone,

 You pay for books? I just get them from the library. (By the way, how
 do intellectual property freaks deal with this?)
 

I suspect that there are very few people who care enough about a book to buy it but only if they can't get it from a library. Either they would buy it no matter what, or they wouldn't buy it at all (at least not right now, but maybe later if they use it a lot).
May 14 2009
prev sibling next sibling parent reply BCS <none anon.com> writes:
Hello Nick,

 (and double the
 price (or more) from what would typically be reasonable)

I have been told (without supporting evidence) that the price of text books is so high because about 10 times as many are printed as sold. This is because they don't have time between when they know what they need and when they need it, to print what they need. The other 90% of the books you end up paying for get pulped. (That and the fact most profs never worry about what a book costs when they spend your money)
May 14 2009
next sibling parent reply "Nick Sabalausky" <a a.a> writes:
"BCS" <none anon.com> wrote in message 
news:a6268ff5d238cba2e80afc1d36 news.digitalmars.com...
 Hello Nick,

 (and double the
 price (or more) from what would typically be reasonable)

I have been told (without supporting evidence) that the price of text books is so high because about 10 times as many are printed as sold. This is because they don't have time between when they know what they need and when they need it, to print what they need. The other 90% of the books you end up paying for get pulped.

I find that difficult (though not impossible) to believe. Most of the academic texts out there are just new editions that have barely anything changed, and not much content that really needs to be particularly timely either (Because of that, BTW, I'm convinced the updates are primarily done to curb the second-hand market. I've had plenty of profs require the latest edition when the last few editions turned out to be nearly identical). And even those updates don't happen every single school year. The same edition is usually still the newest for at least a couple years in a row, usually more. If they're ending up with so much extra stock, why not just sell that stock in the following years instead of pulping and printing new? Or, if they really are ending up with 90% extra on such a regular basis, maaaaayyyybbeeee it's time to re-evaluate how many they choose to print? It just doesn't seem to add up. But then again, nether do most things regarding academia.
 (That and the fact most profs never worry about what a book costs when 
 they spend your money)

Now *that* one I definitely *don't* have any difficulty believing. Hell, half of the college classes out there amount to nothing more than US$2k book recommendations. For those classes, most of the prof's "teaching" amounts to nothing more than saying what book to buy, and having the students read it. If the instructor doesn't care about wasting a couple thousand of the student's dollars when the only real value in the entire class is the book itself, they're certainly not going to care if the book happens to cost $50-$100 too much.
May 14 2009
next sibling parent reply Sean Kelly <sean invisibleduck.org> writes:
Nick Sabalausky wrote:
 "BCS" <none anon.com> wrote in message 
 news:a6268ff5d238cba2e80afc1d36 news.digitalmars.com...
 
 (That and the fact most profs never worry about what a book costs when 
 they spend your money)

Now *that* one I definitely *don't* have any difficulty believing. Hell, half of the college classes out there amount to nothing more than US$2k book recommendations.

That hasn't been my experience. I've had a lot of professors who've said whether the previous (used) version of a book would work for the course, and for reading-intensive courses I've ever had professors who xeroxed massive amounts of material to hand out to spare students the expense of buying books. Another option at many universities is to go to the school library. They generally have all the course material available for students to use... they just can't leave with it. That said, the cost of textbooks is still completely ridiculous. I also don't understand why professors seem to always choose academic textbooks on the subject when I know there are infinitely better trade books available (which I generally already own).
May 14 2009
parent reply "Nick Sabalausky" <a a.a> writes:
"Sean Kelly" <sean invisibleduck.org> wrote in message 
news:guipr4$jl9$1 digitalmars.com...
 Nick Sabalausky wrote:
 "BCS" <none anon.com> wrote in message 
 news:a6268ff5d238cba2e80afc1d36 news.digitalmars.com...

 (That and the fact most profs never worry about what a book costs when 
 they spend your money)

Now *that* one I definitely *don't* have any difficulty believing. Hell, half of the college classes out there amount to nothing more than US$2k book recommendations.

That hasn't been my experience. I've had a lot of professors who've said whether the previous (used) version of a book would work for the course, and for reading-intensive courses I've ever had professors who xeroxed massive amounts of material to hand out to spare students the expense of buying books. Another option at many universities is to go to the school library. They generally have all the course material available for students to use... they just can't leave with it.

Oh, I've certainly had a lot of instructors like that too. Maybe about half of them. But the problem is, for such a terrible problem, anything remotely near that figure is an absolutely horrible ratio.
 I also don't understand why professors seem to always choose academic 
 textbooks on the subject when I know there are infinitely better trade 
 books available (which I generally already own).

Hear hear!! There's also another phenomenon I've noticed: Classes that never use the book, *except* for heavy use of it during the first two weeks. Call me paranoid, but I can't imagine any realistic explanation for that other than trying to trick students who have learned not to buy books until they see the class *really does* require it (as opposed to the classes that merely claim to require it.) Heck, one of the schools I went to, I know for a fact that the instructors were *required* to choose a "required" book for their course and have the bookstore order it. A handful of instructors would say on the first day of class "Did you get the required book for this course? No? Good. Don't. And if you have, go take it back. They just required me to pick one. We won't use it, so don't get it."
May 14 2009
parent Christopher Wright <dhasenan gmail.com> writes:
Nick Sabalausky wrote:
 "Sean Kelly" <sean invisibleduck.org> wrote in message 
 I also don't understand why professors seem to always choose academic 
 textbooks on the subject when I know there are infinitely better trade 
 books available (which I generally already own).

Hear hear!! There's also another phenomenon I've noticed: Classes that never use the book, *except* for heavy use of it during the first two weeks. Call me paranoid, but I can't imagine any realistic explanation for that other than trying to trick students who have learned not to buy books until they see the class *really does* require it (as opposed to the classes that merely claim to require it.)

It could also be that the professor is new to teaching and wanted to try out the book, but did not end up liking it.
 Heck, one of the schools I went to, I know for a fact that the instructors 
 were *required* to choose a "required" book for their course and have the 
 bookstore order it. A handful of instructors would say on the first day of 
 class "Did you get the required book for this course? No? Good. Don't. And 
 if you have, go take it back. They just required me to pick one. We won't 
 use it, so don't get it." 

My university's bookstore refused to accept returns without proof that you dropped the course.
May 15 2009
prev sibling parent reply BCS <none anon.com> writes:
Hello Nick,

 "BCS" <none anon.com> wrote in message
 news:a6268ff5d238cba2e80afc1d36 news.digitalmars.com...
 
 Hello Nick,
 
 (and double the
 price (or more) from what would typically be reasonable)

books is so high because about 10 times as many are printed as sold. This is because they don't have time between when they know what they need and when they need it, to print what they need. The other 90% of the books you end up paying for get pulped.

academic texts out there are just new editions that have barely anything changed, and not much content that really needs to be particularly timely either

I'm referring to it going the other way, that the printing houses can't print and ship enough books between the time they known how many of what books they need and the start of classes to fill all the orders they get. So they have to have already printed and stocked everything before the orders come in.
 (Because of that, BTW, I'm convinced the
 updates are primarily done to curb the second-hand market. I've had
 plenty of profs require the latest edition when the last few editions
 turned out to be nearly identical). And even those updates don't
 happen every single school year. The same edition is usually still the
 newest for at least a couple years in a row, usually more. If they're
 ending up with so much extra stock, why not just sell that stock in
 the following years instead of pulping and printing new?

It's not the ones that sell that they pulp, it the flops that no one would buy. Given than many (most?) books sold are "sure things", that paints a very sad picture regarding the failure rate of new textbooks. If my numbers are correct, then each year (or three) 9 times as many new text book offerings flop as the number of books that sell, new and old.
 Or, if they
 really are ending up with 90% extra on such a regular basis,
 maaaaayyyybbeeee it's time to re-evaluate how many they choose to
 print? It just doesn't seem to add up. But then again, nether do most
 things regarding academia.

I'm probably repeating my self but, it's not that 90% of each title doesn't sell, it 90% of the titles offered don't sell and the rest sell out. Now if someone could find a better way to guess what new offerings would be flops....
May 15 2009
parent reply "Nick Sabalausky" <a a.a> writes:
"BCS" <none anon.com> wrote in message 
news:a6268ff5d5a8cba307ba676b08 news.digitalmars.com...
 Hello Nick,
 Or, if they
 really are ending up with 90% extra on such a regular basis,
 maaaaayyyybbeeee it's time to re-evaluate how many they choose to
 print? It just doesn't seem to add up. But then again, nether do most
 things regarding academia.

I'm probably repeating my self but, it's not that 90% of each title doesn't sell, it 90% of the titles offered don't sell and the rest sell out. Now if someone could find a better way to guess what new offerings would be flops....

Ahh, I see what you're saying. In that case, that (and the well-being of student's backs/spines everywhere) would be good reason for school textbooks to finally move to an electronic format (but of course, that has plenty of other downsides...)
May 15 2009
parent reply BCS <none anon.com> writes:
Hello Nick,

 Ahh, I see what you're saying. In that case, that (and the well-being
 of student's backs/spines everywhere) would be good reason for school
 textbooks to finally move to an electronic format (but of course, that
 has plenty of other downsides...)
 

what I want to see (as a first step) is a printing press build to be installed at the schools. Then they just need to get a PDF and a license to print X copies: "Oh we ran out of that title, but we'll have a batch hot off the press in 10 minuets."
May 15 2009
parent "Nick Sabalausky" <a a.a> writes:
"BCS" <none anon.com> wrote in message 
news:a6268ff5db58cba35a2dda2c86 news.digitalmars.com...
 Hello Nick,

 Ahh, I see what you're saying. In that case, that (and the well-being
 of student's backs/spines everywhere) would be good reason for school
 textbooks to finally move to an electronic format (but of course, that
 has plenty of other downsides...)

what I want to see (as a first step) is a printing press build to be installed at the schools. Then they just need to get a PDF and a license to print X copies: "Oh we ran out of that title, but we'll have a batch hot off the press in 10 minuets."

There are some schools that already either have or have access to a local print shop. I know of at least a couple schools where a few of the classes have books (usually small ones) that were written by the instructor or by the department and printed by the local/official/semi-official school print shop. What you suggest would be a great next step.
May 15 2009
prev sibling parent Lutger <lutger.blijdestijn gmail.com> writes:
Brad Roberts wrote:

 BCS wrote:
 Hello Nick,
 
 (and double the
 price (or more) from what would typically be reasonable)

I have been told (without supporting evidence) that the price of text books is so high because about 10 times as many are printed as sold. This is because they don't have time between when they know what they need and when they need it, to print what they need. The other 90% of the books you end up paying for get pulped. (That and the fact most profs never worry about what a book costs when they spend your money)

The cost of printing, shipping, etc.. on a per-book basis is actually very very low. In the neighborhood of a few dollars. No where near the around $100 that a lot of textbooks sell for. One of the reasons they cost so much is that many of them are rev'ed every couple years, meaning that they have to make whatever profit they want to make _fast_. They're rev'ed so fast at least in part to kill off the used market. There's also an awful lot of effort that goes into producing them. Authors, Editors, fact checking, copy setting, etc. Anyway, it's an ugly cycle that's bound to implode eventually. Later, Brad

Another contributing factor is that experts typically not want to write textbooks (boring), so they get paid very well to do it.
May 14 2009
prev sibling next sibling parent reply Sean Kelly <sean invisibleduck.org> writes:
Nick Sabalausky wrote:
 
 Cons: I've never been much of a fan of them. Rarely look at them, and never 
 do them. But more than that, I find opening a book and seeing of bunch of 
 "exercises" and "end of chapter quizzes" rather off-putting.

I have a few books I bought largely for reference material where stuff was omitted and left as an exercise to the reader (I'm looking at you, Sedgewick!) Regardless of how easy some of these exercises may be for me to solve, it isn't something I'm generally in the mood for when I pick up the book at work to check something. However, this isn't a book about algorithms so perhaps this isn't an issue really.
May 14 2009
next sibling parent "Nick Sabalausky" <a a.a> writes:
"Sean Kelly" <sean invisibleduck.org> wrote in message 
news:guip5e$i9j$1 digitalmars.com...
 Nick Sabalausky wrote:
 Cons: I've never been much of a fan of them. Rarely look at them, and 
 never do them. But more than that, I find opening a book and seeing of 
 bunch of "exercises" and "end of chapter quizzes" rather off-putting.

I have a few books I bought largely for reference material where stuff was omitted and left as an exercise to the reader (I'm looking at you, Sedgewick!) Regardless of how easy some of these exercises may be for me to solve, it isn't something I'm generally in the mood for when I pick up the book at work to check something. However, this isn't a book about algorithms so perhaps this isn't an issue really.

Maybe I'm contradicting my own original point here, but I actually did buy a book once where exercises were actually the entire point of the book (it does have solutions). It's called "Find The Bug", and has source for a bunch of functions in various languages, each one with a hidden bug to find (obviously). Many of them basically point out "gotchas" in the langauges (IIRC, C, Python, and maybe Java and something else). It sounded kind of neat, like a "programmer's puzzle book". Although I still haven't actually gotten around to it though. It's sitting there in my ever-growing pile of "stuff to read...someday".
May 14 2009
prev sibling parent BCS <none anon.com> writes:
Hello Sean,

 Nick Sabalausky wrote:
 
 Cons: I've never been much of a fan of them. Rarely look at them, and
 never do them. But more than that, I find opening a book and seeing
 of bunch of "exercises" and "end of chapter quizzes" rather
 off-putting.
 

was omitted and left as an exercise to the reader (I'm looking at you, Sedgewick!) Regardless of how easy some of these exercises may be for me to solve, it isn't something I'm generally in the mood for when I pick up the book at work to check something. However, this isn't a book about algorithms so perhaps this isn't an issue really.

If the book has solutions, then they can server double duty as code examples.
May 15 2009
prev sibling parent reply Brad Roberts <braddr puremagic.com> writes:
BCS wrote:
 Hello Nick,
 
 (and double the
 price (or more) from what would typically be reasonable)

I have been told (without supporting evidence) that the price of text books is so high because about 10 times as many are printed as sold. This is because they don't have time between when they know what they need and when they need it, to print what they need. The other 90% of the books you end up paying for get pulped. (That and the fact most profs never worry about what a book costs when they spend your money)

The cost of printing, shipping, etc.. on a per-book basis is actually very very low. In the neighborhood of a few dollars. No where near the around $100 that a lot of textbooks sell for. One of the reasons they cost so much is that many of them are rev'ed every couple years, meaning that they have to make whatever profit they want to make _fast_. They're rev'ed so fast at least in part to kill off the used market. There's also an awful lot of effort that goes into producing them. Authors, Editors, fact checking, copy setting, etc. Anyway, it's an ugly cycle that's bound to implode eventually. Later, Brad
May 14 2009
parent reply "Nick Sabalausky" <a a.a> writes:
"Brad Roberts" <braddr puremagic.com> wrote in message 
news:mailman.71.1242359810.13405.digitalmars-d puremagic.com...
 BCS wrote:

 Anyway, it's an ugly cycle that's bound to implode eventually.

I wish that were true, but I'm not convinced. My experiences at three different colleges indicate there's a lot of things about college that by all means *should* have imploded long ago. The problem is that college and anything claiming to be "education" has become such a sacred cow in our society that pretty much any amount of bullshit is, and will continue to be, tolerated for the foreseeable future.
May 14 2009
parent reply Walter Bright <newshound1 digitalmars.com> writes:
Nick Sabalausky wrote:
 "Brad Roberts" <braddr puremagic.com> wrote in message 
 news:mailman.71.1242359810.13405.digitalmars-d puremagic.com...
 BCS wrote:

 Anyway, it's an ugly cycle that's bound to implode eventually.

I wish that were true, but I'm not convinced. My experiences at three different colleges indicate there's a lot of things about college that by all means *should* have imploded long ago. The problem is that college and anything claiming to be "education" has become such a sacred cow in our society that pretty much any amount of bullshit is, and will continue to be, tolerated for the foreseeable future.

When I went to college, most of the "textbooks" were what the prof wrote on the chalkboards during lecture. I didn't actually spend much on textbooks - few were required, and the rest I picked up used. I still have them. The current scheme is so blatantly disrespectful of their customers (students) I don't see how it can persist.
May 14 2009
parent reply "Nick Sabalausky" <a a.a> writes:
"Walter Bright" <newshound1 digitalmars.com> wrote in message 
news:guirn4$mbv$1 digitalmars.com...
 Nick Sabalausky wrote:
 "Brad Roberts" <braddr puremagic.com> wrote in message 
 news:mailman.71.1242359810.13405.digitalmars-d puremagic.com...
 BCS wrote:

 Anyway, it's an ugly cycle that's bound to implode eventually.

I wish that were true, but I'm not convinced. My experiences at three different colleges indicate there's a lot of things about college that by all means *should* have imploded long ago. The problem is that college and anything claiming to be "education" has become such a sacred cow in our society that pretty much any amount of bullshit is, and will continue to be, tolerated for the foreseeable future.

When I went to college, most of the "textbooks" were what the prof wrote on the chalkboards during lecture. I didn't actually spend much on textbooks - few were required, and the rest I picked up used. I still have them.

You know, you've consistently been getting me impressed with your school ;) Caltech was it? I've been to a big public state university, a small supposedly well-respected private university, and a community college (that was highly-regarded, at least for a community college). I had many major issues with all of them (of course, I had major issues with K-12 as well ;) ). But, tech schools, I've never been to one (never got in, and they tend to be expensive anyway). I wonder if these things are specific to Caltech or if they tend to be typical of tech schools?
 The current scheme is so blatantly disrespectful of their customers 
 (students) I don't see how it can persist.

They're sacred cows. I'm convinced that's how it happens.
May 14 2009
parent Walter Bright <newshound1 digitalmars.com> writes:
Nick Sabalausky wrote:
 You know, you've consistently been getting me impressed with your school ;) 
 Caltech was it? I've been to a big public state university, a small 
 supposedly well-respected private university, and a community college (that 
 was highly-regarded, at least for a community college). I had many major 
 issues with all of them (of course, I had major issues with K-12 as well 
 ;) ). But, tech schools, I've never been to one (never got in, and they tend 
 to be expensive anyway). I wonder if these things are specific to Caltech or 
 if they tend to be typical of tech schools?

I don't know if Caltech is typical or not. I went there kind of by happenstance, and was very lucky because their style suited my personality.
May 15 2009
prev sibling next sibling parent reply Sean Kelly <sean invisibleduck.org> writes:
I never bother to solve the exercises either, but then I've read most 
tech books on my own time.  I think if you're hoping this might be used 
in an academic setting at some point (and I have no idea what the 
requirements are for that) then it would be good to have exercises.  By 
the way, does TCPL have them?  I'm pretty sure TC++PL doesn't.
May 14 2009
parent Lutger <lutger.blijdestijn gmail.com> writes:
Sean Kelly wrote:

 I never bother to solve the exercises either, but then I've read most 
 tech books on my own time.  I think if you're hoping this might be used 
 in an academic setting at some point (and I have no idea what the 
 requirements are for that) then it would be good to have exercises.  By 
 the way, does TCPL have them?  I'm pretty sure TC++PL doesn't.

That's a good point, it will be helpful for courses. (but not a requirement) TC++PL does have exercises - at least the 3rd edition does, although they are not so prominent. I like to use exercises as review questions or summary, looking at them helps to get a feel for how much you've understood. Also, fun or really good exercises I will take, like the ones in SICP.
May 14 2009
prev sibling next sibling parent reply Brad Roberts <braddr puremagic.com> writes:
Andrei Alexandrescu wrote:
 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering
 whether I should be adding exercises to the book. Some books have them,
 some don't.
 
 Pros: As I'm writing, I've come up with some pretty darn cool exercise
 ideas.
 
 Cons: The book gets larger, takes longer to write, and I never solved
 the exercises in the books I've read, but then I'm just weird.
 
 What do you think?
 
 Thanks,
 Andrei

There's only one book that I can remember ever working through the exercises on.. and that's even a stretch of the term exercise: Exceptional C++. For any of you that develop c++ code and haven't read that book.. I highly recommend it. Later, Brad
May 14 2009
next sibling parent reply Sean Kelly <sean invisibleduck.org> writes:
Brad Roberts wrote:
 
 There's only one book that I can remember ever working through the exercises
 on.. and that's even a stretch of the term exercise:  Exceptional C++.
 
 For any of you that develop c++ code and haven't read that book.. I highly
 recommend it.

Scott Meyers is an excellent technical writer--he's one of the few authors whose books I'd pick up without ever cracking the cover. About my only complaint is that his books tend to be targeted at someone with a bit less experience than I have, so I don't get much out of his stuff these days.
May 14 2009
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Sean Kelly wrote:
 Brad Roberts wrote:
 There's only one book that I can remember ever working through the 
 exercises
 on.. and that's even a stretch of the term exercise:  Exceptional C++.

 For any of you that develop c++ code and haven't read that book.. I 
 highly
 recommend it.

Scott Meyers is an excellent technical writer--he's one of the few authors whose books I'd pick up without ever cracking the cover.

So is Herb Sutter, the author of Exceptional C++. Are you sure you cracked that one even after you bought it? Nyuk, nyuk... :o) Andrei
May 14 2009
next sibling parent reply "Nick Sabalausky" <a a.a> writes:
"Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message 
news:guitu0$opr$3 digitalmars.com...
 Sean Kelly wrote:
 Brad Roberts wrote:
 There's only one book that I can remember ever working through the 
 exercises
 on.. and that's even a stretch of the term exercise:  Exceptional C++.

 For any of you that develop c++ code and haven't read that book.. I 
 highly
 recommend it.

Scott Meyers is an excellent technical writer--he's one of the few authors whose books I'd pick up without ever cracking the cover.

So is Herb Sutter, the author of Exceptional C++. Are you sure you cracked that one even after you bought it? Nyuk, nyuk... :o)

Looks like I'm not the only one that gets those books confused :). When "Exceptional C++" was mentioned, I thought it was that C++ book you wrote. I think I breifly browsed through one or two of those "E* C++" books before. Was very impressed with them (and also a similar book from a different publisher geared towards game dev), but I think my biggest take-away from all of them was, "Alright, that's it, screw C++." ;) Then I found D. Not that the books were difficult or anything, in fact they did a great job of making an extremely complicated language as easy as possible. But they just made it finally click in my mind just what a PITA/POS C++ had become. Shit, I'm rambling again... ;)
May 15 2009
next sibling parent reply Sean Kelly <sean invisibleduck.org> writes:
Nick Sabalausky wrote:
 "Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message 
 news:guitu0$opr$3 digitalmars.com...
 Sean Kelly wrote:
 Brad Roberts wrote:
 There's only one book that I can remember ever working through the 
 exercises
 on.. and that's even a stretch of the term exercise:  Exceptional C++.

 For any of you that develop c++ code and haven't read that book.. I 
 highly
 recommend it.

authors whose books I'd pick up without ever cracking the cover.

that one even after you bought it? Nyuk, nyuk... :o)

Looks like I'm not the only one that gets those books confused :). When "Exceptional C++" was mentioned, I thought it was that C++ book you wrote.

Oh... oops! The Scott Meyers titles are really similar! *blush*
May 15 2009
parent reply Georg Wrede <georg.wrede iki.fi> writes:
Sean Kelly wrote:
 Nick Sabalausky wrote:
 "Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message 
 news:guitu0$opr$3 digitalmars.com...
 Sean Kelly wrote:
 Brad Roberts wrote:
 There's only one book that I can remember ever working through the 
 exercises
 on.. and that's even a stretch of the term exercise:  Exceptional C++.

 For any of you that develop c++ code and haven't read that book.. I 
 highly
 recommend it.

authors whose books I'd pick up without ever cracking the cover.

cracked that one even after you bought it? Nyuk, nyuk... :o)

Looks like I'm not the only one that gets those books confused :). When "Exceptional C++" was mentioned, I thought it was that C++ book you wrote.

Oh... oops! The Scott Meyers titles are really similar! *blush*

Well, anyhow, reading a couple fo Scott Meyers books really kills the last inch of even trying to start coping with C++. They really make you see what a piece of manure the language is. Without even trying.
May 15 2009
parent reply Sean Kelly <sean invisibleduck.org> writes:
== Quote from Georg Wrede (georg.wrede iki.fi)'s article
 Well, anyhow, reading a couple fo Scott Meyers books really kills the
 last inch of even trying to start coping with C++. They really make you
 see what a piece of manure the language is. Without even trying.

I have a lot of issues with C++, but I find C to be positively maddening. If there were a version of D that didn't contain a GC and ran on SPARC I'd jump for joy right about now.
May 15 2009
parent Georg Wrede <georg.wrede iki.fi> writes:
Sean Kelly wrote:
 == Quote from Georg Wrede (georg.wrede iki.fi)'s article
 Well, anyhow, reading a couple fo Scott Meyers books really kills the
 last inch of even trying to start coping with C++. They really make you
 see what a piece of manure the language is. Without even trying.

I have a lot of issues with C++, but I find C to be positively maddening. If there were a version of D that didn't contain a GC and ran on SPARC I'd jump for joy right about now.

Amen, brother!!! Such a version of D could (would?) take a remarkable slice of embedded programming, in no time at all! Most people I know, who program single board systems, curse C, swear (and don't use) C++, and could kill for something that gave them K&R 1.0 worth of a language, with the ease of D (or Pascal, but with the metal feel of C). Walter has said that D will never be less than 32 bit, but many of these guys still program 16 or 8 bit CPUs. (And 8 and 16 bits won't go away anytime soon, either. There are gadgets smaller than mobile phones, in the future, too.) Without GC, one might even dream it's possible to write D syntax, and target smaller than the x86 processor. Many of these guys are hardware gurus, and only superficially study programming, or a specific programming language. They're smart, so the programming is not an issue, but the less they have to think about /how/ to express themselves and avoid stupid bugs, the better the code, and the more they have time to design the overall functionality and usability of the gadget.
May 15 2009
prev sibling parent "Nick Sabalausky" <a a.a> writes:
"Brad Roberts" <braddr puremagic.com> wrote in message 
news:mailman.73.1242407451.13405.digitalmars-d puremagic.com...
 Nick Sabalausky wrote:
 Looks like I'm not the only one that gets those books confused :). When
 "Exceptional C++" was mentioned, I thought it was that C++ book you 
 wrote.

 I think I breifly browsed through one or two of those "E* C++" books 
 before.
 Was very impressed with them (and also a similar book from a different
 publisher geared towards game dev), but I think my biggest take-away from
 all of them was, "Alright, that's it, screw C++." ;) Then I found D. Not
 that the books were difficult or anything, in fact they did a great job 
 of
 making an extremely complicated language as easy as possible. But they 
 just
 made it finally click in my mind just what a PITA/POS C++ had become. 
 Shit,
 I'm rambling again... ;)

One reason I like Exceptional C++ is that most of the points made in it transcend the language and are just good programming tips. It also does a good job of presenting complex topics as well as basic topics. Additionally, the 'exceptional' part isn't just about using exceptions in the language. :)

I guess I didn't get too good of a look at that particular one then. There are number of other great books though that "transcend the language and are just good programming tips". "The Pragmatic Programmer", "Code Craft", and "Writing Solid Code". The other one I mentioned above was "C++ for Game Programmers". That's one that anyone who writes videogames in C++ should read.
May 15 2009
prev sibling next sibling parent Christopher Wright <dhasenan gmail.com> writes:
Andrei Alexandrescu wrote:
 Sean Kelly wrote:
 Brad Roberts wrote:
 There's only one book that I can remember ever working through the 
 exercises
 on.. and that's even a stretch of the term exercise:  Exceptional C++.

 For any of you that develop c++ code and haven't read that book.. I 
 highly
 recommend it.

Scott Meyers is an excellent technical writer--he's one of the few authors whose books I'd pick up without ever cracking the cover.

So is Herb Sutter, the author of Exceptional C++. Are you sure you cracked that one even after you bought it? Nyuk, nyuk... :o) Andrei

I confused Herb Sutter with Herbert Schildt, and thought you were using irony.
May 15 2009
prev sibling parent Sean Kelly <sean invisibleduck.org> writes:
Andrei Alexandrescu wrote:
 Sean Kelly wrote:
 Brad Roberts wrote:
 There's only one book that I can remember ever working through the 
 exercises
 on.. and that's even a stretch of the term exercise:  Exceptional C++.

 For any of you that develop c++ code and haven't read that book.. I 
 highly
 recommend it.

Scott Meyers is an excellent technical writer--he's one of the few authors whose books I'd pick up without ever cracking the cover.

So is Herb Sutter, the author of Exceptional C++. Are you sure you cracked that one even after you bought it? Nyuk, nyuk... :o)

Ouch! I think I actually have both Exceptional C++ and More Exceptional C++ around somewhere, though I think a lot of the same stuff can be found in his GOTW archives. And these days I'm using C at work, so... :-p
May 15 2009
prev sibling parent Brad Roberts <braddr puremagic.com> writes:
Nick Sabalausky wrote:
 "Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message 
 news:guitu0$opr$3 digitalmars.com...
 Sean Kelly wrote:
 Brad Roberts wrote:
 There's only one book that I can remember ever working through the 
 exercises
 on.. and that's even a stretch of the term exercise:  Exceptional C++.

 For any of you that develop c++ code and haven't read that book.. I 
 highly
 recommend it.

authors whose books I'd pick up without ever cracking the cover.

that one even after you bought it? Nyuk, nyuk... :o)

Looks like I'm not the only one that gets those books confused :). When "Exceptional C++" was mentioned, I thought it was that C++ book you wrote. I think I breifly browsed through one or two of those "E* C++" books before. Was very impressed with them (and also a similar book from a different publisher geared towards game dev), but I think my biggest take-away from all of them was, "Alright, that's it, screw C++." ;) Then I found D. Not that the books were difficult or anything, in fact they did a great job of making an extremely complicated language as easy as possible. But they just made it finally click in my mind just what a PITA/POS C++ had become. Shit, I'm rambling again... ;)

One reason I like Exceptional C++ is that most of the points made in it transcend the language and are just good programming tips. It also does a good job of presenting complex topics as well as basic topics. Additionally, the 'exceptional' part isn't just about using exceptions in the language. :) Later, Brad
May 15 2009
prev sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Brad Roberts wrote:
 There's only one book that I can remember ever working through the exercises
 on.. and that's even a stretch of the term exercise:  Exceptional C++.

The short attention span version of "Exceptional C++": int main() { *(char*)0 = 0; return 0; }
May 15 2009
next sibling parent "Nick Sabalausky" <a a.a> writes:
"Walter Bright" <newshound1 digitalmars.com> wrote in message 
news:gukg9f$n1v$1 digitalmars.com...
 Brad Roberts wrote:
 There's only one book that I can remember ever working through the 
 exercises
 on.. and that's even a stretch of the term exercise:  Exceptional C++.

The short attention span version of "Exceptional C++": int main() { *(char*)0 = 0; return 0; }

I went through a phase where I was really big on making custom sound schemes for my system. I loved the clip I had picked for "program crash" so much, I wrote a program where the entire intent was to dereference null, just so I could listen to my nifty "error" sound whenever I wanted.
May 15 2009
prev sibling parent Georg Wrede <georg.wrede iki.fi> writes:
Walter Bright wrote:
 Brad Roberts wrote:
 There's only one book that I can remember ever working through the 
 exercises
 on.. and that's even a stretch of the term exercise:  Exceptional C++.

The short attention span version of "Exceptional C++": int main() { *(char*)0 = 0; return 0; }

Sometimes I fear my C[++] bashing is grossly insufficient. I feel I'm crying wolf all over town, when I should cry crocodile. (I'm not scared of wolves. We actually have wolves around here. But in 1973 I was in Konstanz, Germany, studying the language, and somebody had an 18 inch baby crocodile on the campus lawn, tethered to a tree. You'd never guess what scare and panic the reptile caused. It could run as fast as a human, and its jaws were half its length. And it sure wasn't waiting for people to come and cuddle it.)
May 15 2009
prev sibling next sibling parent Derek Parnell <derek psych.ward> writes:
On Thu, 14 May 2009 19:05:04 -0500, Andrei Alexandrescu wrote:

 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering 
 whether I should be adding exercises to the book. Some books have them, 
 some don't.
 
 Pros: As I'm writing, I've come up with some pretty darn cool exercise 
 ideas.

Won't hurt to put those in then :-) I remember working through some of Knuth's exercises and enjoying the challenge, even though I failed to solve some of the advanced ones. I think any exercises you put in should be incidental to the book's purpose. I mean, that the book should be just as useful with or without those exercises; they would exist for the curious or adventurous. And in any case, not only should the solutions be provided, a way to /get/ to the solutions should also be shown; I can remember seeing some exercises' solution and thinking "Huh? How did he get that?" -- Derek Parnell Melbourne, Australia skype: derek.j.parnell
May 14 2009
prev sibling next sibling parent Brian Palmer <d brian.codekitchen.net> writes:
Andrei Alexandrescu Wrote:

 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering 
 whether I should be adding exercises to the book. Some books have them, 
 some don't.
 
 Pros: As I'm writing, I've come up with some pretty darn cool exercise 
 ideas.
 
 Cons: The book gets larger, takes longer to write, and I never solved 
 the exercises in the books I've read, but then I'm just weird.
 
 What do you think?
 
 
 Thanks,
 
 Andrei

I don't think I have _ever_ done the exercises in a programming book. And I definitely don't want this book to take any longer to write! :) I plan on forcing all my co-workers to read it as soon as it's available. -- Brian
May 14 2009
prev sibling next sibling parent "Denis Koroskin" <2korden gmail.com> writes:
On Fri, 15 May 2009 04:05:04 +0400, Andrei Alexandrescu
<SeeWebsiteForEmail erdani.org> wrote:

 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering  
 whether I should be adding exercises to the book. Some books have them,  
 some don't.

 Pros: As I'm writing, I've come up with some pretty darn cool exercise  
 ideas.

 Cons: The book gets larger, takes longer to write, and I never solved  
 the exercises in the books I've read, but then I'm just weird.

 What do you think?


 Thanks,

 Andrei

When I was first learning C++, I solved all the exercises in the two books I was using (a russian one and then Stroustrup's TC++PL), and they helped alot. But once I learned C++ well enough, I started either skipping or solving them in head. I believe solving exercises is a great way to learn new language, especially when they requires using some language features that are missing from other languages. My vote for having them in TDPL.
May 15 2009
prev sibling next sibling parent Georg Wrede <georg.wrede iki.fi> writes:
Andrei Alexandrescu wrote:
 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering 
 whether I should be adding exercises to the book. Some books have them, 
 some don't.
 
 Pros: As I'm writing, I've come up with some pretty darn cool exercise 
 ideas.
 
 Cons: The book gets larger, takes longer to write, and I never solved 
 the exercises in the books I've read, but then I'm just weird.

Well, you're not the average reader. :-) Reasons for including excercises o they're really needed for those who actually /study/ the stuff o K&R, Stroustrup, Knuth had them!! Nobody's ever complained o when reading stuff /new/ to you, they're needed o the only way to get schools and unviersities to use the book o make them well, and it'll double the value of the book o increases sales and revenue o some learn by doing, especially the not-supertalented o no excercises is an "obvious omission", attracts competitors Reasons against excercises o they take longer to write, if done well o you may need to test some of the excercises on people o done sloppily they'll reduce the value of the book o the answers need to explain stuff, not only be a listing The more people buy the book, the more money you get. And for us, the more D gets recognition inside and outside the academia, the better!! As a teacher, I'd never choose one without excercises. (Hell, then I'd have to invent them all, not just some. If that's a chore to you, it sure is a drag for the teacher!) IMO, it is *utterly* important that the book is usable in universities. The better universities pick it up, the others follow, and eventually we may have a chance of having D taught as the first computing language. (It certainly is better for that than the others, IMNSHO.) People also tend to have a mother tongue, even with computer languages. In 5..10 years, we want D to be *The* language, right? PS: write in the preface that you'd love teacher comments. You won't regret it, come time for the second edition!! You'll want to /maintain/ the head start you got, by refining the quality.
May 15 2009
prev sibling next sibling parent Don <nospam nospam.com> writes:
Andrei Alexandrescu wrote:
 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering 
 whether I should be adding exercises to the book. Some books have them, 
 some don't.
 
 Pros: As I'm writing, I've come up with some pretty darn cool exercise 
 ideas.
 
 Cons: The book gets larger, takes longer to write, and I never solved 
 the exercises in the books I've read, but then I'm just weird.
 
 What do you think?

Depends on the exercise. In Knuth, some of the best bits are in the exercises. But I think he was using them as a form of compression, reducing the size of the book to reasonable length <g>. I don't think I've bothered trying to solve the exercises in any other textbook, except in some rare cases where the exercise was so interesting that I really wanted to know what the answer was. I've never done an exercise for the sake of doing an exercise. But I'm weirder than you.
May 15 2009
prev sibling next sibling parent "Christof Schardt" <csnews christof-schardt.de> writes:
 What do you think?

Definitly yes. The whole template-stuff is on a rather high abstraction level. Exercises could help to bring things down to concrete problems. Christof
May 15 2009
prev sibling next sibling parent reply "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Thu, 14 May 2009 20:05:04 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail erdani.org> wrote:

 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering  
 whether I should be adding exercises to the book. Some books have them,  
 some don't.

 Pros: As I'm writing, I've come up with some pretty darn cool exercise  
 ideas.

 Cons: The book gets larger, takes longer to write, and I never solved  
 the exercises in the books I've read, but then I'm just weird.

 What do you think?

I personally never did exercises unless they were assigned. Generally when I'm reading a text book on my own, it's to get going on a project. So I'm not interested in solving puzzles :) But examples are good to help with understanding, so as long as you put the answers in the book, I think it's a good idea. -Steve
May 15 2009
parent Georg Wrede <georg.wrede iki.fi> writes:
Denis Koroskin wrote:
 
 Well, I'd wouldn't recommend putting solutions into a book for a
 couple of reasons:
 
 1) Most people would jump to answers right after reading the
 question, without caring to thing a little

 2) Good questions deserve good answers (with explanation etc), but it
 takes time and books size grows significantly

 3) Teachers won't be able to use these exercises to teach D in the
 classes because everyone can cheat by looking at answers

Many books have answers only to the odd numbered excercises.
May 15 2009
prev sibling next sibling parent "Denis Koroskin" <2korden gmail.com> writes:
On Fri, 15 May 2009 17:13:40 +0400, Steven Schveighoffer <schveiguy yahoo.com>
wrote:

 On Thu, 14 May 2009 20:05:04 -0400, Andrei Alexandrescu  
 <SeeWebsiteForEmail erdani.org> wrote:

 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm  
 pondering whether I should be adding exercises to the book. Some books  
 have them, some don't.

 Pros: As I'm writing, I've come up with some pretty darn cool exercise  
 ideas.

 Cons: The book gets larger, takes longer to write, and I never solved  
 the exercises in the books I've read, but then I'm just weird.

 What do you think?

I personally never did exercises unless they were assigned. Generally when I'm reading a text book on my own, it's to get going on a project. So I'm not interested in solving puzzles :) But examples are good to help with understanding, so as long as you put the answers in the book, I think it's a good idea. -Steve

Well, I'd wouldn't recommend putting solutions into a book for a couple of reasons: 1) Most people would jump to answers right after reading the question, without caring to thing a little 2) Good questions deserve good answers (with explanation etc), but it takes time and books size grows significantly 3) Teachers won't be able to use these exercises to teach D in the classes because everyone can cheat by looking at answers But I do believe that answers are very useful (unless they are no-brainers). I great solution to the problem would be to provide answers on a dedicated web-site. This way you can keep them comprehensive, they won't take up any space in the book, you may even write (and update) them *after* book is shipped.
May 15 2009
prev sibling next sibling parent reply Steve Teale <steve.teale britseyeview.com> writes:
Andrei Alexandrescu Wrote:

 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering 
 whether I should be adding exercises to the book. Some books have them, 
 some don't.
 
 Pros: As I'm writing, I've come up with some pretty darn cool exercise 
 ideas.
 
 Cons: The book gets larger, takes longer to write, and I never solved 
 the exercises in the books I've read, but then I'm just weird.
 
 What do you think?
 
 
 Thanks,
 
 Andrei

Andrei, Do you have a publisher yet? They will probably give you quite a definitive answer. They usually have quite strong ideas about the market they are aiming for. If is is to be a university text book, then Yes! I realize that doing it is a pain in the ass. You have to test every little thing to the limit, which takes forever. But if you do it you will sort out bugs in the book. Don't envy you, especially given the moving target of D2 ;=) But the best of luck. Steve
May 15 2009
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Steve Teale wrote:
 Andrei Alexandrescu Wrote:
 
 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering 
 whether I should be adding exercises to the book. Some books have them, 
 some don't.

 Pros: As I'm writing, I've come up with some pretty darn cool exercise 
 ideas.

 Cons: The book gets larger, takes longer to write, and I never solved 
 the exercises in the books I've read, but then I'm just weird.

 What do you think?


 Thanks,

 Andrei

Andrei, Do you have a publisher yet? They will probably give you quite a definitive answer. They usually have quite strong ideas about the market they are aiming for.

The publisher, Addison-Wesley, is leaving such details to me.
 If is is to be a university text book, then Yes!
 
 I realize that doing it is a pain in the ass. You have to test every little
thing to the limit, which takes forever. But if you do it you will sort out
bugs in the book.
 
 Don't envy you, especially given the moving target of D2 ;=)
 
 But the best of luck.

Thanks! One nice thing is I've written (in D!) a little script that extracts the code from all of my examples, compiles it, and runs it comparing the output with the expected output. The book will definitely have a number of faults, but code that doesn't work will not be one of them. It's amazing how much I need to rewrite in wake of recent improvements to D and Phobos. My initial draft of Chapter 1 used char[] for strings! I think D couldn't have claimed being much more than a step forward from C if it stayed with that approach to strings. There's still stuff that doesn't compile (Walter is working on that), and looking forward I'm so excited about the forgotten __traits(allMembers) and the reflection capabilities it begets, I can't stand myself. Andrei
May 15 2009
parent reply Steve Teale <steve.teale britseyeview.com> writes:
Andrei Alexandrescu Wrote:

 Steve Teale wrote:
 Andrei Alexandrescu Wrote:
 
 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering 
 whether I should be adding exercises to the book. Some books have them, 
 some don't.

 Pros: As I'm writing, I've come up with some pretty darn cool exercise 
 ideas.

 Cons: The book gets larger, takes longer to write, and I never solved 
 the exercises in the books I've read, but then I'm just weird.

 What do you think?


 Thanks,

 Andrei

Andrei, Do you have a publisher yet? They will probably give you quite a definitive answer. They usually have quite strong ideas about the market they are aiming for.

The publisher, Addison-Wesley, is leaving such details to me.
 If is is to be a university text book, then Yes!
 
 I realize that doing it is a pain in the ass. You have to test every little
thing to the limit, which takes forever. But if you do it you will sort out
bugs in the book.
 
 Don't envy you, especially given the moving target of D2 ;=)
 
 But the best of luck.

Thanks! One nice thing is I've written (in D!) a little script that extracts the code from all of my examples, compiles it, and runs it comparing the output with the expected output. The book will definitely have a number of faults, but code that doesn't work will not be one of them. It's amazing how much I need to rewrite in wake of recent improvements to D and Phobos. My initial draft of Chapter 1 used char[] for strings! I think D couldn't have claimed being much more than a step forward from C if it stayed with that approach to strings. There's still stuff that doesn't compile (Walter is working on that), and looking forward I'm so excited about the forgotten __traits(allMembers) and the reflection capabilities it begets, I can't stand myself. Andrei

Not being able to stand yourself goes with the job - there's worse to come. Addison-Wesley must have got more relaxed since I dealt with them, or possibly you are better known than I was at the time. Can I review? Even if only on an informal basis - I do speak the language from both sides of the pond, have some experience of the process, and I can be a real pain in the ass ;=) Steve
May 15 2009
parent Walter Bright <newshound1 digitalmars.com> writes:
Steve Teale wrote:
 Can I review? Even if only on an informal basis - I do speak the
 language from both sides of the pond, have some experience of the
 process, and I can be a real pain in the ass ;=)

Steve, I've known you for what, 20+ years? and you've never been a pain the ass. I hope you can come to our (as yet theoretical) next D conference so we can "heft a pint"!
May 15 2009
prev sibling parent "Denis Koroskin" <2korden gmail.com> writes:
On Fri, 15 May 2009 22:09:17 +0400, Andrei Alexandrescu
<SeeWebsiteForEmail erdani.org> wrote:

 Steve Teale wrote:
 Andrei Alexandrescu Wrote:

 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm  
 pondering whether I should be adding exercises to the book. Some books  
 have them, some don't.

 Pros: As I'm writing, I've come up with some pretty darn cool exercise  
 ideas.

 Cons: The book gets larger, takes longer to write, and I never solved  
 the exercises in the books I've read, but then I'm just weird.

 What do you think?


 Thanks,

 Andrei

Do you have a publisher yet? They will probably give you quite a definitive answer. They usually have quite strong ideas about the market they are aiming for.

The publisher, Addison-Wesley, is leaving such details to me.
 If is is to be a university text book, then Yes!
  I realize that doing it is a pain in the ass. You have to test every  
 little thing to the limit, which takes forever. But if you do it you  
 will sort out bugs in the book.
  Don't envy you, especially given the moving target of D2 ;=)
  But the best of luck.

Thanks! One nice thing is I've written (in D!) a little script that extracts the code from all of my examples, compiles it, and runs it comparing the output with the expected output. The book will definitely have a number of faults, but code that doesn't work will not be one of them. It's amazing how much I need to rewrite in wake of recent improvements to D and Phobos. My initial draft of Chapter 1 used char[] for strings! I think D couldn't have claimed being much more than a step forward from C if it stayed with that approach to strings. There's still stuff that doesn't compile (Walter is working on that), and looking forward I'm so excited about the forgotten __traits(allMembers) and the reflection capabilities it begets, I can't stand myself. Andrei

Will you mention __traits as a "__traits" keyword, or it will be renamed (or, better, the whole feature re-implemented) to something better-looking one, by the time TDPL is ready? I really hope it will be fixed in one way or another soon. We need a better compile-time introspection and I assume __traits is just a starting point. It is too hack-ish and there is definitely a room for improvement.
May 15 2009
prev sibling next sibling parent reply Bill Baxter <wbaxter gmail.com> writes:
On Thu, May 14, 2009 at 5:05 PM, Andrei Alexandrescu
<SeeWebsiteForEmail erdani.org> wrote:
 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering
 whether I should be adding exercises to the book. Some books have them, some
 don't.

 Pros: As I'm writing, I've come up with some pretty darn cool exercise
 ideas.

 Cons: The book gets larger, takes longer to write, and I never solved the
 exercises in the books I've read, but then I'm just weird.

 What do you think?

I learned Scheme on my own using SICP and I found the exercises there to be quite valuable in verifying that I actually understood* what was going on. [*] or didn't understand, as was frequently the case. :-)
May 15 2009
parent reply Georg Wrede <georg.wrede iki.fi> writes:
Bill Baxter wrote:
 On Thu, May 14, 2009 at 5:05 PM, Andrei Alexandrescu
 <SeeWebsiteForEmail erdani.org> wrote:
 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering
 whether I should be adding exercises to the book. Some books have them, some
 don't.

 Pros: As I'm writing, I've come up with some pretty darn cool exercise
 ideas.

 Cons: The book gets larger, takes longer to write, and I never solved the
 exercises in the books I've read, but then I'm just weird.

 What do you think?

I learned Scheme on my own using SICP and I found the exercises there to be quite valuable in verifying that I actually understood* what was going on. [*] or didn't understand, as was frequently the case. :-)

Yup. Same here. :-( Incidentally, here, or in D.learn, somebody was asking for symbolic derivation with D templates. I think one of the excercises in SICP was to write a lisp snippet that did just that. Awesome stuff, through and through.
May 15 2009
next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Georg Wrede wrote:
 Bill Baxter wrote:
 On Thu, May 14, 2009 at 5:05 PM, Andrei Alexandrescu
 <SeeWebsiteForEmail erdani.org> wrote:
 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering
 whether I should be adding exercises to the book. Some books have 
 them, some
 don't.

 Pros: As I'm writing, I've come up with some pretty darn cool exercise
 ideas.

 Cons: The book gets larger, takes longer to write, and I never solved 
 the
 exercises in the books I've read, but then I'm just weird.

 What do you think?

I learned Scheme on my own using SICP and I found the exercises there to be quite valuable in verifying that I actually understood* what was going on. [*] or didn't understand, as was frequently the case. :-)

Yup. Same here. :-( Incidentally, here, or in D.learn, somebody was asking for symbolic derivation with D templates. I think one of the excercises in SICP was to write a lisp snippet that did just that. Awesome stuff, through and through.

Speaking of which, compile-time derivation using strings and mixins would be an awesome addition to std.numeric. alias unaryFunction!("exp(x) * sin(x)", "x") fun; alias derive!(fun, "x") dfun; Andrei
May 15 2009
prev sibling next sibling parent reply grauzone <none example.net> writes:
 Incidentally, here, or in D.learn, somebody was asking for symbolic 
 derivation with D templates. I think one of the excercises in SICP was 
 to write a lisp snippet that did just that.
 
 Awesome stuff, through and through.

An awesome way to hit compiler bugs, huh? Well sorry, but it's really like that: programming with D is awesome, until you hit problems like ICEs.
May 15 2009
parent reply Don <nospam nospam.com> writes:
grauzone wrote:
 Incidentally, here, or in D.learn, somebody was asking for symbolic 
 derivation with D templates. I think one of the excercises in SICP was 
 to write a lisp snippet that did just that.

 Awesome stuff, through and through.

An awesome way to hit compiler bugs, huh? Well sorry, but it's really like that: programming with D is awesome, until you hit problems like ICEs.

I agree that it's a problem, which is why the latest compiler release got rid of 40% of the remaining segfault and ICE bugs (including the three most commonly encountered). You should find a significant improvement now. I have patches for many of the remaining bugs. Unfortunately there are 5 ICE bugs in bugzilla with no test cases, which means they can't be fixed.
May 15 2009
next sibling parent reply grauzone <none example.net> writes:
Still, I doubt it's a good idea to lead beginners into the buggier areas 
of the D language/compiler. Or do I really over exaggerate these problems?
May 15 2009
parent Georg Wrede <georg.wrede iki.fi> writes:
grauzone wrote:
 Still, I doubt it's a good idea to lead beginners into the buggier areas 
 of the D language/compiler. Or do I really over exaggerate these problems?

D2 is not for beginners.
May 16 2009
prev sibling next sibling parent reply Christopher Wright <dhasenan gmail.com> writes:
Don wrote:
 grauzone wrote:
 Incidentally, here, or in D.learn, somebody was asking for symbolic 
 derivation with D templates. I think one of the excercises in SICP 
 was to write a lisp snippet that did just that.

 Awesome stuff, through and through.

An awesome way to hit compiler bugs, huh? Well sorry, but it's really like that: programming with D is awesome, until you hit problems like ICEs.

I agree that it's a problem, which is why the latest compiler release got rid of 40% of the remaining segfault and ICE bugs (including the three most commonly encountered). You should find a significant improvement now. I have patches for many of the remaining bugs. Unfortunately there are 5 ICE bugs in bugzilla with no test cases, which means they can't be fixed.

Your work is astounding, amazing, and heartening. Thank you.
May 16 2009
parent reply Don <nospam nospam.com> writes:
Christopher Wright wrote:
 Don wrote:
 grauzone wrote:
 Incidentally, here, or in D.learn, somebody was asking for symbolic 
 derivation with D templates. I think one of the excercises in SICP 
 was to write a lisp snippet that did just that.

 Awesome stuff, through and through.

An awesome way to hit compiler bugs, huh? Well sorry, but it's really like that: programming with D is awesome, until you hit problems like ICEs.

I agree that it's a problem, which is why the latest compiler release got rid of 40% of the remaining segfault and ICE bugs (including the three most commonly encountered). You should find a significant improvement now. I have patches for many of the remaining bugs. Unfortunately there are 5 ICE bugs in bugzilla with no test cases, which means they can't be fixed.

Your work is astounding, amazing, and heartening. Thank you.

Thanks! It's a fit of rage, actually. I hit one compiler segfault too many, and turned violent. After a couple more, I'll probably be calmed down enough to return to library development. <g> BTW, only about half the bugs fixed in the last release were from me (not all my patches were correct).
May 16 2009
parent Georg Wrede <georg.wrede iki.fi> writes:
Don wrote:
 Christopher Wright wrote:
 Your work is astounding, amazing, and heartening. Thank you.
 
 Thanks!

Yup, in case I haven't said so before, I agree with Christopher!
 It's a fit of rage, actually. I hit one compiler segfault too many, and 
 turned violent.

Hey, you're human.
 After a couple more, I'll probably be calmed down enough 
 to return to library development. <g>

Take your time.
 BTW, only about half the bugs fixed in the last release were from me 

And modest! That's not the norm.
 (not all my patches were correct).

Hell, you're mortal! But your contributions aren't. :-)
May 16 2009
prev sibling parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
Don wrote:
 grauzone wrote:
 Incidentally, here, or in D.learn, somebody was asking for symbolic
 derivation with D templates. I think one of the excercises in SICP
 was to write a lisp snippet that did just that.

 Awesome stuff, through and through.

An awesome way to hit compiler bugs, huh? Well sorry, but it's really like that: programming with D is awesome, until you hit problems like ICEs.

I agree that it's a problem, which is why the latest compiler release got rid of 40% of the remaining segfault and ICE bugs (including the three most commonly encountered). You should find a significant improvement now.

That's really awesome, by the way.
 I have patches for many of the remaining bugs. Unfortunately there are 5
 ICE bugs in bugzilla with no test cases, which means they can't be fixed.

Better than having a crash with OPTLINK with no error message nor indication of what the problem is, where the only reproducible test case is 2MB worth of object files and which has already cost you four days of trying fruitlessly to work around it, still without a solution. And the code works flawlessly under Linux, but all the users have Windows. ... I hate OPTLINK. *sobs* -- Daniel
May 16 2009
next sibling parent Christopher Wright <dhasenan gmail.com> writes:
Daniel Keep wrote:
 Better than having a crash with OPTLINK with no error message nor
 indication of what the problem is, where the only reproducible test case
 is 2MB worth of object files and which has already cost you four days of
 trying fruitlessly to work around it, still without a solution.
 
 And the code works flawlessly under Linux, but all the users have Windows.
 
 ...
 
 I hate OPTLINK.  *sobs*
 
   -- Daniel

Okay, the next project will be to get Don into a raging fit over OPTLINK :)
May 16 2009
prev sibling parent reply Don <nospam nospam.com> writes:
Daniel Keep wrote:
 
 Don wrote:
 grauzone wrote:
 Incidentally, here, or in D.learn, somebody was asking for symbolic
 derivation with D templates. I think one of the excercises in SICP
 was to write a lisp snippet that did just that.

 Awesome stuff, through and through.

Well sorry, but it's really like that: programming with D is awesome, until you hit problems like ICEs.

got rid of 40% of the remaining segfault and ICE bugs (including the three most commonly encountered). You should find a significant improvement now.

That's really awesome, by the way.
 I have patches for many of the remaining bugs. Unfortunately there are 5
 ICE bugs in bugzilla with no test cases, which means they can't be fixed.

Better than having a crash with OPTLINK with no error message nor indication of what the problem is, where the only reproducible test case is 2MB worth of object files and which has already cost you four days of trying fruitlessly to work around it, still without a solution. And the code works flawlessly under Linux, but all the users have Windows. ... I hate OPTLINK. *sobs* -- Daniel

Ouch. Do you think it might be bug 1439? (note that the test case probably doesn't work any more, since Walter started hashing ultra-long mangled names, but the point remains that there's a (narrow) range of symbol lengths which will kill OPTLINK). Or yet another instance of bug 424? Or is likely to be something else? (IE, is your code template-heavy?) I can't make bug 2817 crash, and it's the only other plausible optlink segfault in bugzilla.
May 16 2009
parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
Don wrote:
 Do you think it might be bug 1439? (note that the test case probably
 doesn't work any more, since Walter started hashing ultra-long mangled
 names, but the point remains that there's a (narrow) range of symbol
 lengths which will kill OPTLINK). Or yet another instance of bug 424? Or
 is likely to be something else? (IE, is your code template-heavy?)
 I can't make bug 2817 crash, and it's the only other plausible optlink
 segfault in bugzilla.

I don't think it's 1439. The crash actually only shows up when I use -g or -gc when I'm compiling. If I leave that off, it's fine. It's when I try to use tango.math.random.Random that it starts crashing. I can use one method from that module, it's fine. If I try to use more than one, it blows up. Note that it's quantity, not a specific symbol. Plus, if I compile the module with just a dummy main method, it's fine. It MIGHT be 424. I'm getting the crash at EIP=004244FB. I'm not getting a fixups error message, if that's part of the symptoms, though. My code isn't "template-heavy" (at least, not by my standards), but the Random module does appear to be. I'm toying with a little OMF dumper program at the moment. I suppose that's the easiest way to see if I'm hitting the fixup limit... Incidentally, if Walter or yourself would like the object files causing the crash, I can provide those (probably via private email). I just can't upload it generally since it's a private project. -- Daniel
May 17 2009
next sibling parent Max Samukha <outer space.com> writes:
On Sun, 17 May 2009 19:52:50 +1000, Daniel Keep
<daniel.keep.lists gmail.com> wrote:

Don wrote:
 Do you think it might be bug 1439? (note that the test case probably
 doesn't work any more, since Walter started hashing ultra-long mangled
 names, but the point remains that there's a (narrow) range of symbol
 lengths which will kill OPTLINK). Or yet another instance of bug 424? Or
 is likely to be something else? (IE, is your code template-heavy?)
 I can't make bug 2817 crash, and it's the only other plausible optlink
 segfault in bugzilla.

I don't think it's 1439. The crash actually only shows up when I use -g or -gc when I'm compiling. If I leave that off, it's fine. It's when I try to use tango.math.random.Random that it starts crashing. I can use one method from that module, it's fine. If I try to use more than one, it blows up. Note that it's quantity, not a specific symbol. Plus, if I compile the module with just a dummy main method, it's fine. It MIGHT be 424. I'm getting the crash at EIP=004244FB. I'm not getting a fixups error message, if that's part of the symptoms, though. My code isn't "template-heavy" (at least, not by my standards), but the Random module does appear to be. I'm toying with a little OMF dumper program at the moment. I suppose that's the easiest way to see if I'm hitting the fixup limit... Incidentally, if Walter or yourself would like the object files causing the crash, I can provide those (probably via private email). I just can't upload it generally since it's a private project. -- Daniel

An object file was provided with this report http://d.puremagic.com/issues/show_bug.cgi?id=2436. But it was deemed too complex. This bug also shows up when debug-building QtD. FWIW, QtD uses lots of long identifiers but few templates.
May 17 2009
prev sibling next sibling parent Don <nospam nospam.com> writes:
Daniel Keep wrote:
 
 Don wrote:
 Do you think it might be bug 1439? (note that the test case probably
 doesn't work any more, since Walter started hashing ultra-long mangled
 names, but the point remains that there's a (narrow) range of symbol
 lengths which will kill OPTLINK). Or yet another instance of bug 424? Or
 is likely to be something else? (IE, is your code template-heavy?)
 I can't make bug 2817 crash, and it's the only other plausible optlink
 segfault in bugzilla.

I don't think it's 1439. The crash actually only shows up when I use -g or -gc when I'm compiling. If I leave that off, it's fine. It's when I try to use tango.math.random.Random that it starts crashing. I can use one method from that module, it's fine. If I try to use more than one, it blows up. Note that it's quantity, not a specific symbol. Plus, if I compile the module with just a dummy main method, it's fine. It MIGHT be 424. I'm getting the crash at EIP=004244FB. I'm not getting a fixups error message, if that's part of the symptoms, though. My code isn't "template-heavy" (at least, not by my standards), but the Random module does appear to be. I'm toying with a little OMF dumper program at the moment. I suppose that's the easiest way to see if I'm hitting the fixup limit...

You could try objconv from www.agner.org. Might work.
 
 Incidentally, if Walter or yourself would like the object files causing
 the crash, I can provide those (probably via private email).  I just
 can't upload it generally since it's a private project.
 
   -- Daniel

May 17 2009
prev sibling parent "Nick Sabalausky" <a a.a> writes:
"Daniel Keep" <daniel.keep.lists gmail.com> wrote in message 
news:guomo9$1kdg$1 digitalmars.com...
 I'm toying with a little OMF dumper program at the moment.  I suppose
 that's the easiest way to see if I'm hitting the fixup limit...

Debug builds of DMD print out a "number of fixups" message at the end. Maybe that would help? Although I don't know if it does that before or after linking.
May 17 2009
prev sibling parent Georg Wrede <georg.wrede iki.fi> writes:
Bill Baxter wrote:
 On Fri, May 15, 2009 at 7:40 PM, Georg Wrede <georg.wrede iki.fi> wrote:
 Bill Baxter wrote:
 Incidentally, here, or in D.learn, somebody was asking for symbolic
 derivation with D templates. I think one of the excercises in SICP was to
 write a lisp snippet that did just that.

You're probably thinking of my message about automatic differentiation. Automatic differentiation is not the same as symbolic differentiation. Symbolic differentiation is not really very useful in practice since expressions tend to balloon out into huge messes. It also only works on things that are differentiable functions. Automatic differentiation, on the other hand, works on code rather than on mathematical functions. You can run AD on loops and other things that symbolic differentiation just doesn't know how to handle, and all of this can be done in O(N) where N is the complexity of the forward expression. I posted a bunch of links in that other thread that explain the difference in more detail if you'd like to know more.

Ah, thanks!
May 17 2009
prev sibling next sibling parent Jesse Phillips <jessekphillips gmail.com> writes:
On Thu, 14 May 2009 19:05:04 -0500, Andrei Alexandrescu wrote:

 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering
 whether I should be adding exercises to the book. Some books have them,
 some don't.
 
 Pros: As I'm writing, I've come up with some pretty darn cool exercise
 ideas.
 
 Cons: The book gets larger, takes longer to write, and I never solved
 the exercises in the books I've read, but then I'm just weird.
 
 What do you think?
 
 
 Thanks,
 
 Andrei

I don't usually do exercises, but as others have pointed out a lot of times they end up just being stupid questions. I think there should be a few, one or two per chapter, this way they can really concentrate on the key points of the chapter. (I supposed you just shouldn't force exercises if they are not any good) I want to point out that a good index should be included, something LTTWD really missed. (Yes I know about http://downloads.dsource.org/projects/ tango/book/TangoIndex.pdf since I wrote it)
May 15 2009
prev sibling next sibling parent reply "Simen Kjaeraas" <simen.kjaras gmail.com> writes:
Andrei Alexandrescu wrote:

 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm pondering  
 whether I should be adding exercises to the book. Some books have them,  
 some don't.

 Pros: As I'm writing, I've come up with some pretty darn cool exercise  
 ideas.

 Cons: The book gets larger, takes longer to write, and I never solved  
 the exercises in the books I've read, but then I'm just weird.

 What do you think?

I love exercises. They're great for people who are trying to learn the language, and a great help to those of us who help them learn (not only teachers, I'm a student myself, and spend a lot of time reviewing other students' code to iron out their errors and teach them how things work). Also, if the exercises have solutions, I can challenge myself to make the solution faster, shorter, neater, or whatever. -- Simen.
May 16 2009
parent Georg Wrede <georg.wrede iki.fi> writes:
Simen Kjaeraas wrote:
 Andrei Alexandrescu wrote:
 
 A chunky fragment of TDPL will hit Rough Cuts soon enough. I'm 
 pondering whether I should be adding exercises to the book. Some books 
 have them, some don't.

 Pros: As I'm writing, I've come up with some pretty darn cool exercise 
 ideas.

 Cons: The book gets larger, takes longer to write, and I never solved 
 the exercises in the books I've read, but then I'm just weird.

 What do you think?

I love exercises. They're great for people who are trying to learn the language, and a great help to those of us who help them learn (not only teachers, I'm a student myself, and spend a lot of time reviewing other students' code to iron out their errors and teach them how things work). Also, if the exercises have solutions, I can challenge myself to make the solution faster, shorter, neater, or whatever.

Ah, forgot about that. A book author trying to write the theoretically best solution for an excercise is wasting his own time, won't be judged by them being sub-Perfect, and frustrates the reader who really happens to need the book. The solutions have to be good-enough. Not more. But ideally, the problem description will guide the reader towards trying something, the result of which should tell him if he's understood the crux of the chapter.
May 16 2009
prev sibling parent Bill Baxter <wbaxter gmail.com> writes:
On Fri, May 15, 2009 at 7:40 PM, Georg Wrede <georg.wrede iki.fi> wrote:
 Bill Baxter wrote:

derivation with D templates. I think one of the excercises in SICP was to write a lisp snippet that did just that.

You're probably thinking of my message about automatic differentiation. Automatic differentiation is not the same as symbolic differentiation. Symbolic differentiation is not really very useful in practice since expressions tend to balloon out into huge messes. It also only works on things that are differentiable functions. Automatic differentiation, on the other hand, works on code rather than on mathematical functions. You can run AD on loops and other things that symbolic differentiation just doesn't know how to handle, and all of this can be done in O(N) where N is the complexity of the forward expression. I posted a bunch of links in that other thread that explain the difference in more detail if you'd like to know more. --bb
May 17 2009