I'm calling it grammatically correct code but I don't know what the actual term would be.
I dont claim to be a professional at dm by far even though Im pretty sure I could make anything I wanted in it, but let me bring an example over here.
This is the typical code:
mob
proc
Attack()
for(var/mob/A in get_step(src,src.dir))
if(!src.KO&&!A.KO&&!src.attack)
src.attack=1
var/Damage=(src.Str/A.End)*rand(1,15) //Does 1 to 15% damage if equal strength and endurance
var/Evasion=(A.Spd/src.Spd)*50 //A 50% evasion chance if equal speeds
if(!prob(Evasion)) //Successful hit
step_away(A,src) //They are moved back by the force of your blow.
A.dir=turn(A.dir,180) //They automatically face you again after recovering from the blow
if(prob(src.Skill)) //Does a warp beside them if you can score successive hits and have the skill
src.loc=get_step(A,turn(A.dir,pick(-90,90,180))) //put them to the left/right/back of the target
step_towards(src,A) //Shortest method I know to have them now face the target
A.Health-=Damage
if(A.Health<=0)
A.KO()
else
flick('Dodge.dmi',A) //If not a successful hit, a successful dodge by them
sleep(20/src.Spd)
src.attack=0
mob
var
Spd=1 //speed allows you to land or dodge hits easier and faster
Str=1 //strength inflicts damage
End=1 //endurance reduces damage
Health=100 //health always maxes at 100, as in 100%
KO //If your knocked out or not
And this is how I prefer that same code, I find it just as readable and better because its shorter yet does the same things functionally speaking:
mob/proc/Attack() for(var/mob/A in get_step(src,dir)) if(!KO&&!A.KO&&!attack)
attack=1
var/Damage=(Str/A.End)*rand(1,15)
var/Evasion=(A.Spd/Spd)*50
if(!prob(Evasion))
step_away(A,src)
A.dir=turn(A.dir,180)
if(prob(Skill))
loc=get_step(A,turn(A.dir,pick(-90,90,180)))
step_towards(src,A)
A.Health-=Damage
if(A.Health<=0) A.KO()
else flick('Dodge.dmi',A)
spawn(20/Spd) attack=0
mob/var
Spd=1
Str=1
End=1
Health=100
KO
/*And yea there are no "You attacked successfully" or "You dodged" messages, because a landed
hit has a graphical representation of the opponent being knocked backwards, and a dodge has
a graphical representation of dodging. The text spam gets on my nerves is why*/
I explained why I prefer the second example, anyone care to explain why they prefer one over the other?
And yes I realize these are two different extremes of the same code with no mention of some method inbetween the two.
First example: 28 lines.
Second example: 20 lines.
Thats like a 30% reduction in game code length. If you have a massive project, to me thats a lifesaver, a difference between 10000 lines or 13000 lines. But I value the shortness (while keeping the same functions) over all else, so thats me. I also think its interesting to see the contrast between the two, and if anyone can show me a way to shorten it further please do so I can look at its awesome shortness. But only if the entire block of code is all in view without having to scroll horizontally. My habit is that if Im about to go out of horizontal view, its line break time, no matter what. Also in my DM preferences I have my tab spacing set to 1 <_< default is 4. So to me they look just like spaces. I do want to stress that the first and second code do the exact same thing and use the exact same arguments.
~Ease~