Comment by levocardia

Comment by levocardia 4 days ago

24 replies

For the longest time I had ffmpeg in the same bucket as regex: "God I really need to learn this but I'm going to hate it so much." Then ChatGPT came along and solved both problems!

zxvkhkxvdvbdxz 4 days ago

Interesting. Being able to use regexps for text processing through my career has probably saved me a few thousand hours of programming one-off solutions so far. It is one of those skills that really pays off to learn proper.

And speaking of ffmpeg, or tooling in general, I tend to make notes. After a while you end up with a pretty decent curated reference.

  • codetrotter 4 days ago

    I use regexes a lot. The main thing that always trips me up is dealing with escaping, because different tools I use – vim, sed, rg, and so on – sometimes have different meanings for when to escape or not.

    In one tool you’ll use + to match one or more times, and \+ to mean literal plus sign.

    In another tool you’ll use \+ to match one or more time, and + to mean literal plus sign.

    In one tool you’ll use ( and ) to create a match group, and \( and \) to mean literal open and close parentheses.

    In another tool you’ll use \( and \) to create a match group, and ( and ) to mean literal open and close parentheses.

    This is basically the only problem I have when writing regexes, for the kinds of regexes I write.

    Also, one thing that’s not a problem per se but something that leads me to write my regexes with more characters than strictly necessary is that I rarely use shorthand for groups of characters. For example the tool might have a shorthand for digit but I always write [0-9] when I need to match a digit. Also probably because the shorthand might or might not be different for different tools.

    Regexes are also known to be “write once read never”, in that writing a regex is relatively easy, but revisiting a semi-complicated regex you or someone else wrote in the past takes a little bit of extra effort to figure out what it’s matching and what edits one should make to it. In this case, tools like https://regex101.com/ or https://www.debuggex.com/ help a lot.

    • nuancebydefault 3 days ago

      The problem with escaping (like with using quotes) is often that you need to know through how many parsers the string goes. The shell or editor, the language you are programming in and the regexp engine each time can strip off an escape character or a set of outer quotes. That and of course different dialects of regexp makes things complicated.

    • account42 2 days ago

      This is like saying that words have different meaning if you talk to someone in english or french. Most tools have a switch to inform them that you're going to talk in english (perl-compatible regular expressions).

  • mystified5016 4 days ago

    No one doubts the power or utility of regexes or ffmpeg, but they are both complicated beasts that really take a lot of skill.

    They're both tools where if they're part of your daily workflow you'll get immense value out of learning them thoroughly. If instead you need a regex once or twice a week, the benefit is not greater than the cost of learning to do it myself. I have a hundred other equally complicated things to learn and remember, half the job of the computer is to know things I can't put in my brain. If it can do the regex for me, I suddenly get 70% of the value at no cost.

    Regex is not a tool I need often enough to justify the hours and brain space. But it is still an indespensible tool. So when I need a regex, I either ask a human wizard I know, or now I ask my computer directly.

    • imp0cat 3 days ago

      It's self-reinforcing though. If you invest the time to learn, then you may find yourself (i a beafutiful house :)) using it a lot more than two times a week.

      • nuancebydefault 3 days ago

        I think this way of thinking is an uphill battle.

        My kid uses wifi, google classroom tools, youtube, games,... I can tell him if only you knew command.com, ipconfig, doom.wad formats, lateg,... you could be so much more proficient. I already know this will never happen, just like I never learned x86 assembly.

        The same goes for tools like LLMs, once you are used to them, your knowledge shifts.

        • skydhash 3 days ago

          I learned a bit of assembly and it was a god send to understand linkers and how FFI works. Also make it easier to have a good model on using a debugger. Not that useful on a tactical level, but really great when faced with some errors in your compiled programs.

    • [removed] 3 days ago
      [deleted]
earnestinger 4 days ago

Not sure about ffmpeg, but you should definitely try memorising regexp. Casual Search&replace that becomes possible is worth it.

  • sergiotapia 4 days ago

    in 15 years it never sticks and by the time i need it again i've forgotten it! :D

    • kevin_thibedeau 4 days ago

      Don't learn the Perl influenced extensions. You just need POSIX EREs (and BREs for some older utilities) which are simple enough to keep in the head.

      • ziml77 4 days ago

        And with the POSIX EREs, everything except the syntax for character classes will carry over to other common Regex dialects.

teaearlgraycold 4 days ago

Gotta be honest, years of configuring automod on Reddit have honed me into a regex God.

jmb99 3 days ago

For me, it wasn’t so much learning ffmpeg, as it was understanding containers/codecs/encoders/streams/etc. Learning all of the intricacies there made ffmpeg make a lot more sense.

  • skydhash 3 days ago

    Almost no one cares to understand the domain of the tool anymore, they only want result and expect a simplified interface that already does the unique thing they want to do, but can’t accept that a power tool can only be used with training.

hackingonempty 4 days ago

CSS has entered the ChatGPT.

  • kccqzy 4 days ago

    My rule for using LLMs is that anything that's one off is okay. Anything that's more permanent and committed to a repo needs a human review. I strongly suggest you have an understanding of the basics (at least the box model) so that you are competent at reviewing CSS code before using LLM for that.

  • permo-w 4 days ago

    I've been looking for a good guide on prompting LLMs for CSS.

    does anyone know of any?

    • johnisgood 3 days ago

      I have no set of rules when prompting LLMs for CSS, it does seem to work more or less for me though.

      What are your current issues or what limitations have you ran into?

      • permo-w 3 days ago

        mainly with trying to impart a particular art style.