←back to thread

165 points fzliu | 2 comments | | HN request time: 0.001s | source
Show context
joshlemer ◴[] No.41844227[source]
I've been thinking recently about how things like Project Euler, LeetCode, and to a bit less of an extent, Advent of Code, are so heavily focused on making clever use of math, data structures and algorithms, that it makes them suboptimal as a tools for getting familiar with a new programming language.

I know that that critique isn't new to anyone but it makes me think about how it would be cool if there were a code puzzler site that is specifically geared towards little self-contained tasks that are more to do with forcing you to get familiar with the common everyday tasks of software development.

Some example puzzlers could be like:

- open an http server on port 80

- open a file and write this data to it

- write temporary files to a location, deleting them when process exits

- query a database

- deal with such and such error scenario

- find a way to test this component

- bundle this code as an executable

- sanitize user input here

- make this behavior configurable

- take the config from environment variable variable and/or config file and/or arguments

- parse this data file

You do get a bit of parsing and file handling with Advent of Code but imagine a series of dozens of small problems that grill you on every corner of the python filesystem api. Would be a lot less dry than reading docs cover to cover.

replies(13): >>41844284 #>>41844312 #>>41844322 #>>41844599 #>>41844778 #>>41844869 #>>41844936 #>>41845344 #>>41845862 #>>41846052 #>>41847536 #>>41847980 #>>41851069 #
hoten ◴[] No.41844312[source]
to be fair, PE is not designed or meant for helping people learn a language. that isn't the project's intent.

people do like to say they use PE for learning new languages, but I doubt that is a useful exercise beyond maybe the first dozen problems or so. And even then, if the solution isn't obvious to you, you're doing two things at once - learning a language and solving a math puzzle. I don't see why people would sign up to get frustrated like that.

replies(2): >>41844631 #>>41847932 #
1. Bjartr ◴[] No.41847932[source]
> I don't see why people would sign up to get frustrated like that.

I actually use this as a learning trick. Pick two or three things to learn simultaneously, then when I get stuck on one aspect, switch to another. When I finally switch back, I often find the background time I gave my brain to process the problem means I'll now be much faster to get unstuck on the original issue.

There's definitely ways this can go sideways, and it's not for everybody, but I find it pretty effective.

replies(1): >>41850339 #
2. joshlemer ◴[] No.41850339[source]
I guess the trouble is that in the case of LeetCode/PE, people actually just want the one thing (programming language proficiency), and not the other (mathematics). Learning 2 things at once can be very useful, but a lot of people would probably choose something else for their second skill. Most relevant for developers might be, networking, OS's, version control, databases, testing, CI/CD, security, concurrency.