|
Right, as far as I can tell [\p{name}] == [:name:] . But do they perform the same? They should.
|
|
|
|
|
I'll find out when I get a chance. Just based on the way I parse this stuff I'm assuming it will be the same.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
In the days of 7/8 bit chars, those class tests were often implemented in bitmaps (e.g. 8 classes in an array of 256 bytes)
A similar trick in, say, UTF-16 wouldn't be outrageous these days.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Are you using the source generators[^]? That should let you dig into the actual regex code to see the difference.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
OK. That's actually pretty cool.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
in the same header file, 5 lines apart.
<h1>define szSTATUS_DONE "D"</h1>
<h1>define cSTATUS_DONE 'D'</h1>
they represent the same status (and values)
(yeah, we use type prefix !! )
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
I use my prescient powers to see that you are going through someone else's code base.
Mircea
|
|
|
|
|
yeah!
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
Trust me, it's much worse when you go through your own's and go: "What was I thinking!"
Mircea
|
|
|
|
|
thanks for your information
|
|
|
|
|
Things get complicated when we are not able to understand them clearly. The other possible reason can be Overthinking, which exaggerates a simple situation and makes it appear worse. A person ends up imagining certain situations which in reality won't happen.
|
|
|
|
|
Well, sometimes you are comparing strings and other times you are comparing characters.
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
I’m begging you for the benefit of everyone, don’t be STUPID.
|
|
|
|
|
if only ...
both defines are used at max a dozen of times in places where performance is not required.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
szSTATUS_DONE [0]?
Paul Sanders.
If I had more time, I would have written a shorter letter - Blaise Pascal.
Some of my best work is in the undo buffer.
|
|
|
|
|
Job security? Or maybe someone was paid by lines of code?
The ‘why’ is almost always inscrutable, but likely the coder slept between sessions.
Cleaning someone else’s code is both satisfying and nerve wracking.
Good luck.
Time is the differentiation of eternity devised by man to measure the passage of human events.
- Manly P. Hall
Mark
Just another cog in the wheel
|
|
|
|
|
The compiler told someone that string -> char was a type mismatch upon comparison so they added the other def and used that one.
They did this for type mismatches for other values/variables too, sticking to their pattern.
At least, that's my forensic analysis of the crime of a previous coder.
A long time ago they were me, so we're intimate acquaintances without their knowing and I feel like I can predict some transgressions because I once made them.
It's like catching your kids sneaking out, isn't it? Sleepover at Susie's! psssh...
|
|
|
|
|
Yep: Empathy and understanding can lead to a more serene life.
Time is the differentiation of eternity devised by man to measure the passage of human events.
- Manly P. Hall
Mark
Just another cog in the wheel
|
|
|
|
|
Yeah I don't intend to be ugly about it.
What else is everyone in the raft supposed to do when someone says they'll prioritize themselves ahead as much as they want to everyone else's detriment?
|
|
|
|
|
jochance wrote: What else is everyone in the raft supposed to do when someone says they'll prioritize themselves ahead as much as they want to everyone else's detriment?
The rest of the survivors eat them first?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Two devs and a deadline? Looks like the results of a yet another successful death march. Code works, mission accomplished.
|
|
|
|
|
const char const *szSTATUS_DONE = "D";
const char cSTATUS_DONE = *szSTATUS_DONE;
This will make you feel better…
|
|
|
|
|
lol.
(heart attack)
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
I frequently define two representations of the same status, error or whatever, although usually an enum and a text string, rather than a char and a text string. From the old days, I like switch()-ing on scalars, not on strings or whatever. Besides, the switch variable is language independent, while the text string is language dependent.
The question is whether the two representations should be kept together, which may seem like a good idea for maintenance purposes. Then you must keep all the language variants of the string in the same place, and they must have different names. Or you separate them, which makes maintenance more difficult, but you can keep all the Norwegian strings together, the German strings together and so on. Maybe they are even referenced by the same name. Then, if you add another status/error/... code, you have to look up all the different places where strings are defined, to make sure that you have a string version in all supported languages.
Usually that is not a issue to consider in USA software: Who would ever want any other language than English?
|
|
|
|
|
All c++ header #define are a PITA
Why I should help the compiler to do it's job?
I love c++ but I hate it also for the above....
|
|
|
|
|
Maximilien wrote: they represent the same status (and values) They may represent the same status but they certainly don't represent the same values. One is a string while the other is a character.
/ravi
|
|
|
|