Oh yeah they definitely have uses, but there’s a real tendency for people to go a bit crazy with them. Complex regexen aren’t exactly readable, there’s all kinds of fun performance gotchas, there’s sometimes other tools/algorithms that are more suitable for the task, and sometimes people try to use them to eg. parse HTML because they don’t know that it is literally impossible to use regular expressions to parse languages that aren’t regular
It’s entirely possible to parse HTML in PCRE. You shouldn’t, but it is possible. The language stopped being strictly regular a long time ago and is entirely capable of doing it.
Oh yeah, extensions which make them non-regular definitely can make it possible, but just because it’s now somewhat possible with some regex engines doesn’t mean it’s a good idea
I learned Regex once and now it just works. Only problem for me is using MacOS so the Regex flavors aren’t consistent. But once I sort that, it’s smooth sailing.
I realized a while ago that there’s nothing stopping me from writing rust like this
<span style="color:#323232;">;println!(</span><span style="color:#183691;">"This is great"</span><span style="color:#323232;">)
</span><span style="color:#323232;">;println!(</span><span style="color:#183691;">"I think everyone should write rust like this"</span><span style="color:#323232;">)
</span><span style="color:#323232;">;println!(</span><span style="color:#183691;">"Probably works in most languages that use semicolons"</span><span style="color:#323232;">)
</span><span style="color:#323232;">;
</span>
Named groups are nice but can I please define a group more than once because maybe I want to group my data and consolidate values in a logical way without you complaining I have already used a group previously. I know I did, I’m the one telling you, now capture it twice!
Regex feels distinctly eldritch to me. Like, a lot of computing knowledge feels like magic, but regex feels like the kind of magic you get by consorting with dark forces
The fade should be slow and subtle. At first the client thinks they are just imagining it, but then they start getting customer support calls about the site being faded, and their bosses are pointing it out too in meetings, and as it happens more and more the panic really begins to set in.
Finally they reach out to you in a desperation when there’s barely anything left of the site and ask you to urgently fix the problem, and you just shrug your shoulders sympathetically and explain it’s happening because they haven’t paid - but not like in a way that suggests you are doing it on purpose, but a way where it’s simply an unavoidable natural consequence, like if you didn’t pay your electricity bill your power would get cut and the site is slowly “dying” and fading away because of that.
For added theatrics, after they pay you can slowly fade the site back in over a few days too, as if websites need bill money the same way humans need food, and it is slowly getting better after “being starved”
You don’t say that, you say they are on credit hold and you won’t do any more work until your past work is paid for, after they pay you say credit has been rescinded and they have to prepay for any more work to be done.
Edit: also, these alternative syntaxes tend to make some easy cases easy, but they have no idea what to do with more complicated cases. Try making nested capture groups with these, for instance. It gets messy fast.
it doesn’t unravel the underlying complexity of what it does… these alternative syntaxes tend to make some easy cases easy, but they have no idea what to do with more complicated cases
This can be said of any higher-level language, or API. There is always a cost to abstraction. Binary -> Assembly -> C -> Python. As you go up that chain, many things get easier, but some things become impossible. You always have the option to drop down, though, and these regex tools are no different. Software development, sysops, devops, etc are full of compromises like this.
Exactly, at the end of the day it’s about using the right tool for the job. Code that’s clear and declarative is easier to maintain, so it makes sense to default to it, but nothing stops you from using low level constructs if you really need to.
You automate that shit, you never give them direct access to the source code, and you obfuscate the code that changes the opacity so that it’s really hard to find even if they manage to wrest control away from you. I did this once after the client failed to pay as agreed. They narrowly escaped their site being replaced with a message saying they did not pay their bill, by paying eventually, but I couldn’t let them get away with that shit if they decided to change passwords and tried to screw me completely.
Loved that video back when I was contracting. I paid a lawyer to draft up a standard contract and that was the best thing I ever did. Great value for the $$s. Saved my butt a couple of times.
programmerhumor
Oldest
This magazine is from a federated server and may be incomplete. Browse more on the original instance.