[Baypiggies] Code/Idea Review (WARNING: SPOILER)

Shannon -jj Behrens jjinux at gmail.com
Wed Dec 26 05:16:22 CET 2007


On Dec 15, 2007 11:23 AM, Glen Jarvis <glen at glenjarvis.com> wrote:
> As a recent transplant to the Bay Area, I must say that I never
> realized how much of a geek haven this was. I knew it would be richer
> in geeks, but I did not know moving here would be one of the smartest
> decisions I ever made!
>
> I went to my second Bay Piggies meeting. And, I had an incredible
> time. JJ was absolutely awesome and allowed me to ride with him.

Ah, shucks!

/me blushes

> And,
> he, his co-worker, several people he socialized with, and myself had
> some incredible conversations for several hours. You can't help but
> genuinely like all of these guys. They're fun to talk to, smart, and
> just 'get it' instead of getting board or eyes glassing over.
>
> And, I'm usually a very big duck in a little puddle. At BayPIGgies,
> I'm an itty bitty new duckling, wet behind the ears. And, there are
> so many people who genuinely want to help.
>
> I learned two really incredible things this time: PEP-8 and the
> Python Challenge.

I remember that the speaker had his own opinion of how to learn
Python, but I personally suggest reading "Learning Python" and doing
all the exercises.  I know it's getting a bit longer than it was in
the first edition, but by the time you finish the book, you're 80% of
the way to being a Python master.

As for the Python Challenge, I really did not like it.  I got really
irritated by the fact that I couldn't figure out what it actually
wanted by the time I got to level 7 or so.  Coding the Python was
usually really easy once I figured out what it wanted :-/  To each his
own, I guess.  Perhaps it's good training for dealing with clients ;)

> Because of the talk, I discovered the Python
> Challenge (http://www.pythonchallenge.com/). What a great way to
> challenge ourselves. The first two (0, and 1) were real easy
> challenges. However, instead of just marching on, I am trying to be a
> code nazi. I want to keep the code for each of these challenges, I
> want it to pass a PEP-8 level code review, and I want it to be the
> most 'intelligent' choice for the objective.
>
> In challenge 1, I was able to create some python code fairly quickly
> to translate the text enough to catch the gist fairly quickly.
> However, as a typical non-python coder, I used a loop instead of
> string.maketrans(). After reading the string module help, I was able
> to keep reducing and rewriting this until it was closer to what I
> thought the challenge wanted us to do.
>
> I would like it, if you don't mind, if you gave me a thorough peer
> review for such a small piece of code. I want to know anytime I break
> convention with PEP-8. Also, if I received replies like "crap code,
> dude." that, unfortunately is not helpful. What would be helpful if I
> heard *why* it was crap so I could learn from it. The same is true
> for "cool code." That doesn't tell me what my weaknesses or strengths
> are.
>
> I believe lines 6 and 7 can be reduced to be more readable and better
> written. If any (or all) can oblige, I would love to learn. Be
> warned, however, that this is a solution to the second Python
> Challenge. You should do the first two challenges yourself so there
> are no spoilers.
>
> I *heart* BayPIGgies!
>
> Cheers,

Happy Hacking!
-jj

-- 
I, for one, welcome our new Facebook overlords!
http://jjinux.blogspot.com/


More information about the Baypiggies mailing list