News for hackers. Stuff that matters.
Re:No CSS Club – because no JavaScript was not hardcore enough by Wowfunhappy on Sunday July 16, 2023 @08:16AM (#36746129)
> Not even if it's an example of a one-liner in bash - wrap that line to make it easier to read.

This is the one case (that I can think of right now) where I don't agree.

As part of a larger script, sure, I agree, wrap the line so it's not way longer than all the other lines.

But a single shell command, in isolation, is always easier to read as a single line, if sufficient horizontal space is available.

Re:No CSS Club – because no JavaScript was not hardcore enough by jprete on Sunday July 16, 2023 @08:32AM (#36746244)
When writing outside of a terminal, I wrap single-line shell commands with backslashes and space indentation. The breaks are at logical clauses, as if writing a conventional programming language. I find this much more readable than the alternatives. Often my terminal will also get it this way, from a copy-paste.

This also usually helps in documentation.

Re:No CSS Club – because no JavaScript was not hardcore enough by Gordonjcp on Sunday July 16, 2023 @12:25PM (#36748703)
If I have to do it twice I stick it in a proper script, with some comments, so I remember what it all does next time I go to do it. I do this particularly for stuff like complex ffmpeg filter chains where I need to do a lot of stuff to a video file. By simply running the bash script, at some later date I can get it to remind me what it does, and suitably mangle the video file.

Then, later on, often weeks later, I use command history to scroll back through everything I've typed until I find something that looks vaguely like what I originally typed, or I don't find it and figure it all out from scratch again, having totally forgotten about the bash script I wrote.

I suspect this workflow is surprisingly common.

Re:No CSS Club – because no JavaScript was not hardcore enough by Gordonjcp on Sunday July 16, 2023 @08:22AM (#36746168)
Yeah, but how many times do you see a one-liner that's in a nice little boxout, but there's a scrollbar and you need to slide it backwards and forwards to read the whole thing?