Coder Social home page Coder Social logo

stock_analysis's Introduction

Stock Analysis

Overview

The purpose of this project is to analyize the performance of a set of stocks in the years 2017 and 2018 using a refractored code and compare it to the original code. We will be looking at the run times to determine if the refractored code is more efficient than the original one.

Results

The biggest difference between the original code and the refractored code was the num,ber of loops used. We used two loops in the original code, one of them being nested, shown below:

alt text

In the refractored code we only used one

alt text

This means that the execution time for the refractored code was faster than the original.

alt text alt text

Summary

Advantages and Disadvantages of Refactoring Code

One of the biggest advantages when refractoring code is how it look and how easy it is to read. Thsi is essential for debugging as it is easier to look through the code and find where some mistakes might be, as well as for others to look over it and understand what is going on. Another important advantage is that the code will run faster compared to the original code.

Some disadvanteges of refractoring code can come from not having a complete understanding on how to simplify the original code which can lead to errors in the code and the time spent thinking of different ways to simplify the code.

Pros and Cons of Refractoring Code

I would consider the difference in the way the code looks and how easily it is to read and understand one of the biggest pros. This was due to not having a nested loop which also lead to the runtime being faster.

The cons would be knowing how to simplify code in a way that looks cleaner, is faster to write and run.

stock_analysis's People

Contributors

dntalx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.