Defensive and offensive programming

Опубликовано: 16 Январь 2022
на канале: Programming Duck
2,203
62

Defensive programming is a term that many programmers have heard of. It’s related to error handling and having correct programs. For some programs, defensive programming is essential. For others, it may be useful to use here and there. Along with that, there’s also offensive programming.

In this video, we’ll start by examining "normal programming". We’ll examine it first because some people mistake it for defensive programming. However, this is something that you should do regardless of whether you do defensive programming or not.

Then, we’ll examine defensive programming, followed by offensive programming.

Chapters:
0:00 Intro
0:38 Normal programming
2:58 Defensive programming
5:04 How to do defensive programming
5:54 Good development practices
6:44 Extra checks
11:00 Error recovery
15:39 Downsides of defensive programming
16:14 When to use defensive programming
17:12 Offensive programming
17:39 How to do offensive programming
18:09 Write code in a way that makes bugs obvious
19:39 Extra checks
21:50 Assertions
23:26 Downsides of offensive programming
24:28 When to use offensive programming
25:30 Be pragmatic
26:32 Outro

Video links:
Article version of this video: https://programmingduck.com/articles/...
Slides: https://docs.google.com/presentation/...

Channel links:
Programming Duck website: https://programmingduck.com
Facebook:   / programming-duck-100207231868555  
Instagram:   / programmingduck  

Resources used in video:
Music:
Music provided by HearWeGo (https://goo.gl/nDS3zR​)
Artist: MARION
Title: High Hopes
Listen on YouTube:    • MARION - High Hopes  ​

Intro screen: https://trendslogo.com/after-effects-...
Subscribe button template - https://trendslogo.com/youtube-subscr...
Outro screen: https://trendslogo.com/outro-template...

#programmingduck #programming #coding