10 astuces pour éviter les structures if/else ennuyeuses dans votre code

Codeur Senior May 25, 2023
Video Thumbnail

About

No channel description available.

Video Description

➜ 🎁 Découvrez le code Angular en Big Tech - 7 jours offert : https://skool.com/angular-senior-room Lorsque je me suis lancé en freelance, ma plus grande peur était de décevoir les équipes de développeurs qui suivaient mes enseignements. Pour vaincre cette véritable phobie, j'ai pris 2 ans pour lire tous les livres de code les plus connus sur Amazon. Ce qui m'a le plus marqué ? Un conseil étrange de l'auteur du best-seller Clean Code, Robert C. Martin... Qui conseillait d'utiliser le polymorphisme plutôt que la structure conditionnelle if/else... Bon visionnage, Simon. 00:00 : Introduction 02:24 : Remplacer if/else par un Algorithme de substitut 04:10 : Remplacer if/else par une Condition 04:58 : Remplacer if/else par une Guard Clause 06:33 : Remplacer if/else par un Filtre 07:39 : Remplacer if/else par un Opérateur de chaînage optionnel 08:40 : Remplacer if/else par le Constructeur de booléen 10:36 : Remplacer if/else par un Opérateur de coalescence nulle 12:28 : Remplacer if/else par une Extraction de variable 13:33 : Remplacer if/else par un Value Object 14:46 : Remplacer if/else par le Polymorphisme 15:31 : Remplacer if/else par un Mapping Object

Coding Essentials for Efficient Projects

AI-recommended products based on this video

Loading...
Mind Reader Monitor Stand, Height Adjustable, Ventilated Laptop Riser, Office, Metal, 36.8L x 23.5W x 14H cm, Black

Mind Reader Monitor Stand, Height Adjustable, Ventilated Laptop Riser, Office, Metal, 36.8L x 23.5W x 14H cm, Black

(95)
$46.30$46.13
FREE delivery Mon, Aug 11
Loading...
VIVO 81cm Desk Converter, K Series, Height Adjustable Sit to Stand Riser, Dual Monitor and Laptop Workstation with Wide Keyboard Tray, Black, DESK-V000K

VIVO 81cm Desk Converter, K Series, Height Adjustable Sit to Stand Riser, Dual Monitor and Laptop Workstation with Wide Keyboard Tray, Black, DESK-V000K

(13,797)
$139.99$103.20
FREE delivery Thu, Jun 26
200+ bought in past month
Loading...
MSI MAG MT201D - Premium Heavy Duty Dual Monitor Stand Arms, 17-45" Support, VESA Compatible, Adjustable Spring Mount, 44 lbs per Screen, Clamp & Grommet, Quick Release Plate - Black

MSI MAG MT201D - Premium Heavy Duty Dual Monitor Stand Arms, 17-45" Support, VESA Compatible, Adjustable Spring Mount, 44 lbs per Screen, Clamp & Grommet, Quick Release Plate - Black

(168)
$124.99
FREE delivery Wed, Jan 14
50+ bought in past month
Loading...
ZSCMALLS Portable Monitor, 15.6" FHD 1080P IPS Laptop Screen Extender with Adjustable Stand, USB-C HDMI Portable Screen, Portable Monitor for Laptop Mac PC Phone Xbox PS4/5 Switch

ZSCMALLS Portable Monitor, 15.6" FHD 1080P IPS Laptop Screen Extender with Adjustable Stand, USB-C HDMI Portable Screen, Portable Monitor for Laptop Mac PC Phone Xbox PS4/5 Switch

(748)
$105.59
FREE delivery Mon, Aug 11
100+ bought in past month
Loading...
MSI MAG MT201D - Premium Heavy Duty Dual Monitor Stand Arms, 17-45" Support, VESA Compatible, Adjustable Spring Mount, 44 lbs per Screen, Clamp & Grommet, Quick Release Plate - Black

MSI MAG MT201D - Premium Heavy Duty Dual Monitor Stand Arms, 17-45" Support, VESA Compatible, Adjustable Spring Mount, 44 lbs per Screen, Clamp & Grommet, Quick Release Plate - Black

(168)
$124.99
FREE delivery Wed, Jan 14
50+ bought in past month
Loading...
Lemorele Docking Station Dual Monitor, 6 in 1 USB C Hub Multiport Adapter w/2 HDMI 4K, 5Gbps USB3.0 & 2 USB2.0, 100W PD Charging - USB C Dock for Laptop Dell/HP/MacBook/Surface - Plug and Play
Best Seller

Lemorele Docking Station Dual Monitor, 6 in 1 USB C Hub Multiport Adapter w/2 HDMI 4K, 5Gbps USB3.0 & 2 USB2.0, 100W PD Charging - USB C Dock for Laptop Dell/HP/MacBook/Surface - Plug and Play

(1,822)
$27.19
Prime
1K+ bought in past month
Loading...
USB C Docking Station Dual Monitor for Dell Hp,15-in-1 Laptop Docking Station 3 Monitors USB C Hub with Dual 4K HDMI,8K DP,Button,PD Charging,Ethernet,6 USB A&C,SD/TF, Audio USB-C Multiport Adapter

USB C Docking Station Dual Monitor for Dell Hp,15-in-1 Laptop Docking Station 3 Monitors USB C Hub with Dual 4K HDMI,8K DP,Button,PD Charging,Ethernet,6 USB A&C,SD/TF, Audio USB-C Multiport Adapter

(1,359)
$67.98
FREE delivery Sun, Aug 24
100+ bought in past month
Loading...
InnoView Laptop Screen Extender 15.6" Dual Portable Monitors 1080P FHD Stacked Folding Triple Monitor HDMI USB-C Portable Dual Monitor for Laptop Windows Mac (No Driver Needed)

InnoView Laptop Screen Extender 15.6" Dual Portable Monitors 1080P FHD Stacked Folding Triple Monitor HDMI USB-C Portable Dual Monitor for Laptop Windows Mac (No Driver Needed)

(605)
$379.99
FREE delivery Mon, Aug 11