ถ้าคุณมีโปรเจกต์ coding บน Mac อย่าง app หรือ website คุณต้องมีโปรแกรมเขียนโค้ด เรียกว่า text editors Text editors ให้เขียนและรันโค้ดหลายภาษา อาจ simple หรือมี features เยอะอย่าง auto color coding และ formatting
ไม่ว่าคุณจะ coding ครั้งแรก หรือทำมาปีๆ มี Mac text editor ให้คุณ เรารวบรวม text editor apps โปรดด้านล่าง อ่านต่อเพื่อหาตัวที่ดีที่สุดสำหรับคุณ!
1. Vim
ถ้าอยาก text editor บน Mac ที่ powerful มากแตไม่มากเกินไป Vim คือคำตอบ เรียกว่า "Programmer's Editor" Vim จัดการโปรเจกต์และภาษาโปรแกรมมิ่งได้เกือบทุกอย่าง
แตเป็นโปรแกรมสำหรับ programmers Vim มี learning curve ค่อนข้างเยอะถ้าคุณใหม่กับ coding Vim auto color-codes syntax ทำให้โค้ดอ่านง่ายขึ้น แตไม่ suggest หรือชี้ bugs/typos ให้ ยังไม่มี GUI robust มากถ้าคุ้นเคย -- แต MacVim มี GUI มากกว่า Vim บน OS อื่น
อย่างน้อยมัน widely used ถ้ามีคำถาม น่าจะหาคำตอบจาก web search ได้ แตคุณต้องยอม put in the legwork และเรียนรู้โปรแกรม
ในความคิดของเรา ถ้าคุณเขียนโค้ดอยู่แล้ว Vim เป็น editor ยอดเยี่ยมทำงานโดยไม่มี frills ไม่จำเป็น สำหรับผู้เรียนอยู่ Vim จะยากกว่าจะเข้าใจทันที อาจชอบ text editor อื่นในลิสต์นี้ แต่ worth figuring out ถ้าอยากพยายาม!
Download: Vim for Mac (Free)
2. Emacs
พอพูดถึง Vim ควรพูดถึง great rival ใน text editor war คลาสสิก -- Emacs Emacs เหมือน Vim คือ Mac text editor สำหรับคนรู้โค้ด color-codes syntax แตไปกว่านั้น มันคือ tool ไม่ใช่ learning platform
เหมือน Vim, Emacs มี packaging system ให้ download และ install extensions ได้ Extensions อาจให้ syntax checker และ bug hunter แตต้อง download และ install แยก และมี extensions จำกัด
Emacs แยกตัวจาก Vim ด้วย functions อื่นๆ เช่น เป็น calendar, news reader, และมี project planning capabilities
Extra functions เหล่านี้อาจทำให้ Emacs ชนะ Vim เป็น text editor ที่คุณเลือก หรืออาจดู unnecessary ทำให้ Vim น่าสนใจกว่า ขึ้นกับคุณและว่าเอา text editor ให้ทำอะไรเพิ่มนอกจากเขียนและแก้ไข text และ code
Download: Emacs for Mac (Free)
3. Atom
สำหรับ Mac users ใหม่เรียน coding เรา highly recommend text editor Atom Atom มี GUI user-friendly มาก และ features ที่ช่วย first-time coders เยอะ
Autocomplete feature ช่วยจด syntax โค้ดที่ลืม และช่วยเขียนโค้ดเร็วขึ้น Atom ยังให้ find และ replace text ในโค้ดง่าย และทำงานใน multiple panes มี new user guide สำหรับ Atom ที่ follow ง่ายสำหรับ new coder และ documentation ก็ relatively easy to follow
Atom มี customization options ดี รวม extensions download จากใน app (แตกต่างจาก Vim และ Emacs ที่หาแยก) และ themes ทำให้ windows สนุกกว่า
Atom ดีสำหรับ new coders แต system ของมัน robust และ hackable เท่า Vim และ Emacs จึงเป็น text editor ที่ grow with you ได้ มี in-program GitHub access, editing, และ sharing ถ้า coding ร่วมกับคนอื่น Long-time coders ที่มี workflow แน่นอน อาจไม่ชอบ autocomplete แตถ้าอยาก powerful และ pretty editor ช่วยทางได้ คุณจะชอบ Atom
Download: Atom for Mac (Free)
4. Sublime Text
Text editor อีกตัวดีสำหรับ new coders บน Mac คือ Sublime Text เหมือน Atom ให้ autocomplete แต่เพิ่ม syntax definitions เผื่อต้อง lookup term หรือเตือนว่าโค้ดส่วนนั้นทำอะไร Definitions อาจโผล่ในหลายรูป -- quick definition ใน popup ข้าง term, หรือ click through ได้ full definition ใน side-by-side pane
Features นี้ amazing สำหรับ learning เพราะ check things ระหว่าง coding หรือ open code projects เรียนรู้ ยังมี features สำหรับ advanced coders เช่น easy view splitting และ tab switching, multiple selections สำหรับ quick variable changes
Atom มี appearance customization มากกว่านิดหน่อย แต Sublime Text ยังมี Dark และ Light themes และ work well กับ GPUs และ eGPUs มาก ถ้าคิดจะซื้อ eGPU ให้ Mac mini
Sublime Text อาจ beginner-friendly กว่า Atom แต definition และ autocomplete อาจเป็น annoying มากกว่า helpful ตอนเรียนรู้ แตถ้าอยาก navigate windows ด้วย keyboard ง่าย และชอบ look Sublime Text awesome
Download: Sublime Text for Mac (Free)
5. VS Code
Text editor ตัวสุดท้ายที่เรา highly recommend สำหรับ Mac คือ Visual Studio Code หรือ VS Code มี in-app debug options และ smart autocomplete system VS Code ไมแค่ช่วย new coders แตมุ่งเพิ่ม speed ของ advanced coders
มี Git (ควรติดตั้ง Git บน Mac ถ้า working on evolving code project) และ SCM providers อื่นๆ accessible สำหรับ review และ commits ภายใน VS Code นี่คือ editor ที่อยาก simplify workflow ให้มากที่สุด มี extensions เยอะสำหรับ VS Code ทำให้ efficient มากขึ้นกับโปรเจกต์ต่างๆ VS Code's built-in features ไม่รู้สึกในทาง ไป้รู้สึกว่า time savers
VS Code 感覺 novice-friendly น้อยกว่า Atom (ซึ่ง share source code มาก) และ Sublime Text แต grow into VS Code อาจช่วยคุณและ coding speed long term
ในความคิดเรา VS Code เป็น best middle ground ของ text editor เป็น tool และ instructor ทำให้เหมาะ intermediate coder: คนที่อยากขัดทักษะแตบางครั้งต้องการช่วย bug ถ้านั้นคุณคือคนนั้น ลอง VS Code ดู!
Download: VS Code for Mac (Free)
คุณจะเลือก Text Editor ไหน?
มี text editors รائعة เยอะสำหรับ Mac ทุกตัวให้เขียนและรันโค้ด และเขียน text และน่าประทับใจคือ ทุกตัวฟรี!
การตัดสินใจ text editor ที่อยากได้ ขึ้นอยู่กับ current coding skills และว่าเอา program ช่วย coding มากแค่ไหน ถ้าอยากกดดันตัวเอง ทำทุกอย่าง manual อยาก Vim หรือ Emacs ถ้าอยาก program guide อยาก Atom, Sublime Text, หรือ VS Code