Hacker News new | ask | show | jobs
by charcircuit 1604 days ago
>Essentially, what you're saying is that the article disappointed you because it purported to be about making pizza, but didn't first specify how to make the oven.

No it's more akin about him saying he made a pizza, but all that was done was import a pizza and then sprinkle some pepperoni on it.

Imagine if I said I made an HTTP server in 6 lines.

    const express = require("express");
    const app = express();
    app.get("/", (req, res) => {
      res.send('Hello World!');
    });
    app.listen(8080);
I think it would be reasonable for people to say that I didn't make a HTTP server in 6 lines.

Just how I used a library to make a HTTP server me and I handled requests/responses, the author of this article used a library to handle DNS requests/responses. The 80 lines figure for making a DNS resolver is misleading when there are 26k lines of Go code (according to cloc) for handling DNS that are just in a library instead of the main file.

1 comments

You have managed simultaneously to radically underestimate the complexity of Node and Express's HTTP handling, while at the same time radically overestimating the complexity of what miekg/dns is being asked to do here.

The majority of the 20,000 lines of non-test code in miekg/dns are just handlers for record types the author of this article didn't need; much of the rest of it is stuff like zone file parsing and DNSSEC signatures, which again have nothing to do with what the author wrote.

What you conspicuously won't find in miekg/dns: a recursive lookup routine.

>What you conspicuously won't find in miekg/dns: a recursive lookup routine.

Sure, but it implements the building blocks that you need to create one. Those building blocks are going to be where a good chunk of code is going to be. (Yes, there is a lot of code from that library that will be unused)