Live data from Hacker News

“I Could Rewrite Curl”

daniel.haxx.se

181–190 of 193 posts

Re: “I Could Rewrite Curl”

#181

Earlier quoted context omitted.

The point is that you’re not always the person who gets to decide which distro, which tools to install atop the distro, or which dependencies your scripts will use. If you own those choices, of course you can add in your own tool, but you frequently don’t own those choices.

But cannot this charge be levied upon all tools and utilities? If you do not have the permission to bring your own tools it stands to reason that you will have to use the tools already in place, be that curl or some other random assortment of literally anything else. I don't much see the moral basis behind showing up at the construction yard and then lamenting over your lack of choice simply because your employer onl…

No one picks curl to be on a box, it a core library for everything else on the host. It's not a Makita drill, it's more like electrical power at the site and this guy is complaining this tool uses gas or propane.

Doesn't stop anyone else from using a power saw or charging batteries. If you need propane, bring it.

Re: “I Could Rewrite Curl”

#182
post #178

Earlier quoted context omitted.

The point is that you’re not always the person who gets to decide which distro, which tools to install atop the distro, or which dependencies your scripts will use. If you own those choices, of course you can add in your own tool, but you frequently don’t own those choices.

I feel the alternative is not better, a light weight bare minimum lib and no ability to install your own is definitely worse.

For sure, try to build out a Linux host without libcurl.

Re: “I Could Rewrite Curl”

#183
post #106

Earlier quoted context omitted.

A question that arises out of this is, should the 90% use cases be handled by a small, simple tool, or by the tip of the iceberg of a large, complex tool such as curl? I can see the advantages of standardizing on a complex, powerful tool for simple use cases. For one thing, it may be the only way to standardize: simple versions are too easy to write, and therefore you get dozens of competitors, none of whom are popul…

Sometimes yes, sometimes no. Counter-example: Jenkins. It does what you ask of it, its base install is "naked" and only contains the minimum functionality in the core. Everything then becomes a plugin. Git. GitHub. Branch for multi-branch pipelines. Credentials management. And on and on and on. Now you have stay on top of maintaining the plugins in addition to the core. Also, many plugins require other plugins so jus…

Also: node. Everything is a module, and every module requires a hundred more. Projects with thousands of dependencies become common. No one understands what is actually “under the hood” and hardly anyone cares. “It just works” most of the time. Good enough.

Sad.

Re: “I Could Rewrite Curl”

#184

Earlier quoted context omitted.

exactly, my point was, some people think they can build it in a day, because they see their favorite library already supports sending HTTP, they might not be aware that some of those libraries are wrappers around cURL library

Seen this comment a lot in the thread, I'd like to know which libraries do. Google didn't help (as usual nowadays).

PHP uses libcurl for http requests.

Re: “I Could Rewrite Curl”

#185

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.

>URL is the standard, pre-installed, do-everything, scriptable tool to interact with web APIs.

I don't need "do-everything" in cURL sense

Insomnia/Postmans works for all of my cases

"pre-installed" - so what? I do develop on my own PC, not someone's else. There's 0 problem with installing those tools at first install on my PC.

If I will have to use cURL, then I will use it, but I don't need it day2day.

>scriptable tool to interact with web APIs.

That's definitely good thing, but $my_lang has decent HTTP Wrappers

Additionally both of those tools generate cURL.

Re: “I Could Rewrite Curl”

#186
post #30

Let's be honest here. Curl to 98% of people is http/1 requests with some post params and maybe json body, with some custom headers. Most language standard libs (which might be using libcurl) can facilitate writing that relatively quickly. And probably with a more 'modern' CLI. Curl though, is a very wide breadth project. It currently supports the following protocols: DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP,…

They can rewrite curl (http(s) only) in Python using requests library.

Re: “I Could Rewrite Curl”

#187
Why do so many people indulge in casual mockery? Is it because we are told not to respect authority or institutions but instead to respect ideas? I see no reverence anymore; just casual mockery everywhere one turns. I am constantly awestruck all the time by how amazingly beautiful everything is in GNU/Linux world. What would I do without FOSS!

Re: “I Could Rewrite Curl”

#188
post #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 un…

"why don't you just ...", We also saw this with COVID. Plenty of people with no knowledge in infectious disease stating that the public solution was stupid and wrong but instead the obvious, simple and effective solution would be to "just do ....". Personally if that happens at work and somebody (often managers) tells us to solve a difficult problem by "why don't you just..." I usually tell them the code is available…

Yeah the inner source mode is useful in several ways. “That sounds interesting, we welcome pull requests” — much nicer than “there are about three fundamental things you are overlooking.”

Re: “I Could Rewrite Curl”

#189

Curl is magic. Every so often (less so in recent years) I come across a bad homespun implementation of an HTTP client embedded in a larger project. Usually, a few lines of code to open a socket and POST some data to a hard coded URL. I always replace these with curl, usually over the objections of the original programmer. The problem with HTTP (v1) is that it seems very simple to write a cut down client. But your sim…

Exactly! Most people using CURL don't realize how good it actually is or how complicated HTTP can get.

Sometime people started using expect headers (with content length) for long posts and 100-Continue and curl just handled it before I heard of it (outside of like push type apps).

Re: “I Could Rewrite Curl”

#190
post #163

Earlier quoted context omitted.

Doesn't Postman have a feature to allow exporting the request as curl and others though?

Sure, then they copy that nonsense command and send it to you, without really understanding what all of the options are, and just treating it like a magic blob. I could totally see myself doing this

I would rather have that magic blob if you need help making the request succeed than anything else in postman.
Post reply on HN