Live data from Hacker News

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

github.com

31–40 of 96 posts

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

#31
post #22

Even as a software engineer who studied mathematics, I just can't get excited about the type of problems found in Advent of Code and other such things, like Project Euler. Those problems amount to little puzzles and tricks and algorithms that have little to no context. What I find interesting about computing and programming is the representation and exploration of ideas. Also, I can't help but wonder. Why does the Di…

...Because he finds it fun?

We don't have to all enjoy the same things.

In this particular case also, if you read his code, I would be surprised if you don't learn something.

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

#32
post #22

Even as a software engineer who studied mathematics, I just can't get excited about the type of problems found in Advent of Code and other such things, like Project Euler. Those problems amount to little puzzles and tricks and algorithms that have little to no context. What I find interesting about computing and programming is the representation and exploration of ideas. Also, I can't help but wonder. Why does the Di…

Why do we speak in english instead of other interesting languages? Between java, python, and haskell (which are the linguae francae of the papers which I tend to read, the first and last having replaced C and lisp during my lifetime) I think python is a defendable choice for minimising boilerplate while maximising potential readership.

Learning a programming language isn't anywhere near the difficulty of learning a new spoken and written language.

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

#33
post #31
post #22

Even as a software engineer who studied mathematics, I just can't get excited about the type of problems found in Advent of Code and other such things, like Project Euler. Those problems amount to little puzzles and tricks and algorithms that have little to no context. What I find interesting about computing and programming is the representation and exploration of ideas. Also, I can't help but wonder. Why does the Di…

...Because he finds it fun? We don't have to all enjoy the same things. In this particular case also, if you read his code, I would be surprised if you don't learn something.

That's fine, but it addresses a bunch of things I didn't say.

I'm sure I would learn something if I read through the code in more detail, but that's true of a ton of things and time is what it is. I merely commented on what I personally find interesting and uninteresting. Also, even I, a non-Director of Research at Google and non-computer scientist, don't particular enjoy using the language I use on a day-to-day basis for fun in my personal time.

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

#34
post #22

Even as a software engineer who studied mathematics, I just can't get excited about the type of problems found in Advent of Code and other such things, like Project Euler. Those problems amount to little puzzles and tricks and algorithms that have little to no context. What I find interesting about computing and programming is the representation and exploration of ideas. Also, I can't help but wonder. Why does the Di…

I find it fascinating (in a very good way) that he does find time to code. Python is not a bad language, in all fairness, any programming language which picks your interest enough to spend time working with it is a good choice. The added benefit of Python is the ease of using something like Jupyter notebooks, which make it trivial to iterate. (disclaimer: I coded more in Ruby than in Python, but I still enjoy both)

> The added benefit of Python is the ease of using something like Jupyter notebooks, which make it trivial to iterate.

Although, other languages do have better REPLs, allowing easier iteration than Python's REPL. Some languages, have both a better REPL and notebook-style programming, such as F#.

But I was really more curious rather than saying which language would be "better".

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

#35
post #22

Even as a software engineer who studied mathematics, I just can't get excited about the type of problems found in Advent of Code and other such things, like Project Euler. Those problems amount to little puzzles and tricks and algorithms that have little to no context. What I find interesting about computing and programming is the representation and exploration of ideas. Also, I can't help but wonder. Why does the Di…

>what looks like exclusively, in Python rather than other interesting languages?

probably because he cares more about the problems and less about the language and python is a pleasant general purpose language (and ubiquitous in AI research)

I never understood why many software developers are so focused on languages rather than on problems, the language at the end of the day doesn't really matter, unless the problem is in a very peculiar domain.

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

#36
post #22

Even as a software engineer who studied mathematics, I just can't get excited about the type of problems found in Advent of Code and other such things, like Project Euler. Those problems amount to little puzzles and tricks and algorithms that have little to no context. What I find interesting about computing and programming is the representation and exploration of ideas. Also, I can't help but wonder. Why does the Di…

>what looks like exclusively, in Python rather than other interesting languages? probably because he cares more about the problems and less about the language and python is a pleasant general purpose language (and ubiquitous in AI research) I never understood why many software developers are so focused on languages rather than on problems, the language at the end of the day doesn't really matter, unless the problem i…

It is less about hyper-focus on language and more of a curiosity. Yes, I personally don't like Python, but I would have the same curiosity if he used , had written a book using , and if Google heavily used .

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

#37
post #27
post #22

Even as a software engineer who studied mathematics, I just can't get excited about the type of problems found in Advent of Code and other such things, like Project Euler. Those problems amount to little puzzles and tricks and algorithms that have little to no context. What I find interesting about computing and programming is the representation and exploration of ideas. Also, I can't help but wonder. Why does the Di…

Here's his (Norvig's) previous answer on "Why Python" as a HN comment he made ~10 years ago: https://news.ycombinator.com/item?id=1803815 Also: https://norvig.com/python-lisp.html

Thanks for those, but I have read them already. His comments on his book and Python are not really relevant in today's world and are more of a historical interest. Also, I don't really understand the timeline from his comment and am not familiar enough with the book to know its history. Did the first edition use Python? (I am aware of his and Russell's prior AI book.)

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

#39

Can someone please explain how `for y in nums & {2020 - x} ` in his day 1 solution?

{2020 - x} is a single item set. nums & {2020 - x} does set intersection with nums, which restricts nums to either the item that sums with x to 2020 or nothing if there is no such item in nums.

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

#40
post #4

Always look forward to these so I can compare my solutions afterwards. Sometimes it's almost frustrating to see how clean and concise the mess I made could have been, but I do learn a lot. It's like he gets as close to golfing as possible, without the obfuscation. Too bad he punted on 20... one of the few difficult problems this year. Usually the hard problems are where you really see the contrast between his solutio…

That one was tedious though. It's easy to see what the solution is, but it just takes a lot of time to write it up.
Post reply on HN