▲ 624 ▼ know the features of your language (lemmy.world) submitted 2 years ago by jroid8@lemmy.world to c/programmerhumor@lemmy.ml 145 comments fedilink hide all child comments
[–] bort@feddit.de 36 points 2 years ago (2 children) He also insists on refactoring any block of code longer than two lines into its own function Thanks, uncle Bob. permalink fedilink source parent hideshow 2 child comments replies: [–] qevlarr@lemmy.world 18 points 2 years ago* His advice is great for newer programmers. They are taken literally by newer programmers, but the goal is not to force the dogma onto everyone. Maybe that should be more clear before the new people make a fool of themselves. They'll learn why or how to apply these rules once they get more experience. I know the episode you're referring to and the important part is to realize you can use functions names/signatures to convey and structure information about your code, not just as a way to reuse code. This is often misunderstood by newer programmers, self-taught programmers. Your code should be easy to understand so it's up to us to make it well structured. Functions aren't only to avoid duplicate code permalink fedilink source parent [–] PoolloverNathan@programming.dev 5 points 2 years ago Then refactor those two freshly-refactored lines into their own function as well for polymorphism, right? permalink fedilink source parent
[–] qevlarr@lemmy.world 18 points 2 years ago* His advice is great for newer programmers. They are taken literally by newer programmers, but the goal is not to force the dogma onto everyone. Maybe that should be more clear before the new people make a fool of themselves. They'll learn why or how to apply these rules once they get more experience. I know the episode you're referring to and the important part is to realize you can use functions names/signatures to convey and structure information about your code, not just as a way to reuse code. This is often misunderstood by newer programmers, self-taught programmers. Your code should be easy to understand so it's up to us to make it well structured. Functions aren't only to avoid duplicate code permalink fedilink source parent
[–] PoolloverNathan@programming.dev 5 points 2 years ago Then refactor those two freshly-refactored lines into their own function as well for polymorphism, right? permalink fedilink source parent