Programming - Higgins Flashcards
Iteration
Repeating an action / Repetition
Addition
+
Subtraction
-
Multiplication
*
Division
/
Linear Search
Linear search is the simplest ‘searching’
It starts at the first element in the list and check each single one until its found (e.g i ask someone for a number between 1-100 and they came up with 53/ linear search would go with “1,2,3,4,5,6…”)
Subroutines
Decomposing a complex programming tasks in ,much simpler steps
Easier to spot errors
Allows to decompose the problem
Bubble Sort
+Simple algorithm that can easily be implemented.
+Efficient way to check if a list is already in order.
+Doesn’t use much memory
-Inefficient way to sort a list. Worst case scenario would involve (n(n-1))/2
-Slow for very large list of items.
Global Variable
Variables that are created outside of a function, which means it can be used by everyone
Function
A function is a a command that can be repeatable
Maintain Code
It is crucial that programmers write code that is easy to read.
The code should have comments to explain why something was done a certain way or a difficult piece of logic.
It takes longer to correct a bug or make an update to code that is badly written
Readability can be considered as the ability of allowing code to be quickly, easily and clearly understood by someone new.
Features of clean code:
Easy to read
Meaningful names
Efficient code
Matplotlib
Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.
Matplotlib makes easy things easy and hard things possible.
Create publication quality plots. Make interactive figures that can zoom, pan, update.
Testing
To spot errors/bugs
Developers write unit tests for their code to make sure that the code works correctly. This helps to detect and protect against bugs in the future.
Unit Testing
Unit Testing is a level of software testing where individual units/ components of a software are tested.
The purpose is to validate that each unit of the software performs as designed.
Unit testing makes your code future-proof since you anticipate the cases where your code could potentially fail or produce a bug.
Product Testing
During the testing phrase, testing groups will employ several methods to ensure the product operates as expected.
The methods for product testing might vary depending on the type of producing you are building, but the concepts remain very similar.