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!
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>
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.
How is it gatekeeping to say “you used it wrong“? If you put your car in reverse when you want to drive forward and I correct you, am I gatekeeping driving?
Saying “this is incorrect” when there is a clear right/wrong usage is not gatekeeping
Because this repo is going viral from time to time to developers, I’m open for discussion if you want to promote a product/service in this README file. Just mail me at XXXX
You can use backreferences 1 2 etc. but you can also give them names explicitly.
it looks like this: (?<name>inner-regex)
Some flavors support it, kotlins doesn’t apparently.
Na let’s keep timezones, there useful for humans who generally want time to mean something, but lets ditch daylight savings time, all it does is make scheduling a massive pain twice a year, and messes up everyone’s sleep cycle. Without it, timezones would just be a fixed offset from another, minimizing trouble.
Ah yes the difference between “unset” and “intentionally set to null”, the bane of API devs who work in languages that don’t inherently distinguish between the two.
I feel this in my bones. As an OG dev, I had this incredible urge to smack people when I was working for my last job and I saw the API specs with everything being sent as strings through JSON. Boolean? Sure, let’s use a string. Integers? Sure we’ll do conversion in our code, that’ll be more efficient… So fucking infuriating. Oh and don’t get me started on JsonSchema T_T
JsonSchema is a way to validate some JSON. A great thing when you want to stop any sort of malformed data from coming in. Instead of wrecking your head in your code testing whether this bit here is not null, or is that string a valid boolean (I still remember that shitty piece of code they had, ugh!) or that bit is empty or that one is an actual number, or a string that can only have such and such value, well, you can formalise all this in one place, as a data file instead of code. Very convenient.
Except when it turns out you’re using a JSON library that’s not one, not two, but six major versions behind, and the security department won’t greenlight you using anything recent because… fuck you, that’s why. And to add insult to injury, we were the Quality department. Responsible for analysing the code quality of thousands of coders, around a hundred thousand programs (mostly COBOL but also C#), of a European banking group… The JSON schema was for adding a layer of non existant security to our API. But no, let’s keep accepting shitty malformed JSON (because of course we kept receiving shitty JSON; that’s why we wanted to implement this)
So I had to rewrite a lot of custom code to patch the bugs we found in the library, and none of the nifty tools that let you put in json and generate json schema would work for us. Heck, they even have JsonSchema to validate your JsonSchema but those wouldn’t work either, so far behind our version was.
programmerhumor
Hot
This magazine is from a federated server and may be incomplete. Browse more on the original instance.