Floats

I just got called during my vacation because someone didn't get the memo that if you have a flow of data like this:
A --double-> B --u64-> C --double-> D
A --double-> D
If D tries to compare the values it got from A and from C, there's basically zero chance they're going to be exactly the same. I think it's amazing how some mistakes keep getting made again and again.
Last edited on
Ouch.

Some really bad coding-fu skills there. The "someone", helios, not you.

Makes me feels not so bad about being self-taught. :Þ
its easy to scramble something like that, Ok, its forgivable and so on.
But the compiler draws you a map and warns you that you did something stupid there.
Then you test it, and it does not work, and it becomes a 'my furst program no work' level issue deserving of a dressing down.
Well, the thing is, A, B, C, and D are all separate systems in different technologies connected by various mechanisms. Two of those interfaces are JSON APIs.
IMO it's not forgivable to use double in a system that handles money. What's funny is that this is a design error on the client's systems, and they were checking the values from C to make sure we didn't muck them up. I told them they have two choices: either they remove that check, or they fix their code.
At least you caught it. Yea, double and money is more serious than just goobering up a few methods, esp if $ is involved.
> I just got called during my vacation
the nerve
Some people -- well, a person -- have problems with boundaries here. Next time I take a week off I might just keep my phone offline throughout. If people can't respect boundaries I'm okay with enforcing them. I always postpone my vacations to keep my projects from being late and in the end it doesn't get me anything.
That was one of the first problems our professor gave us in CS 101. I had already been coding for some time when I attended the class, so it was interesting to see how people unfamiliar with the problem tried to solve it.

To wit -- I never answer work calls on vacation. I must say it is delightful. :)

If you find yourself answering one and change your mind, just toggle the mute button rapidly and make like you're breaking up. lol
Last edited on
I always postpone my vacations to keep my projects from being late and in the end it doesn't get me anything.

That's when you say, "Sorry, I'm on vacation, a trip to Hawaii. I'd be glad to come see the issue, but you'd have to pay for some tickets and probably the rest of my trip while you're at it ;)"
The powers that be just think you're always available and take advantage. I don't take many holidays, but when I do it's for a couple of weeks at a time and during that period I NEVER reply to work emails or any telephone calls from work - no matter how urgent they may appear or how they try to entice me to answer. Nada.
In nine years I've been working here I don't remember a single other time I was called during a vacation. I don't know what this guy's problem is, but I'm starting to get sick of him (and I know at least two people left partly because of him) and I'm thinking I might have to have a chat with the boss about what the hell he's supposed to be doing. As it is right now I can never tell when he's overstepping his authority. I suspect the answer is "often".
was the situation an emergency that only you could deal with? If so, that could be the price of seniority and being good at what you do. If not, someone needs a stern talking to indeed...
Nah. It was something only I could figure out, but it was far from an emergency. It was just holding up the testing of one part of the application. But it was stupid, because there were still other parts left to test.
It was something only I could figure out

That is kinda sad commentary on your fellow coders.
The other guy is just not as experienced. Don't get me wrong, he does good work, but it would be unreasonable to expect him to do the same as me, when I joined the company to twiddle bits in intercepted function calls while he was still in high school.

But I do miss the days when I was the worst programmer here.
It was something only I could figure out,


Well IMO, the company has a problem. Hoping it doesn't happen, but what if you were killed by the proverbial bus whilst on holiday? What if you were struck down by a sudden heart attack or a stroke and required several weeks in intensive care? What would the company do then?
Actually we have a customer that I personally wrote the entire Windows version of their software for (save for the UI), and there's no longer one here who could do much with that code if they had to. Hah. You know you're in for a wild ride when you spot this on line 13:
1
2
3
4
5
6
7
8
9
10
const std::uint8_t thread_proxy[] = {
#ifndef _M_X64
    // x86 code
    0x8B, 0x44, 0x24, 0x04, // mov eax,[esp+4]
    0xFF, 0x20,             // jmp [eax]
#else
    // x86-64 code
    0xFF, 0x21,             // jmp [rcx]
#endif
};
I feel like bragging a little bit, so here's some of the fun things I did in that project:
* A reimplementation of LdrLoadDll() that allows injecting DLLs into protected Firefox and Chrome processes. (Shortly after starting, those processes hook LoadLibrary() to prevent DLLs being loaded.)
* A reimplementation of Windows' timezone logic, including loading the data from the registry and proper handling of DST. Thanks ReactOS.
* I think this little snippet says it all:
1
2
3
4
5
6
7
8
9
const std::uint8_t utgettime_patch1[] = { 0x90, 0x90, 0x90, 0x39, 0xC0 };
const std::uint8_t utgettime_patch2[] = { 0x90, 0x90, 0x90, 0x90, 0x39, 0xD2 };

const SqlDllVersion sql_dll_versions[] = {
    //SQL Server 2016
    { construct_version(2015, 130, 1601,  5), 141360, L"sqllang.dll", 63296 + 149, sizeof(utgettime_patch1), utgettime_patch1 },
    { construct_version(2015, 130, 1742,  0), 114864, L"sqllang.dll", 63456 + 149, sizeof(utgettime_patch1), utgettime_patch1 },
    { construct_version(2015, 130, 2149,  0), 125904, L"sqllang.dll", 63344 + 149, sizeof(utgettime_patch1), utgettime_patch1 },
    // (omitted 72 more entries) 
You guys have no idea what it took to get those numbers.


It's kind of unreasonable to expect everyone to be completely interchangeable. It's one thing if a project is poorly documented, or the knowledge about it is poorly distributed between the contributors (which admittedly is somewhat the case here; we know basically nothing about the client's systems, which is why this problem came up), but it's another if some people are just more knowledgeable, experienced, or skilled than others.
Topic archived. No new replies allowed.