Jump to content
The mkiv Supra Owners Club

These are the sort of programmers I have to deal with


Nodalmighty

Recommended Posts

These are the sort of programmers I have to deal with: :(

 

/**************************************************************************************************************

* DATA - for percentage control on the base game *

**************************************************************************************************************/

enum PercentagePayouts

{

PERCENT_72,

PERCENT_74,

PERCENT_76,

PERCENT_78,

PERCENT_80,

PERCENT_82,

PERCENT_84,

PERCENT_86,

PERCENT_88,

PERCENT_90,

PERCENT_92,

PERCENT_94,

PERCENT_96,

PERCENT_98,

NUM_PERCENTAGE_PAYOUTS,

};

 

GeSInt32 GetOffsetFromPercentage( void )

{

GeSInt32 nPerc = (GeSInt32)GetCabInterface()->PercentagePayout();

 

//NOTE THE VALUES IN THIS TABLE ARE 2% HIGHER THAN THEY SHOULD BE!

if( nPerc

{

return( PERCENT_72 );

}

else if( nPerc

{

return( PERCENT_74 );

}

else if( nPerc

{

return( PERCENT_76 );

}

else if( nPerc

{

return( PERCENT_78 );

}

else if( nPerc

{

return( PERCENT_80 );

}

else if( nPerc

{

return( PERCENT_82 );

}

else if( nPerc

{

return( PERCENT_84 );

}

else if( nPerc

{

return( PERCENT_86 );

}

else if( nPerc

{

return( PERCENT_88 );

}

else if( nPerc

{

return( PERCENT_90 );

}

else if( nPerc

{

return( PERCENT_92 );

}

else if( nPerc

{

return( PERCENT_94 );

}

else if( nPerc

{

return( PERCENT_96 );

}

else

{

return( PERCENT_98 );

}

};

 

I just replaced all that crap with:

 

#define MIN_PAYOUT 72

 

// Get percentage payout from cab shell (72%-98% in steps of 2%) as Float (i.e 72.0f). Convert to relative index (0-13)

 

GeSInt32 GetOffsetFromPercentage( void )

{

return ( ( ((GeSInt32)GetCabInterface()->PercentagePayout()) - MIN_PAYOUT_72) >> 1);

};

 

And I know he's on a lot more money than me :wtf:

Link to comment
Share on other sites

If he's on more money than you and doesn't really know how to program.... who would you class as the more intelligent one? :D

 

Hehe, sucks though, but that sadly is the same with most companies, the real workers sit lower down and get shafted money wise. The further up the tree you go, the worse they are at their job usually.

Link to comment
Share on other sites

If he's on more money than you and doesn't really know how to program.... who would you class as the more intelligent one? :D

 

Hehe, sucks though, but that sadly is the same with most companies, the real workers sit lower down and get shafted money wise. The further up the tree you go, the worse they are at their job usually.

 

 

 

Agree'd

 

I had a guy at work that didnt understand the key enter....

 

I'v also asked people to go into "internet explorer" and type something in the address bar of which they come back and ask what the address bar is..

 

While i'm on with it the other day a woman said outlook had gone off her machine. It was literally the first thing in the start menu. just because it wasnt on her desktop she thought it had gone...

 

Rant over :D

 

*back on topic*

 

Anyone in support knows that the people above them in the company are less likely to know what they are doing.

Link to comment
Share on other sites

Maybe he's paid per character?

 

Retard woman at work yesterday came out with the line "These batteries feel heavy - does that mean they're fully charged now?"

 

The world is full of soft-skulled morons, luckily I can ignore most of them.

 

:blink: wow.

 

My favourite IT call when I used to do proper work was someone called me cos their computer wouldn't boot. I went to the shopfloor saw the 3 bars on the screen saying no signal, looked at the cables dangling from the monitor going nowhere and just laughed at him. The PC had been removed the previous day by my IT colleague as it had a problem. I never did find out exactly how he was trying to switch it on...

Link to comment
Share on other sites

Only points I'd have is that:

 

a) your version operates differently in the case where PercentagePayout >= 98 or

 

b) your version relies on an assumption about the underlying implementation of a non-typed enum (ie. ints starting at 0). Might make the code confusing to maintain for the next person to look at it (using a bitshift is extremely geeky, btw! ;) )

 

Whilst I started out as a C programmer, loving concise code, I have grown to appreciate the impact of it and the benefits of a more easily understood, albeit more verbose coding style.

Link to comment
Share on other sites

Is your code supposed to do what his was doing, but more elegant? To me I can't see what either of you were trying to achieve? What's with the bit shift?

 

Hell on 2nd visit his actually looks more sense than yours?

 

I can see he is basically turning a percent payout into an enum. Take a value of 5 (PercentagePayout) his would return 0, yours is doing what (5 - 72) >> 1? I totally don't get what you are trying to achieve with that, bit shifting a negative number?

Link to comment
Share on other sites

I think you missed a couple of comma's!

 

I don't know how you programmers do it, while I was in Deloitte we use to have a number of programmers sitting near us. They used to be in all day & night almost, I am sure I have never see some of them leave the building. They use to wear slippers in the office as well :blink:

Link to comment
Share on other sites

Is your code supposed to do what his was doing, but more elegant? To me I can't see what either of you were trying to achieve? What's with the bit shift?

 

Hell on 2nd visit his actually looks more sense than yours?

 

I can see he is basically turning a percent payout into an enum. Take a value of 5 (PercentagePayout) his would return 0, yours is doing what (5 - 72) >> 1? I totally don't get what you are trying to achieve with that, bit shifting a negative number?

 

The code looks like it's trying to turn an int (the percentage payout - I'm guessing intended to be between 72 and 98) into an enum.

 

Becuase the enum is non-typed, the underlying implementation actually generates ints starting at 0 to represent the enumeration. The rewrite is taking advantage of this fact by implementing the conversion as a mathematical algorithm:

 

(PercentagePoint - 72) divided by two, rounded down.

 

(use of the bitshift is a fast way of doing divide by two, round down).

 

To me - the bitwise shift is non-obvious, the ab(use) of the fact that the enum is actually an int is risky, and the edge/error cases (PercentagePoint98) are now handled differently, but the new implementation will be a lot quicker.

It's a decision for absolute performance vs. defensive coding and maintainability, IMO

Link to comment
Share on other sites

If we assume the input is between 72 & 98 yes it would work, but we can't assume that is the case. I know what a bit shift achives, and that is a terrible use of it, hell dviving by 2 and casting to an int would have been far more intiutive, what if they change the payout bands?

 

It's a decision for absolute performance vs. defensive coding and maintainability, IMO

Those are the sort of tricks you play in hardcore routines that are being executed millions of times a second, I can't see this "working out of a payout" being that type of call. IMHO defensive coding & maintainability win in this scenario for me,

Link to comment
Share on other sites

Due to a W7 DVD failure (it had massive scratch marks etc) I was told today by the nice professional lady who supplied the disc to format my DVD drive :confused:

 

Mother-in-law had a problem with her PC when I started going with Charlene. Didn't want to overstep my mark as I didn't know them that well so I left her to the "help line". After a while and a lot of confusion I decided to step in and take over the phonecall. The girl on the other end of the line was offering to send out a recovery disc. I asked if she meant a windows installation, she said "nooooooo, the floppy diskette to recover windows". I remarked that it was used for a hidden partition which this particular PC didn't have. She said that it wasn't and that it had windows and all the other programs on it. I asked "on a 1.44mb floppy disk?" she said "yes".

 

Hung up there and then, reformatted the PC with my "copy" and all was well till the motherboard blew up. Typical packardbell.

 

Worst of it is she was on the phone for over an hour, and it was £1 per minute.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. You might also be interested in our Guidelines, Privacy Policy and Terms of Use.