Slide 1

Slide 1 text

選擇適合你的技能組合 Pick up the best skill set for yourself

Slide 2

Slide 2 text

蒼時弦也 Software Developer https://blog.aotoki.me

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

歷史背景 語言特性 生態系 技能搭配

Slide 5

Slide 5 text

歷史背景 語言特性 生態系 技能搭配

Slide 6

Slide 6 text

歷史背景 語言特性 生態系 技能搭配

Slide 7

Slide 7 text

歷史背景 語言特性 生態系 技能搭配

Slide 8

Slide 8 text

資訊量過大 我們來看一些有趣的地方

Slide 9

Slide 9 text

網站與程式語言 把網路的進展與程式語言面世的時間對照

Slide 10

Slide 10 text

C 1972 1983 C++ Python 1991 1995 Java PHP Ruby JavaScript 200

Slide 11

Slide 11 text

C 1972 1983 C++ Python 1991 1995 Java PHP Ruby JavaScript 200 1990 年代,World Wide Web(全球資訊網)被提出

Slide 12

Slide 12 text

PHP Ruby JavaScript C# 2000 2009 Go Node.js Rust 2013 2000 年代,Web 2.0 被提出

Slide 13

Slide 13 text

PHP Ruby JavaScript C# 2000 2009 Go Node.js Rust 2013 2006 年代,Amazon Web Service 推出

Slide 14

Slide 14 text

Ruby、Python 初期沒有內建 HTTP 伺服器,直到 2010 年前後才 被加入到標準函式庫,然而 Go、Node.js 一開始就內建

Slide 15

Slide 15 text

開發框架的進展 除了語言之外,現今主流的框架在何時誕生

Slide 16

Slide 16 text

Spring 2002 2005 Rails Django .NET MVC 2007 2010 Angular Laravel 2011

Slide 17

Slide 17 text

Spring 2002 2005 Rails Django .NET MVC 2007 2010 Angular Laravel 2011 Web 2.0 後當代主流的網站開發框架才逐漸成形

Slide 18

Slide 18 text

2005 Rails Django .NET MVC 2007 2010 Angular Laravel 2011 2013 React Vue 2014 後端成型後的十年,前端框架也開始被提出

Slide 19

Slide 19 text

從時間的角度來看,不同時期推出的語言、框架剛好對應當時面對 的問題

Slide 20

Slide 20 text

型別 一個語言如何看待型別會影響使用

Slide 21

Slide 21 text

# Ruby def end (value) value inspect inspect [ ] inspect puts "string" "array"

Slide 22

Slide 22 text

// Golang // ... func switch := case string case string string (obj any) { v obj.(type) { : fmt. (v) [] : fmt. (v) } } ( ) ([] { }) Inspect Println Println Inspect Inspect "string" "array"

Slide 23

Slide 23 text

動態型別語言會自動分辨,在撰寫上通常會比較簡潔

Slide 24

Slide 24 text

# Ruby Person Struct :name :age Person name: age: 28 Person name: age: . ( , ) bob . ( , ) john . ( , ) = new = new = new "Bob" "John" "John"

Slide 25

Slide 25 text

// Golang // cannot use "John" (untyped string constant) as int value in struct literal type struct string int := := { Name Age } bob Person{Name: , Age: } john Person{Name: , Age: } Person "Bob" "John" "John" 28

Slide 26

Slide 26 text

動態型別的語言通常會需要額外確認資料是否正確

Slide 27

Slide 27 text

# Ruby def do new end & end (services) services .map |service| . { service.start } .each( ) run Thread :join

Slide 28

Slide 28 text

// Golang // select { ... } package type interface func ... := for := range go func {
 (ctx context.Context)
 } (services Service) { ctx context. () _, svc services { () { svc. (ctx) } } } daemon Service Run Start Background Start

Slide 29

Slide 29 text

// Golang // ... package type struct func * {} (s Server) (ctx context.Context) { } http Server Start

Slide 30

Slide 30 text

// C# namespace interface void class void Service foreach IService in { { () } { ( [] ) { ( services) { service. () } } } } Daemon IService Start Main Run services service Start

