On 11/23/2012 1:10 PM, Brett Ritter wrote:
On Thu, Nov 22, 2012 at 10:39 PM, Peter O'Doherty
<m...@peterodoherty.net <mailto:m...@peterodoherty.net>> wrote:
Judging by the volume of replies, is it fair to say that this
problem was much too advanced for page 16 of an introductory text?
That is a matter of taste. There are two things you need to learn:
1) the syntax of the language
2) how to approach programming problems
#1 can be done gradually, #2 necessarily has a "hard" moment. For
that, you need a problem that requires you think in programming terms:
How can I break this down? What are the different conditions that
could break my logic? How do I avoid missing situations?
Once you cross that hump, it becomes "easy". Future problems will be
hard again, but never to the same degree - once you've internalized
the process, it's just a matter of refinement.
Myself, I'd prefer to get that hard part over quickly. Up to page 16
obviously taught you enough basic syntax for your initial stab, so I
think it was well timed. The important thing is for you to realize
that you're learning a thought pattern, like algebra - once you "get
it", the rest is merely learning applications and additional rules,
but that initial insight requires some mental wrestling that can't
really be reduced. If you're worried about the rest of the text
(which I'm unfamiliar with) being more hard than enjoyable, I'd
recommend continuing to play with this problem. Create variants
(lowest POSITIVE even number), learn the typical situations that make
it complicated. When someone can give you a problem in that vein and
you can write a solution without referring to your previous attempts
(or anyone elses), you've crossed the line and are forever changed.
From that point forward the best the book (or any programming text)
can do is challenge you, it can no longer be "hard". (Disclaimer:
certain _concepts_ can once again be hard, such as pointers (not in
python), lambdas, closures, etc. These should still be easier than
this initial learning step)
The bad part is that once you get it, you'll look back and wonder how
you considered it hard. The good part is that if you are a programmer
at heart, you'll find you love challenges. I think that's part of why
you've gotten so many replies - this is an easy problem to understand,
quick to provide a solution (right or wrong) for, and the constraints
placed on it (just to keep you from getting lost in unfamiliar syntax)
make it a mental challenge for us because our first approach is
disallowed.
Don't be disheartened at the difficulty, and don't fear it being this
hard all along.
--
Brett Ritter / SwiftOne
swift...@swiftone.org <mailto:swift...@swiftone.org>
This being said, prehaps an early chapter if not the first should be how
to think like a programmer.
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
--
-Shaboom.
Kirk Bailey
CEO, Freehold Marketing LLC
http://www.OneBuckHosting.com/
Fnord!
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor