Live data from Hacker News

“I Could Rewrite Curl”

daniel.haxx.se

11–20 of 193 posts

Re: “I Could Rewrite Curl”

#11
post #6
post #4

People are envious

No, It's combination of Dunning-Kruger effect [0] and "Reality has a surprising amount of detail" effect [1]. [0] https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect [1] http://johnsalvatier.org/blog/2017/reality-has-a-surprising-...

And the fact that it would be really easy to rewrite a usable subset of curl if you use your language's `import curl` which has behind the scenes had as much development effort as curl itself.

Re: “I Could Rewrite Curl”

#14
I could rewrite Curl. But I certainly will not.

Of all the libraries I have ever used, Curl is the one I used the most and found the most useful. I have never had the idea to rewrite it or even use another library to replace it.

I'm not afraid to say that I love Curl!

Re: “I Could Rewrite Curl”

#15
What's frustrating is people who think that they can radically simplify something without knowing anything about it. The same people think they can implement a text editor in 1000 lines of code because that's how the first text editors were made. Why can't we go back to those simple days?

We can't because modern software handles cases that those didn't. For example, rendering and editing text seems straightforward until you look closer. Text Rendering Hates You (https://gankra.github.io/blah/text-hates-you/) and Text Editing Hates You Too (https://lord.io/blog/2019/text-editing-hates-you-too/) are two amazing reads that analyze this in detail. They explain the hidden complexity to the vast majority of us who never knew. We simply slapped down a or and called it a day.

If we tried to reimplement this stuff from scratch, we would likely start with a simple implementation, then tack on bits when we tried to handle issues like right-to-left layouts, Unicode, emoji, anti-aliasing, text overlapping and so on. All this before getting into implementing features that Dennis Ritchie didn't have to, like supporting plugins, releasing on multiple operating systems, accessibility or even syntax highlighting. Problems already known to and tackled by existing text editors today.

If you look at work outside of your area of expertise and you feel like starting a sentence like "why don't you just ...", then reconsider. If the person you're talking to is halfway competent (they probably are), they've already considered what you're about to say. "Have you considered using less memory/CPU or removing this feature that I personally don't need?" Why yes, we have.

(This is from a post I wrote earlier - Software Isn’t Bloated - https://blog.nindalf.com/posts/software-isnt-bloated/)

Re: “I Could Rewrite Curl”

#16
Every piece of software that people actually use will face criticism. But as quite honestly for some one with the clout of Mr Stenberg to out some poor Joe Codes just because they dared to have an opinion is just as pathetic if not more.

Writing an HTTP 1 client in a weekend is doable and Rust is probably a better language today than C is (with some caveats obviously). Is having that opinion enough to to be publicly humiliated on Mr Stenberg's blog, I sure hope not.

Re: “I Could Rewrite Curl”

#17
I wouldn't be surprised if the first comment is right that you could build a HTTP client sufficient for 90% of the usecases in ~100 lines or so. It's that other 10% that takes 90% of the time, effort and complexity, and for which having libraries like curl is invaluable.

Re: “I Could Rewrite Curl”

#18
post #11
post #6

Earlier quoted context omitted.

No, It's combination of Dunning-Kruger effect [0] and "Reality has a surprising amount of detail" effect [1]. [0] https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect [1] http://johnsalvatier.org/blog/2017/reality-has-a-surprising-...

And the fact that it would be really easy to rewrite a usable subset of curl if you use your language's `import curl` which has behind the scenes had as much development effort as curl itself.

curl is mostly libcurl, `curl` the executable command is just one of the ways to interface with it.

(Unless you're saying "let's pretend to reimplement curl by wrapping around curl behind the scenes," which is delightfully tautological.)

Re: “I Could Rewrite Curl”

#19

Just a little tangent but I think everyone should know cURL… not postman, not httpie or any other more “friendly” tool. cURL is the standard, pre-installed, do-everything, scriptable tool to interact with web APIs. I could say mostly the same stuff about knowing Bash. It separates the barely effective from hyper-effective individuals on simple day to day (programming) tasks.

I really wish busybox would bundle curl instead of wget. In the age of containers, I often find myself having to use wget when operating inside of one with busybox as shell, and I get it wrong on first try.

What usually trips me up is the syntax: `curl -O http://host/file` (goes to stdout without -O) instead of `wget http://host/file` (goes to file without -O)

Re: “I Could Rewrite Curl”

#20
Sometimes this is not completely wrong.

I never used Curl or looked at the source code, I don't know about the specifics, but rewriting a simpler copycat from scratch is not always a bad idea.

I've done that a few times, to prove a point or because the original was bad and too difficult to maintain.

Post reply on HN