Slide 31

Slide 31 text

// C# // ... namespace class Daemon IService { : . { () { } } } Http Server Start

Slide 32

Slide 32 text

同樣是靜態型別,也會有所不同,在使用不同工具的思考方式就會 有所差異

Slide 33

Slide 33 text

不同語言描述事物的方式都不太一樣,我自己比較喜歡 Ruby 保留 很多彈性的方式,因為很彈性不同人寫出來的差異就會更大

Slide 34

Slide 34 text

物件 不同語言中對物件的看法都有點不同

Slide 35

Slide 35 text

# Ruby class < def new + + end end = new = new + ( , ) (other) (x other.x, y other.y) p1 . ( , ) p2 . ( , ) p1 p2 Point Struct.new + :x :y Point x: 1 y: 1 Point x: 2 y: 2 puts

Slide 36

Slide 36 text

# Elixir # ... defmodule do defstruct def + + end = = |> [ , ] (%{ x, y}, %{ x2, y2}), % { x x2, y y2 } p1 % { , } p2 % { , } . p1 . (p2) Point add Point Point Point IO inspect Point add :x :y x: y: x: y: do: x: y: x: 1 y: 1 x: 2 y: 2

Slide 37

Slide 37 text

typedef struct int int = = + = + return int = = = = = = = return { x; y; } Point; Point (Point , Point ) { Point p { .x p1.x p2.x, .y p1.y p2.y }; p; } () { Point p1 { .x , .y }; Point p2 { .x , .y }; Point p (p1, p2); ( , p.x, p.y); ; } add main add printf p1 p2 1 1 2 2 %d %d 0 "x = , y = "

Slide 38

Slide 38 text

Point(1, 1) Object Add(p1, p2) Method Point(3, 3) Object 物件是一組有意義的資料,類別(Class)則是定義哪些函示能對資 料發揮作用,稱為方法(Method) https://hackmd.io/@sysprog/c-oop#物件導向是一種態度

Slide 39

Slide 39 text

# Ruby # ... module def end end class include include end (other) Addable add Point Addable Printable

Slide 40

Slide 40 text

# Python # ... class def class pass : (self, other): ( , ): Addable add Point Addable Printable

Slide 41

Slide 41 text

// Go // 這是對的嗎? type interface type struct { (other Addable) Addable } { Addable } Addable Point Add

Slide 42

Slide 42 text

Mixin(混合)是部分語言才有的概念,這類語言通常會有 Duck Typing 的概念存在(可以呼叫特定方法即可)

Slide 43

Slide 43 text

// Go // Yes, But! type interface type struct := & { (other Addable) Addable } { Addable } p Point { Addable: Vec2{ , } } Addable Point Add 1 1

Slide 44

Slide 44 text

// C // Usage: p.addable->vec2 // 更像這個狀況 typedef struct union * * = = = = = * { { Vec2 vec2; Vec3 vec3; } addable; } Point; Vec2 vec2 { .x , .y }; Point p { .addable vec2 }; 1 1

Slide 45

Slide 45 text

不是將方法混合到物件中,而是作為一部分組合(Composite)到 物件裡面

Slide 46

Slide 46 text

框架 輔助開發的利器

Slide 47

Slide 47 text

Ruby on Rails Model View Controller

Slide 48

Slide 48 text

Laravel Model View Controller

Slide 49

Slide 49 text

Spring Framework Spring WebFlux Spring MVC ...

Slide 50

Slide 50 text

Golang net/http template/html database/sql

Slide 51

Slide 51 text

不同語言的框架解決方案並不相同,Golang 通常只使用 Router 為 主的框架,Rails 以 MVC 為主體,Spring 有非常完整的解決方案

Slide 52

Slide 52 text

Spring 有 VMWare 的支持,同時 Java 是許多企業採用的語言, 因此提供完整的解決方案能讓工程師專注在商業問題上

Slide 53

Slide 53 text

不同社群在維護功能的選擇上有不同差異,有的可能以少數意見領 袖為主,有些則是非常開放以社群意見為方向

