o Given the same input will always return the same output
o Must have a base criterion – a condition in which when met, closes the recursion and returns a resulto Must actively move toward the base criteriono Often a function will call itself carrying the latest value to the next call via method signature or parameters until the base criterion is met
Referential Transparency (Substitution Principle)
o States that you can replace a value in an expression without changing its behavioro Templating Syntax or Interpolation would fall under this category
Functions are First Class & Can Be Higher Order
This means that functions come first over other structure principles, for example in Java classes come first and methods / functions are encapsulated by classes.
Higher Order Function is defined as meeting one of the following- Takes in functions as arguments- Returns a function
Model View Controller (MVC)
o Model: Structures data in a reliable wayo View: Displays data in an easy to understand formato Controller: Takes in commands to the model for data updates and send instructions to the view to updateo Support modularity and reusability
o “named” program regions used to limit the scope of variable, functions, or classes within a programo Help avoid conflict with existing definitionso Help support encapsulation
o Translate Entire Programo Decreased analysis efficiencyo Increased execution efficiencyo Require more Space Complexityo C, C++, and Java use compilerso Umbrella term to describe when the code of one program is processes into another languageo Example: In C using gcc “compiles” C source code into machine language
o When a program is executed it is in a “runtime state”o In this state, the program communicates with the hardware and accomplishes tasks
o Mechanism for an interpreter to keep track of its place within a script that call multiple functionso FILO, stack implemented in a runtime environmento Data structure that records place of current executiono Similar to Heap but varies:- Stack data structure (linear)- Fast access- Only supports local variable- Limit on memory allocation- Immutable- Memory allocated contiguously
o Low-level programming languageo Indented to directly communicate with computer hardwareo Differs from machine language in that it is designed to be human readableo In general, assembly languages acts as a bridge between software and hardware
o Low-level programming languageo Indented to directly communicate with computer hardwareo Consists of binary and hexadecimal character
o Synchronous--Blocks next operation until current operation is completeo Asynchronous--Can execute another task before the current task is complete
Dynamic Scope§ Not very common: Mathematica, Lisp, LuaLexical / Static Scope§ Common to most programming languages§ Set the range of functionality of a variable to that it can only be referenced from within the block of code in which it is defined§ Scope can be broken into Built-in, Global, Enclosed, and Local§ Closure is when a block or function closes it attributes to only to modifiers that are within the block of code itself§ Pretty much every modern language uses Lexical Scoping
o Can be used in parity with a Call Stack in a runtime environmento Similar to a Call Stack but varies:- Heap data structure (hierarchical)- Slower access- Often supports global variables whereas a call stack only holds the local scope of the current executions- No limit on memory allocations- Mutable- Memory allocated randomly
Concurrency & Parallelism
o Concurrency is executing multiple tasks at the same time, but not simultaneously.- Two or more tasks work in overlapping time periods
Threading & Processes
o Threads -> sequence of code execution which are independent of one anothero Process -> the instance of a running program. A program can be multiprocessoro If you want to use more than more than one core in a CPU you will want to use multiprocessing- By default Java and C do this- Python has a Global Interpreter Lock (GIL) built in to prevent more than one thread from interpreting Python. This however can be overridden with Python’s built-in multiprocessing moduleo Single Threaded LanguageLimits runtime environment to 1 call stack and 1 memory heap
- Centralized — Old school UPS logistics but with computers
- Decentralized — Two or more centralized systems that can communicate
- Distributed — Web of systems, think current Amazon.com logistics
- A big part of how queries work on scaled data infrastructure that lives on distributed systems.
o Processing large data sets in a distributed fashion over several machineso Mapping dataset into a collection of <key, value> pairs, and then reducing over all pairs with the same keyo A map reduce is split into two scripts- A mapping script- A reduce scripto A map reduce execution utilize the divide and conquer methodology over a distributed computing structure.
Hadoop (Popular Data Platform)
Framework for Big Data§ Contains two modules- MapReduce- Hadoop Distributed File System (HDFS)Uses Sub-Projects§ Hive -- SQL like scripts to preform MapReduce Functions§ Sqoop -- Import Export data to and from HDFS and (Relational Database Management System) RDBMS§ Pig -- procedural language to develop scripts for MapReduce Operations
What is it that makes Hadoop so valuable for Big Data?
- A traditional database like MySQL has similar components to Hadoop. There is a query language, that query language directs the database architecture to find the data (I/O) and the metadata (Model) attached to it.
- Hadoop is special because it separates the metadata layer from the data (increasing the abstraction of the design) and utilizes AWS S3’s existing distributed computing structure.
Languages / Tools
Aim to replace C++ and Java by:§ Increasing compilation efficiency§ Increasing execution efficiency§ Increase / Support readability§ Increasing consistency§ Allow development in multiple languages§ Allowing easier maintenance of dependenciesSpecial Sauce:§ Multithreading & Concurrency· GoLang aims to keep pace with hardware changes that allow for more threading and concurrent efficiency§ Compilation Efficiency- Go is a compiled language like C/C++- It also does garbage collection and object removal like Java§ Unmatched Simplicity- No Templates- Single Executable – No Runtime Engine Needed- No Built in Libraries§ Built-in Testing Framework and Profiling§ Easy Learning Curve
o Mis of OOP and Functional Programmingo Can be used for Machine Learning to Web Apps
- Synchronous / Multithreaded / Semi-OOP
- Low-level, used everywhere:
Linux, Mac, Word, Everything, PHP, Perl, Video Games, BLoomber, MySQL, Microsoft OS
.NET / C# / F# / Visual Basic
- Video that explains it all: https://www.youtube.com/watch?v=bEfBfBQq7EE&t=624s
- Synchronous / Multithreaded / OOP
Use cases: Applets, Applications, Server Suites, Open Source, Apache, Mobile apps, etc.
- single-threaded, non-blocking, and concurrent
o Hypertext Preprocessoro Useful for web developmento WordPresso Lamp Stack (Linux, Apache, MySQL, PHP)o Laravel is a PHP framework (for Web Artisans!)
Hypertext Markup Language
Cascading Style Sheets
- Synchronous / Single-Threaded / Semi-OOP
Ruby On Rails
- MVC framework
- Used by Twitter
- Check out: https://www.netguru.com/blog/what-is-ruby-on-rails-used-for
XML / JSON
Same§ Self-Describing§ Hierarchical§ Can be used by a large amount of languages§ Can be fetched with an HttpRequestDifferent§ JSON doesn’t use tags§ JSON is shorter§ JSON is quicker to read and write§ JSON can use arrays
This story is a part of — My CS Notebook
Enjoy the read?
Leave a clap or comment
Share with friends or on your favorite social platform