SE CORNER

EP39 - Coding Style สำคัญอย่างไร? - คำแนะนำจากหนังสือ Software Engineering at Google


Listen Later

EP นี้กลับมาอ่านหนังสือ Software Engineering at Google ต่อ ในบทที่ 8 "Style Guides and Rules" ที่พูดถึงเรื่องการกำหนดแนวทางการเขียนโค้ดในบริษัทกูเกิ้ล EP จะเป็นตอนที่ 1 ที่พูดถึงหลักการสำคัญ 5 ประการในการกำหนด coding styles and guides ซึ่งได้แก่

  1. Pull their weight - styles guide ควรมีแค่สิ่งที่สำคัญและจำเป็นจริงๆ
  2. Optimize for the reader - style guide ควรคำนึงถึงผู้อ่านมากกว่าผู้เขียนโค้ด
  3. Be consistent - style guide ควรทำให้โค้ดมีความสม่ำเสมอ ตรงกัน 
  4. Avoid error-prone and surprising constructs - style guide ควรทำให้นักพัฒนาหลีกเลี่ยงการใช้ code ที่ทำให้เกิดปัญหาหรือความเข้าใจผิดได้ง่าย
  5. Concede to practicalities when necessary - หากจำเป็นจริงๆ ก็สามารถแหกกฎบางส่วนได้ เช่น เพื่อ performance หรือเพื่อการรองรับแพลตฟอร์มที่หลากหลาย
  6. รายละเอียดจะเป็นอย่างไร ไปฟังกันใน EP นี้ครับ


    Google coding style guide: https://google.github.io/styleguide/

    ...more
    View all episodesView all episodes
    Download on the App Store

    SE CORNERBy Chaiyong Ragkhitwetsagul