Slide 54

Slide 54 text

Golang 主要設計給網路服務,在多核心、網路相關的支援完善,重 心不完全在 Web 上,框架的發展大多只針對不好處理的 Router

Slide 55

Slide 55 text

Vue React Angular 扣掉喜好這類外在因素,我們會怎麼選擇?

Slide 56

Slide 56 text

Vue React Angular 產品原型、個人專案、功能明確的產品

Slide 57

Slide 57 text

Vue React Angular 跨團隊協作維護、功能複雜的產品

Slide 58

Slide 58 text

Vue React Angular 大型企業使用系統、多租戶服務

Slide 59

Slide 59 text

單純從框架規範、開發方式來看,越強大完善的框架限制也越多, 也就越適合多人協力(規範明確不容易出錯)

Slide 60

Slide 60 text

解決方案 生態系決定選擇

Slide 61

Slide 61 text

如果我們想處理 AI/ML 的題目,想到什麼語言?

Slide 62

Slide 62 text

Python Python 有許多適合處理資料的套件,而且非常完整容易使用

Slide 63

Slide 63 text

如果想快速製作產品原型,會想到什麼語言?

Slide 64

Slide 64 text

Ruby PHP Ruby on Rails 和 Laravel 兩個框架在在初始化後即可馬上可用,語法彈性更容易驗證想法

Slide 65

Slide 65 text

如果想做網路服務,會想到什麼語言?

Slide 66

Slide 66 text

Golang Golang 天生對網路服務的相容性就非常好,因此被大多微服務基礎建設專案選用

Slide 67

Slide 67 text

如果想做安全、系統底層的應用,會想到什麼語言?

Slide 68

Slide 68 text

Rust Rust 對記憶體的使用非常嚴謹,並且大量利用編譯器檢查來改善軟體的品質

Slide 69

Slide 69 text

如果想做遊戲,會想到什麼語言?

Slide 70

Slide 70 text

C# C++ Unity 讓遊戲開發的門檻極大降低,目前兩大主流引擎分別使用 C# 和 C++

Slide 71

Slide 71 text

工具選擇 如果要學習一個語言,該怎麼選?

Slide 72

Slide 72 text

從個性來看,喜歡彈性還是有規則跟標準?

Slide 73

Slide 73 text

Ruby JavaScript 雖然不排斥繁複的定義,但是因為自己很多想法想驗證,有彈性的語言更適合

Slide 74

Slide 74 text

從喜好來看,想做遊戲相關聯的軟體

Slide 75

Slide 75 text

Ruby C# JavaScript 這幾個語言都有遊戲開發相關的解決方案可以用

Slide 76

Slide 76 text

從環境來看,當下的趨勢與機會是什麼

Slide 77

Slide 77 text

Ruby JavaScript 自己在程式領域進步最快的 2013 年那個時期,Ruby on Rails 是最有潛力的工具與職業

Slide 78

Slide 78 text

綜合各種條件,大致上就能找到適合的語言

Slide 79

Slide 79 text

Ruby TypeScript 從 PHP 開始學習,到 Ruby & TypeScript 能用十年以上有很多條件

Slide 80

Slide 80 text

然而,現代人的人生長到足以學習大多數程式語言

Slide 81

Slide 81 text

Golang Python 考量到職涯發展,我在工作中使用截然不同的語言跟環境來「解決問題」

Slide 82

Slide 82 text

C C# 遊戲開發跟研究技術是我的興趣,我也會不時使用他們

Slide 83

Slide 83 text

Elixir Rust 嘗試不同的語言跟思考方式,也是作為工程師有趣的一環

Slide 84

Slide 84 text

比起語言跟框架,清楚自己「想做什麼」以及「如何做好」更重要

Slide 85

Slide 85 text

END 工商一下網誌的連載內容

Slide 86

Slide 86 text

2023 Later - Rails 開發實踐 2024 Early - Cucumber 的文件測試法 2024 Later - Rails 架構設計(規劃中) https://blog.aotoki.me