I like the names cause i think it makes the overall main read alot easier. (I should prolly give an example huh?!)
(defun c:main ( / ThisIsTrue Then Otherwise)
;; //-- begin suport procedures --//
(defun ThisIsTrue ()
(eq (getvar "ctab") "Model") )
(defun Then ()
(alert "Good, your in Modelspace") )
(defun Otherwise ()
(setvar "ctab" "Model")
(alert "Sorry, you need to be in Model space to continue.") )
;; //-- end support procedures --//
(if (ThisIsTrue)
(Then)
(Otherwise))
(princ)
)
This is my application.
Now if at any time I need to alter the preformace of my "otherwise" in my conditional statment all I have to do is to alter the procedure and reload the app.
(defun c:main ( / ThisIsTrue Then Otherwise)
;; //-- begin suport procedures --//
(defun ThisIsTrue ()
(eq (getvar "ctab") "Model") )
(defun Then ()
(alert "Good, your in Modelspace") )
(defun Otherwise ()
(setvar "ctab" "Model")
;; (alert "Sorry, you need to be in Model space to continue.")
;; removed prompt; let the end user fig it out for him/her self.
)
;; //-- end support procedures --//
(if (ThisIsTrue)
(Then)
(Otherwise))
(princ)
)
Now if this procedure was built without the names, here is how it would look.
(defun c:main ( / )
(if
(eq (getvar "ctab") "Model")
(alert "Good, your in Modelspace")
(progn
(setvar "ctab" "Model")
(alert "Sorry, you need to be in Model space to continue.")
)
)
(princ)
)
Now if I wanted to remove the prompt I would have to search thru the code and try to follow where in the conditional I was. (Count the parens...follow the formating.)
I understand your point though, it dose look to be a bit wastefull but I will take the preformace loss--albeit minimal--from creating all those names for maintinece anyday.