Lets talk about Abstractions

Mathematics is the art of giving the same name to different things.

Mathematics and Abstract Language Concepts

Abstractions in a Programming Language

+(a::Int8,    b::Int8)    = add_int8(a, b)
+(a::Int16, b::Int16) = add_int16(a, b)
+(a::Float32, b::Float32) = add_float32(a, b)
function *(a::Integer, b::Integer)
sum = 0
for i in 1:a
sum += b
end
return sum
end
function intersect(a::Circle, b::Rectangle)
function intersect(a::Polygon, b::Circle)
function intersect(a::Polygon, b::Rectangle)
abstract type Shape
struct Rectangle <: Shape
struct Circle <: Shape
struct Polygon <: Shape
function foobar(a::Shape, b::Shape)
if intersect(a, b)
dostuff(a)
...
end
...
end

Abstractions in a Natural Language

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store