Home arrow Support arrow Gurock Software Forum arrow General Discussion arrow Promote LogAssert to function

Subscribe to forum RSS Forum

Promote LogAssert to function

New Topic Post Reply

Page: 1

Author Post
Member
Registered: Sep 2007
Posts: 19
Hi Guys,

I think that cold be usefull to have LogAssert as funtion and not as a procedure.
It should simply return value of condition

so i could write

if not SiMain.LogAssert(VarInstance <> nil,'ERROR: VarInsanceNil') then
Exit;


Regards
Ing Giuseppe 'Geppo' Monteleone
Administrator
Registered: Sep 2007
Posts: 134
Hello Giuseppe,

I'm not sure if mixing logging and application logic is optimal. For example, what should this function return if logging is disabled?
Member
Registered: Sep 2007
Posts: 19
Hi Tobias,

Ok you're right, sometime is better replicate code.... :-) a lot of books says about SRP (single responsability principle)...

logging is a thing, application logic is another thing..... but I didn't think about this
:-)

Regards
Ing Giuseppe 'Geppo' Monteleone.
Administrator
Registered: Sep 2007
Posts: 134
Same opinion here :)

New Topic Post Reply

Page: 1