개발자 99% 커뮤니티에서 수다 떨어요!
오늘 TIL 3줄 요약
<예시>
Don't trust evev yourself. When you think "that could never happen", check it
if use resources, check to freed status when finish
Always take small, deliberate steps, checking for feedback and adjusting before proceeding.
</예시>
TIL (Today I Learned) 날짜
2022.03.24
오늘 읽은 범위
Chapter 4 Pragmatic Paranoia
책에서 기억하고 싶은 내용을 써보세요.
But Pragmatic Programmers take this a step further. They don’t trust themselves, either.
Topic 23. Design by Contract
- Remember, if your contract indicates that you’ll accept anything and promise the world in return, then you’ve got a lot of code to write!
Topic 24. Dead Programs Tell No Lies
- Pragmatic Programmers tell themselves that if there is an error, something very, very bad has happened.
- A dead program normally does a lot less damage than a cripple done.
Topic 25. Assertive Programming
- Whenever you find yourself thinking “but of course that could never happen,” add code to check it.
- Don’t use assertions in place of real error handling. Assertions check for things that should never happen
- Turning off assertions when you deliver a program to production is like crossing a high wire without a net because you once made it across in practice.
Topic 26. How to Balance Resources
- Finish What You Start
- Because Pragmatic Programmers trust no one, including ourselves, we feel that it is always a good idea to build code that actually checks that resources are indeed freed appropriately
Topic 27. Don't Outrun Your Headlights
- Always take small, deliberate steps, checking for feedback and adjusting before proceeding. Consider that the rate of feedback is your speed limit. You never take on a step or a task that’s “too big.”
- Avoid Fortune-Telling : Much of the time, tomorrow looks a lot like today. But don’t count on it.
오늘 읽은 소감은? 떠오르는 생각을 가볍게 적어보세요
When I was writing a test case, I sometimes think "Does this situation really happening?". After I read this chapter and the sentence "Pragmatic Programmers don't trust themselves," I thought I should be more assertive in writing a case.