←back to thread

165 points fzliu | 2 comments | | HN request time: 0s | 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 #
1. drewcoo ◴[] No.41846052[source]
If you're trying to model those "puzzlers" on actual dev work, then doing any of those things without a library/framework is a wrong answer.

Or is that your point? That coding like a pro means gluing those things together?

replies(1): >>41849738 #
2. joshlemer ◴[] No.41849738[source]
A few different things:

1. Yes, solving these puzzles would mean often mean using a library.

2. However, for most of the things I listed above, in most languages, a competent software developer should be able to, and most likely would just use the standard library.

3. Why not both? I can imagine a catalog with thousands of problem sets. Some may challenge you to (re-)implement some existing functionality yourself (as a super basic example, re-implement the java Optional::flatMap method or something). Others could challenge you to make use of existing implementations. Learning to make use of stdlib and other libraries and tools in the ecosystem is part of one's growth, and also so is working through those tools, tinkering, trying to think how you would have implemented them, and getting a better understanding of their internals (or at least, an understanding of how their internals MIGHT work)