Issue: 13.4 (July/August 2015)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 11,498
Starting Page Number: 58
Article Number: 13407
Related Link(s): None
Excerpt of article text...
One trend I've noticed on the Xojo forums is that whenever someone posts an answer to someone's query on how to do something, others will chime in with their own suggestions of other methods to do the same thing. Sometimes things even get a little chippy, with people arguing the superiority of one technique over another.
This often confuses the newbie, who isn't sure what to do. Follow the original idea? Or perhaps the other ways are better? What to do?
What makes programming fascinating is that there are often dozens of ways to accomplish the exact same thing. From the end-users perspective, the results are identical. The only thing that's different is the way the program is structured internally. In other words, only the programmers know the difference.
That's why there really isn't a single answer to the question, "Which way is the best?" It's always, "It depends."
With experience, you learn to instinctively choose certain solutions, but the beginner doesn't have those instincts. Yet, there are aspects of such decision-making that can be taught. That's what we're going to explore today.
Programming choices can't always easily be boiled down into a pro/con list as there are too many factors to consider. Consequently, I've created some "rules" to help. These are more like guidelines or tips than hard-core rules (except for the first one). Use them to help you make the right decision when you're faced with a coding dilemma. Note that the rules are in order of most importance to least importance, in terms of their "weight" in helping you decide.
...End of Excerpt. Please purchase the magazine to read the full article.