Refactoring the Code – Printing Selected Beams to Excel – Part 1 – (Tekla Open API)

Improve by refactoring.
Strive to improve the code. Just like this guy is trying to improve his swing. Looks like a fine golfer by the way. probably low single figure handicap, if not scratch.

We will attempt to do something which is seldom done or discussed in Tekla code samples: and that is the very important issue of refactoring code.

 

1. Start with Tests.

 

The first thing you need is a good suite of tests. That way you will know whether something has gone wrong or not. It might be tricky doing this since we are developing within the Tekla environment, but I do suppose it’s possible.

 

2. General Themes:

 

  • Change names to more appropriate titles.
  • Restructure the code to make it understandable.
  • Correct any obvious defects:

 

 


Comments

2 responses to “Refactoring the Code – Printing Selected Beams to Excel – Part 1 – (Tekla Open API)”

Leave a Reply

Your email address will not be published. Required fields are marked *