2: [軟體工程變啥魍] 柏拉圖式的程式思維 - podcast episode cover

2: [軟體工程變啥魍] 柏拉圖式的程式思維

Jan 12, 202142 minSeason 1Ep. 2
--:--
--:--
Download Metacast podcast app
Listen to this episode in Metacast mobile app
Don't just listen to podcasts. Learn from them with transcripts, summaries, and chapters for every episode. Skim, search, and bookmark insights. Learn more

Episode description

{ 完整節目筆記 https://kongcode.tw/episodes/2 }


本集聊了現代軟體工程師都常具備的基本思維與柏拉圖形上學理論之間的相似性。


寫程式在做啥

  • 解決問題,divide and conquer
  • Object Oriented Programming
  • 柏拉圖的形上學旨在探討人類思考與認知世界的基本方式,與 OOP 核心思想相似


柏拉圖與物件導向

  • The Form Of The Good,至高無上的形式,形成所有認知的體系,像太陽照亮萬物,先開啟了感官才有認知,才能歸納
  • 模版 -> Type (類型);實際的物體 -> Instance (實例)
  • 一個類型宣告與創建實例的範例


class Profile {

let name: String

let gender: Gender

let email: String

let age: Int?

}


let me = Profile(name: "Pofat", gender: .male, email: "pofat.koncode@gmail.com", age: nil)



// super class

class Car {

let wheelNumber = 4

private var engineStatus: EngineStatus = .standby


func start() {

engine = .on

}


func go() {

if case .on = engineStatus {

print("car goes")

} else {

print("nothing")

}

}

}


// subclass

class SportCar: Car {

func catchPeoplesEye() {

print("look me")

}

}


  • OO 三要素: 封裝 (Encapsulation),繼承(Inheritance),多型(Polymorphism)
  • 抽象的能力對工程師來說很重要


更多 kóng code

For the best experience, listen in Metacast app for iOS or Android