Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
LLudivina authored Nov 28, 2022
1 parent 9feecb8 commit f5013d7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,23 @@ In module 2, we were introduced to Steve, a recent grad with a degree in finance
The purpose of this project is to refactor the VBA script for a stock dataset from 2018 and to measure this VBA script’s performance.

## Results
A macro was created in VBA to analyze stock data from 2017 and 2018.
The first macro created in VBA was used to analyze stock data from 2017 and 2018. Figure 1 shows the analyzed stock data for 2018.

Figure 1
![VBA_Challenge_2018](https://user-images.githubusercontent.com/115508896/204389460-faff08b8-9ea3-4e50-b4a8-d3d6912a7dcd.png)

![extra-2](https://user-images.githubusercontent.com/115508896/204389482-4b9e740e-069d-4579-8010-171571d0427f.png)
As seen in Figure 1, it took about 0.609375 seconds for the code to analyze the 2018 stock data. We were then provided with a starter code file that was used to refactor the original code. This was done by adding code where indicated by the numbered comments in the starter code file as seen in Figure 2.

Figure 2
![extra-2](https://user-images.githubusercontent.com/115508896/204389482-4b9e740e-069d-4579-8010-171571d0427f.png)

As an example, Figure 2, shows the comments in green with the filled in code right below it in blue and black colors. Once the code was refactored, the code was ran on the 2018 stock data again. Figure 3 shows the results.

Figure 3
![VBA_Challenge_2018-2](https://user-images.githubusercontent.com/115508896/204389513-c321c643-9e85-49e0-8439-476c4d2a7eae.png)

##Summary
As seen in Figure 3, it took around 0.0625 seconds for the restructured code to analyze the 2018 stock data.

The advantages of refactoring code
##Summary

The disadvantages of refactoring cod
Some of the advantages of refactoring code would be speed and legibility. When the code is refactored, some lines of codes can be removed if they are being repeated, and this can lead to a faster run time. This can also make the code more readable. However, refactoring can also have some disadvantages as it can be time consuming. It would be almost imposible to refactor code if there's a short deadline or the code is just too long.

0 comments on commit f5013d7

Please sign in to comment.