GriffonSpade
Member
Looking to get a few clarifications/judgements on the Formal Style preferred by those in charge of maintaining the code.
First, is it truly necessary for everything to be tagged with 'this.', which is rather redundant due to the Casing Rules that are adhered to, as helpfully pointed out by @Jack? See here.
Second, is it always preferable to include the braces in single line checks?
ex:
Or is it fine to leave them out if all the checks have only one line like this?
Third, can essentially single code-line modules be shortened into a single line to increase readability?
ex:
Instead shortened to this: (Although, notably, I'd sort them)
Fourth, and I guess this mostly applies to non-mobiles, is it preferable to use straight boolean checks?ex:
if (!boolean)
if (boolean)
or should the value be checked?
if (boolean == false)
if (boolean == true)
Fifth, can the public : base be declared on the same line?
ex:
or should it be on separate lines?
ex:
Sixth, should I use tabs or spaces for indents? (please say tabs, lol)
First, is it truly necessary for everything to be tagged with 'this.', which is rather redundant due to the Casing Rules that are adhered to, as helpfully pointed out by @Jack? See here.
Second, is it always preferable to include the braces in single line checks?
ex:
Code:
if (x)
{
y;
}
else
{
z;
}
Code:
if (x)
y;
else
z;
Third, can essentially single code-line modules be shortened into a single line to increase readability?
ex:
Code:
public override OppositionGroup OppositionGroup
{
get
{
return OppositionGroup.FeyAndUndead;
}
}
public override bool Unprovokable
{
get
{
return true;
}
}
public override bool BleedImmune
{
get
{
return true;
}
}
public override Poison PoisonImmune
{
get
{
return Poison.Lethal;
}
}
public override int TreasureMapLevel
{
get
{
return 5;
}
}
public override int GetIdleSound()
{
return 0x19D;
}
public override int GetAngerSound()
{
return 0x175;
}
public override int GetDeathSound()
{
return 0x108;
}
public override int GetAttackSound()
{
return 0xE2;
}
public override int GetHurtSound()
{
return 0x28B;
}
Code:
public override OppositionGroup OppositionGroup { get { return OppositionGroup.FeyAndUndead; } }
public override bool Unprovokable { get { return true; } }
public override bool BleedImmune { get { return true; } }
public override Poison PoisonImmune { get { return Poison.Lethal; } }
public override int TreasureMapLevel { get { return 5; } }
public override int GetIdleSound() { return 0x19D; }
public override int GetAngerSound() { return 0x175; }
public override int GetDeathSound() { return 0x108; }
public override int GetAttackSound() { return 0xE2; }
public override int GetHurtSound() { return 0x28B; }
Fourth, and I guess this mostly applies to non-mobiles, is it preferable to use straight boolean checks?ex:
if (!boolean)
if (boolean)
or should the value be checked?
if (boolean == false)
if (boolean == true)
Fifth, can the public : base be declared on the same line?
ex:
Code:
public AncientLich() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
ex:
Code:
public AncientLich()
: base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
Last edited: