|
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
|
|
|
|
|
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....
|
|
|
|
|
|
But can it generate itself?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
It had been awhile since I pulled up the code, but sure enough when I did, I found a Deslanged.Export.cs file in the Deslang project. Such files are created by Deslang itself. So I did use it to build itself.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Cool stuff honey. The idea of code writing code is one of the first mind blowers that made me want to write code.
Because you guys will like this if you haven't seen it, even though it's likely I found it from here somehow.
This is in the same "codeception" vein.
This image displays the CRC value of the file which contains it.
[^]
|
|
|
|
|
|
The extra Cs evoke the yack/vomit homophone for me.
Never happened with yak/yac/antlr/JavaCC/etc
|
|
|
|
|
|
I thought The Who did My Generation
|
|
|
|