Is your Code Clean?
by manxmanToday I was working on some code that I have been asked to enhance. I came across the following bit of code.
if a = b then
do something that does NOT affect a or b
do something else that does NOT affect a or b
if a = b then
do a lot of stuff
endif
endif
Why are there 2 identical if statements, with no code inbetween that affects the comparison test?
This reminds me of the article I wrote, called Working with Other Developers. Please spend at least a little bit of time on the “look-and-feel” of your VBA code. It makes it much easier for someone else (maybe even you) to read and understand your logic.
p.s. another problem with the system I am working on is that it has a lot of orphaned code. That is, code that is no longer attached to an object, and will never run. Some of this code causes the Access compiler to choke and sputter, and I depend on the compiler to help me find errors. Hence, I had to spend time getting rid of the orphaned stuff.