Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spreadsheet-Based Decision Support Systems

Similar presentations


Presentation on theme: "Spreadsheet-Based Decision Support Systems"— Presentation transcript:

1 Spreadsheet-Based Decision Support Systems
Chapter 24: Programming Principles Prof. Name Position (123) University Name

2 Overview 24.1 Programming Practices 24.2 Clarity 24.3 Efficiency
24.4 Summary

3 Programming Practices
We summarize here what we feel are some important issues when coding in VBA for spreadsheet-based DSS development. We categorize these issues as follows: coding with a consistent style; using naming standards; having clear comments; and increasing coding efficiency.

4 Clarity Consistent Style Naming Documentation

5 Consistent Style Use a consistent style for formatting, organizing, and commenting your code. Indenting not clear: If A is True Then ‘actions 1 ElseIf B is True Then ‘actions 2 End If Clearer indenting style:

6 Naming Use naming standards for variables and procedures.
“MinVal”, “SumProfit”, “MaxPrice” “FindMinCost”, “GetUserInfo” Naming standards also apply to control names and specific data types, such as Boolean. “IsDone”, “DoAnimation”

7 Documentation Make comments clear throughout the code.
Describe procedure functionality and loop and logical flow.

8 Efficiency Always look for ways to improve your coding efficiency.
Avoid redundancies and unnecessary code. Static structure: For i = 1 to 10 ‘do actions Next i Dynamic structure: For i = 1 to NumProducts

9 Efficiency (cont) Static structure: Dim CostArray(10) as Double
Dynamic structure: Dim CostArray() As Double, CostSize As Integer ReDim CostArray(CostSize) ‘paste in output table Range(“A1”).PasteSpecial Dim OutputTable As Range Set OutputTable = Range(“A1”) OutputTable.PasteSpecial

10 Summary The most important programming principles are writing with a consistent style, using naming standards, including clear comments, and improving code efficiency. It is important to have a clear, readable, and understandable code. Documentation is an important part of any programming project. We accomplish documentation by placing comments throughout our code. We should continuously be working to improve our code by reducing the complexity of the logic and the time required.

11 Additional Links (place links here) Projectile
Simple forms with basic Excel manipulation Birthday Simulation Simple simulation with statistical analysis Portfolio Management and Optimization Using the Solver


Download ppt "Spreadsheet-Based Decision Support Systems"

Similar presentations


Ads by Google