/* 前言 -------------------------------------------------- */
這是 Jeremy 於 2026-03-07 於第二屆「 AI 取暖會」中分享過去十八個月來與 AI/Agent 搏鬥的實戰心得。
/* 前言 -------------------------------------------------- */
這是 Jeremy 於 2026-03-07 於第二屆「 AI 取暖會」中分享過去十八個月來與 AI/Agent 搏鬥的實戰心得。
| # 問題 | |
| 前輩您好,我是一年多前才轉職成為前端工程師的菜雞,轉職初期,使用ChatGPT一下子就解決了我google一兩個小時才搞懂的問題,漸漸的越來越頻繁使用ChatGPT寫程式,到後來的更聰明的claude 3.5 sonnet,最近的cursor IDE,每次使用都像飲鴆止渴,雖然處理問題的速度提升了,但是覺得自己被取代的畫面也越來越清晰了... | |
| 請問前輩,何以教我😭 | |
| # 首先澄清一點 | |
| AI 雖然會寫 code 但它還是很常犯錯。 | |
| 因此更需要真人俱備足夠能力去分辨哪些部份可直接用、哪些是錯的要修正才能用,更多時候是七分用它的但三分要視需求改寫,因此人類本身雄厚的程式功力還是非常必要的。 |
| import Foundation | |
| /// A class that keeps a weakly reference for `self` when implementing `onXXX` behaviors. | |
| /// Instead of remembering to keep `self` as weak in a stored closure: | |
| /// | |
| /// ```swift | |
| /// // MyClass.swift | |
| /// var onDone: (() -> Void)? | |
| /// func done() { | |
| /// onDone?() |
| // 必須實作的方法:每個 cell 要顯示的內容 | |
| func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { | |
| // 依據前面註冊設置的識別名稱 "Cell" 取得目前使用的 cell | |
| let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) as! MyCollectionViewCell | |
| // 第一個在陣列取0 | |
| guard indexPath.item != 0 else { | |
| cell.backgroundColor = .brown | |
| return cell | |
| } |