Live data from Hacker News

Just Use Curl

justuse.org

131–140 of 154 posts

Re: Just Use Curl

#131
post #115

Earlier quoted context omitted.

Yeeeep. My response to this article is the same one I have to anyone out here screaming "it's so easy to just do it my way!": if it's so easy, then do it for me! The ffmpeg fans are the loudest screechers I've found, in this area. They'll point to the trainwreck of a UX that is Handbrake as an example of GUI for terminal commands. And, look - command line utilities are great and Handbrake is a super good product that…

What's supposedly wrong with Handbrake UX? To me it seems like the complexity is just irreducible. There's so many formats, so many bits and pieces that can go in a video stream, they're not very visualizable, and they have surprising edge case interactions. Not to mention there's a lot of "normally the program figures this out for you, but there's an option to override it if broken" knobs and dials.

Good UX is not about reducing complexity, nor is it about hiding complexity. It's about surfacing the exact utility a user needs in the exact context they are best suited to understand each of its inputs entirely (with the least friction in generating those inputs for the user). It's very hard to do. So much so that describing 'what is wrong' with a UX would be almost as burdensome as just designing a better UX. So I'm not going to tell you what is wrong with it; you KNOW what is wrong with it. It could be better. That you can't specify as to how just means that you aren't currently undertaking the complicated process of redesigning it. It doesn't mean you don't know good UX from bad UX.

Now, all of that aside, I do like Handbrake and I do think it offers a ton of functionality with so little friction that it's one of my very favorite and most-used apps. No login, no project setup, no x, no y, no z. Just a thin wrapper around a badass command line utility, with tons of options for users to override, and sensible defaults. There's a lot to love about Handbrake!

But "my grandma can use it", or "a plumber can use it", or "a person who doesn't understand the technicals and just needs to do one stupid thing that the app can definitely do, can use it" are signs of good UX. You wouldn't say any of those things about Handbrake.

Re: Just Use Curl

#132

Earlier quoted context omitted.

You can do all that in a shell script though

Of course you can, but shell scripting really fucking sucks . One moment you have a properly quoted JSON string, the next moment you have a list of arguments, oops you need to escape the value for this program to interpret it right, but another program needs it to be double-escaped, is that \, \\, or \\\\? What subset of shell scripting are we doing? Fish? modern Linux bash, macOS-compatible bash? The lowest common d…

Ok agreed. But you can also just use any scripting language of your choice. Now you have a completely open development platform for your APIs.

I guess parsing cmd line outputs would be annoying. Would be a worth while library to write

Re: Just Use Curl

#133

Earlier quoted context omitted.

Not really. In a terminal the whole input can be dynamic with variables, pipe and executors like find’s exec, xargs and parallels. That’s pretty much the whole point of a shell and CLI interaction.

yes, really. If you think what I'm describing cannot enter text into a cli, you are thinking about what I am describing wrong. There's nothing you can put onto a command line with a keyboard that cannot be put there by an app using string manipulation. You're welcome to try to describe something, though.

There is nothing that you can’t. Visual programming languages do exist and the shell is an REPL. What’s important is how well you can do it. If you nail down the common use cases, you can create a nice wrapper and people have done so.

But text is very versatile. Adding another layer on top is losing that versatility. And while graphics is nice, symbolic manipulation is on a whole other level.

So fo a closed, and I guess small, you can have gui for intuitiveness. But if you want expressivity, you need symbols and formalism.

But there’s one thing that still beat Graphic in terms of intuitiveness. Tacticality. I’d bet that it’s way faster for a person to learn a physical car dashboard than a touchscreen one.

Re: Just Use Curl

#135
post #9

There's also hurl: https://hurl.dev You define all your requests in a plaintext format and can inject variables etc... plus the name is kinda funny.

Hi maintainer of Hurl here, thanks for the link; Hurl is using libcurl as its HTTP engine (you can for instance use --curl to get an export of curl commands). In a few words, if you just use Hurl, you just use curl also...

Re: Just Use Curl

#136
post #14

> The UI/UX is perfect While I like curl, this is highly subjective, some people just prefer a GUI that can guide you and/or be visually explored. This whole piece also reads like someone is quite angry at people preferring a different workflow than them. Some aspects, like shell history, are also not the magic bullet they propose here as it doesn't, e. G., cover the actual responses. Curl's ability to do almost ever…

Just fyi: the writing style is a meme. I think it's following the "just use html"[0] format (though, that may be its own riff on the meme). Not to detract from you point; just to say that the author is probably not as angry as this could make them seem. [0] https://justfuckingusehtml.com/

Thank you for that pointer/explanation. That does make the choice of words understandable to some extent even if it feels a bit excessive.

Re: Just Use Curl

#137

Earlier quoted context omitted.

Emacs had something like this long ago (of course it did). https://github.com/pashky/restclient.el I also like httpie but they seem to have gone commercial.

I use emacs restclient all the time. I have requests saved in my orgmode notes that I can run with a simple C-c C-c. It's great.

You're using this as well?

https://github.com/alf/ob-restclient.el

Re: Just Use Curl

#138
I love curl and use it all the time (copying requests from the browser is maybe the most common usage) but:

> Q: But Postman has testing and automation!

> A: So does cURL in a shell script with || and && and actual programming languages. You want assertions? Pipe to grep or write a 3-line Python script. Done.

IMO if you're reaching for an "actual programming language" it's probably time to put curl down and switch to libcurl or whatever native equivalent is in that language.

Re: Just Use Curl

#139

I love curl and use it all the time (copying requests from the browser is maybe the most common usage) but: > Q: But Postman has testing and automation! > A: So does cURL in a shell script with || and && and actual programming languages. You want assertions? Pipe to grep or write a 3-line Python script. Done. IMO if you're reaching for an "actual programming language" it's probably time to put curl down and switch to…

The Google style guide is a good reference: https://google.github.io/styleguide/shellguide.html#s1.2-whe...

  - If you are writing a script that is more than 100 lines long, or that uses non-straightforward control flow logic, you should rewrite it in a more structured language now. Bear in mind that scripts grow. Rewrite your script early to avoid a more time-consuming rewrite at a later date.
  - When assessing the complexity of your code (e.g. to decide whether to switch languages) consider whether the code is easily maintainable by people other than its author.

Re: Just Use Curl

#140
post #135
post #9

There's also hurl: https://hurl.dev You define all your requests in a plaintext format and can inject variables etc... plus the name is kinda funny.

Hi maintainer of Hurl here, thanks for the link; Hurl is using libcurl as its HTTP engine (you can for instance use --curl to get an export of curl commands). In a few words, if you just use Hurl, you just use curl also...

Curious is there a go lib that can read the config file? I’d love to have this in some testing to make it more accessible.
Post reply on HN