Live data from Hacker News

Peter Norvig's “pytudes” for Advent of Code 2020

github.com

11–20 of 96 posts

Re: Peter Norvig's “pytudes” for Advent of Code 2020

#11

How do you algorithmically code like this? In my software engineering career, I am a plumber at best. Would fail hard at anyone who would ask me to code anything more than fizz buzz under time pressure. That said, I've built some incredible production worthy and robust systems that move mountains as a plumber. I am damn good at that.

I'd recommend taking a look at his book Paradigms of AI Programming [0]. It really shows his thought process in developing solutions to problems. The only other way is practice, and in particular practice with languages that offer functional features. Notice his use of lambdas, assignment of existing functions/constructors to more accurate names (Passport instead of dict, day 4), and higher order functions (quantify)…

What kind of experience do you need for this book? For most ML you need linear algebra and whatnot, but this doesn't appear necessary here. If you've worked through something like SICP, do you think that would be sufficient?

Re: Peter Norvig's “pytudes” for Advent of Code 2020

#12

Earlier quoted context omitted.

I'd recommend taking a look at his book Paradigms of AI Programming [0]. It really shows his thought process in developing solutions to problems. The only other way is practice, and in particular practice with languages that offer functional features. Notice his use of lambdas, assignment of existing functions/constructors to more accurate names (Passport instead of dict, day 4), and higher order functions (quantify)…

What kind of experience do you need for this book? For most ML you need linear algebra and whatnot, but this doesn't appear necessary here. If you've worked through something like SICP, do you think that would be sufficient?

This is more classical AI, if you have a foundation in algorithms and data structures you can follow along. More experience, it'll be easier. If you've worked through SICP and that's your primary study of programming, then you can approach PAIP, but may need to take your time and look up related material to help you out.

Re: Peter Norvig's “pytudes” for Advent of Code 2020

#13
This is another vote of confidence for type annotations. There still seems to be a debate between highly experienced Pythonistas whether typing is good or not.

In this case I think they work really well, and aren't stuck in places where they're not needed.

Re: Peter Norvig's “pytudes” for Advent of Code 2020

#14

How do you algorithmically code like this? In my software engineering career, I am a plumber at best. Would fail hard at anyone who would ask me to code anything more than fizz buzz under time pressure. That said, I've built some incredible production worthy and robust systems that move mountains as a plumber. I am damn good at that.

I am a plumber too, and a good one, but I notice (if you forgo the time pressure: my fast solutions are always plumbing) that the language I use matters in my thinking and that is probably how I learnt them. When I have the time, I think solutions up (mostly in my head or on 'paper'(scratch buffer)) in lisp/scheme, haskell/idris or apl/k. The result, when I consider it elegant, is usually very nice after translating to another language.

For Scheme I think my thinking came from working through SICP many years ago while the other languages in the list force you basically to first think about a solution before you start typing.

I am not saying, obviously, people cannot think up these things straight in rust, python, c# etc, however, for me personally, it works much better if I first work it out in one of the others; it is way too tempting to grab for my plumbing wrench otherwise.

Re: Peter Norvig's “pytudes” for Advent of Code 2020

#15
post #3

This is very well-written code. I don't think anyone would bring into question Norvig's technical skills, but I wouldn't think someone like him would spend much time at his job writing code, or have much free time to program as a hobby. As someone who aspires to a position similar to Norvig's (directing research at an organization that is frequently applied in real life), I think it's really cool to see him having ti…

If you haven't, you should check out the free course he gave at Udacity.

Re: Peter Norvig's “pytudes” for Advent of Code 2020

#17

How do you algorithmically code like this? In my software engineering career, I am a plumber at best. Would fail hard at anyone who would ask me to code anything more than fizz buzz under time pressure. That said, I've built some incredible production worthy and robust systems that move mountains as a plumber. I am damn good at that.

Practice.

Re: Peter Norvig's “pytudes” for Advent of Code 2020

#19
post #3

This is very well-written code. I don't think anyone would bring into question Norvig's technical skills, but I wouldn't think someone like him would spend much time at his job writing code, or have much free time to program as a hobby. As someone who aspires to a position similar to Norvig's (directing research at an organization that is frequently applied in real life), I think it's really cool to see him having ti…

If you haven't, you should check out the free course he gave at Udacity.

That was one of the first courses I took that course as I was learning to program. Of course most of it was way over my head at the time, but even to a beginner it was clear that he really, really knows what he is doing.

Re: Peter Norvig's “pytudes” for Advent of Code 2020

#20
post #3

This is very well-written code. I don't think anyone would bring into question Norvig's technical skills, but I wouldn't think someone like him would spend much time at his job writing code, or have much free time to program as a hobby. As someone who aspires to a position similar to Norvig's (directing research at an organization that is frequently applied in real life), I think it's really cool to see him having ti…

You've presented an excellent question, what could account for his having so much free time?
Post reply on HN