Automatically translated.View original post

What's Bug? A nightmare that gives Dev a headache.

"The code is done..."The paranormal speech that always follows Bug! 🐞✨

If you ask what makes a programmer can't eat and can't sleep, the only answer is "Bug"! Today I will show you what it is and why it influences the life of a coder.

❓ Bug?

Bug (bug) is a "bug" in a computer program that causes the software to run incorrectly or to show distortion from its design.

Back in 1947, a real Bug was trapped in a giant computer machine in the old days until the system collapsed, and then the word Bug is used to call software errors to this day.

🧠 How much headache is it for Dev?

Bug's level of headache depends not on how "big" it is, but on how "rare" it is:

Bug type "Mountain Curb Hair": A single typo (Typo) or forget to put a sign; a single one, but how much you can't find, because the code is a thousand lines long.

Bug type "ghost" (Heisenbug): When we check it, it works normally, but when we send it to the customer immediately...Crash! (My machine is not!)

Bug, "Domino" type: When you finish solving one point, you push to appear the other three points in a confused way.

For the programmer, finding Bug is sometimes like a needle in the ocean, but the best shot is when you find it and solve it (feeling like winning a boss in a game!)

💡 Thoughts: No program in the world without Bug depends on whether we find it before the user finds it!

Which Dev has ever met the strangest Bug? Let's share the headaches at the comments! 👇

# Trending # Includes IT matters # IT should know # Share IT Trick # Technology

4/15 Edited to

... Read moreจากประสบการณ์ทำงานในวงการพัฒนาซอฟต์แวร์ ผมพบว่า Bug นั้นไม่ใช่แค่เพียงข้อผิดพลาดในโปรแกรมเท่านั้น แต่ยังเป็นบทเรียนสำคัญที่ช่วยให้เราเข้าใจระบบและโค้ดของเรามากขึ้น Bug บางชนิดที่ทีมงานหลายๆ ครั้งเจอ คือบั๊กที่เกิดจากความไม่เข้ากันระหว่างฟีเจอร์หรือโค้ดโมดูลต่างๆ ที่สร้างขึ้น แค่เปลี่ยนสักบรรทัดเดียวก็อาจส่งผลต่อระบบทั้งหมด นั่นทำให้การทดสอบและดีบัก (debug) กลายเป็นขั้นตอนสำคัญมากๆ ในงานพัฒนา สำหรับผม "Bug เส้นผมบังภูเขา" เป็นประสบการณ์ที่เจอบ่อยที่สุด การหาเครื่องหมายจุดคอมม่า (;) ที่ลืมใส่ หรือตัวแปรสะกดผิดเพียงตัวเดียวในโค้ดหลายร้อยบรรทัด อาจทำให้ระบบรวนจนต้องใช้เวลาค้นหานานมาก นอกจากความละเอียดแล้ว ผมว่าการรีวิวโค้ดกับเพื่อนร่วมทีมก็ช่วยลดบั๊กแบบนี้ได้มากเลยทีเดียว อีกหนึ่งประเภทที่น่าปวดหัวคือ "ผีหลอก" หรือ Heisenbug ที่ดูเหมือนโค้ดจะทำงานถูกต้องในสภาพแวดล้อมหนึ่ง แต่พอเปลี่ยนเครื่องหรือสภาพแวดล้อมอื่น เช่น การตั้งค่าเครื่องลูกค้า กลับพบปัญหาทันที ต้องอาศัยการเก็บ log และการจำลองสภาพแวดล้อมจริงเพื่อหาสาเหตุที่แท้จริง ผมยังชอบเปรียบ Bug กับเกมที่เราต้อง "ชนะบอส" ก่อนปล่อยงาน เมื่อหาบั๊กเจอและแก้ได้ ความรู้สึกตื่นเต้นและภูมิใจมันช่วยเพิ่มพลังใจในการทำงานต่อไปมาก สุดท้าย ผมอยากแนะนำว่าการเขียนโค้ดที่ดีและชัดเจน พร้อมทำ Unit Test และ Integration Test จะช่วยลดการเกิด Bug รวมทั้งทำให้การหา Bug ง่ายขึ้นมาก และสำคัญที่สุดคือ ต้องเรียนรู้ที่จะยอมรับว่าไม่มีโปรแกรมไหนไร้ Bug แต่เราต้องพร้อมและรวดเร็วที่จะตรวจพบและแก้ไขมันก่อนที่จะส่งผลกระทบต่อผู้ใช้งานจริง ถ้าใครมีเรื่องราวหรือเคยเจอบั๊กสุดแปลกหรือปวดหัว อย่าลืมมาแชร์ประสบการณ์กันนะครับ มันช่วยให้ทุกคนในวงการมีภูมิคุ้มกันและเทคนิคในการรับมือกับ Bug มากขึ้นจริงๆ