this post was submitted on 28 Oct 2024
504 points (98.3% liked)

Programming Humor

2681 readers
28 users here now

Related Communities [email protected] [email protected] [email protected] [email protected]

Other Programming Communities [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 2 points 3 weeks ago (1 children)

Make the input variables nullable, then add checks if the values are null, then assign default values if they are, otherwise continue with the passed values.

[โ€“] Acters 2 points 3 weeks ago

Good idea but not feasible as that could introduce unknowns. Unfortunately making defaults when null is counterproductive as we are looking to increase LOC without introducing odd behavior and having no changes to how the overall function works. The only objective is to increase LOC.