Standard Abbreviations - clock_t?

Hey guys,

I want my code to be easily readable by all who needs to read it. Therefore, I want to stick with standard abbreviations through out my code. For example:

char chPlayerGender;
float fPlayerReflex;
class clPlayer {};
clPlayer *ptrPlayer;
int iPlayerStrangth;
string strPlayerName;

But What about a standard abbreviation for clock_t? is it just (t):

clock_t tPlayerRunSpeed;

Thank you in advance
Hello. You seem to have picked up a kind of bastardised Hungarian notation.

It's a standard, but it's not common or widely used. Many programmers will not find it helpful, not least because they don't use it. Far more useful is simply meaningfully named variables.
Last edited on
oh?

What would you recommend?
Just meaningful variable and class names, written into code that's clear and concise.
Simple enough, Thank you, I'll just go with 't'
If I saw a variable named tPlayerRunSpeed and I knew you liked to use "t" to mean an object of type clock_t, I'd be very confused. So this is a clock_t object, right, so it represents a time, but the name suggests it's a kind of speed? So which is it, a speed or a time?
closed account (E0p9LyTq)
Making Wrong Code Look Wrong
http://www.joelonsoftware.com/articles/Wrong.html

Hungarian notation on steroids: semantic types & suffixes
http://fplanque.net/Blog/devblog/2005/05/11/hungarian_notation_on_steroids
I was just picking things that sounded about right. I'm only recently learning to use clock_t. What it really is:

clock_t tPlayerAttackSpeed;// how fast you can hit. Smaller the number, faster your attack rate
tPlayerAttackSpeed = 750; // Player can attack every 3/4ths of a second.
Last edited on
What you're calling "speed" is the inverse of speed. In this case, commonly referred to as the "period".

clock_t tPlayerAttackDelay; // the period of time between player attacks. Smaller time means more frequent attacks
Last edited on
Topic archived. No new replies allowed.