- Joined
- Sep 14, 2009
- Messages
- 284
So I have been taking some programming lessons recently and learned of the concept "DRY" (do not repeat yourself). Which basically means avoid using the same function over and over again.
Example:
Does DRY not apply in JASS? Since I've seen many JASS coders don't use the concept of DRY. And which alternative is better?
Example:
JASS:
function Trigger_Actions_GetRandomInt takes integer lowBound, integer highBound returns integer
return GetRandomInt(lowBound, highBound)
endfunction
function Trigger_Actions takes nothing returns nothing
local integer intOne = Trigger_Actions_GetRandomInt(0, 5)
local integer intTwo = Trigger_Actions_GetRandomInt(0, 5)
local integer intThree = Trigger_Actions_GetRandomInt(0, 5)
endfunction
JASS:
function Trigger_Actions takes nothing returns nothing
local integer intOne = GetRandomInt(0, 5)
local integer intTwo = GetRandomInt(0, 5)
local integer intThree = GetRandomInt(0, 5)
endfunction
Does DRY not apply in JASS? Since I've seen many JASS coders don't use the concept of DRY. And which alternative is better?