cody duncan
foxous.bsky.social
cody duncan
@foxous.bsky.social
Senior Software Engineer, Game Development, Rust, C++, Graphics, Send me Foxes!🦊
The principle I'll contribute:
"You Aren't Gonna Need It" (YAGNI)

Out of all coding principles, this has saved me the most time and headache.
en.m.wikipedia.org/wiki/You_are...
You aren't gonna need it - Wikipedia
en.m.wikipedia.org
December 3, 2024 at 9:34 AM
All these guidelines are trying to achieve the same goal:

"Optimize for change first"

What to do depends on what will make it easiest to change in the future. AHA is deferring that decision until you know what that change future looks like.
December 3, 2024 at 9:14 AM
The reason to function wrap at 3 copies over 2 is that doing so creates an abstraction, and abstractions have a cost. The *wrong* abstraction has a large cost.

A more nuanced guide to decide whether to WET or DRY is Avoid Hasty Abstractions (AHA)
See kentcdodds.com/blog/aha-pro...
AHA Programming 💡
The dangers of DRY, the web of WET, the awesomeness of AHA.
kentcdodds.com
December 3, 2024 at 9:06 AM
I'll second but extend DRY.

Like in kitchens, DRY is often the right choice. But it's terrible for soups or meats. It's rarer, but there are cases to prefer Write Everything Twice (WET).

The often cited rule is DRY at 3 copies of the code, WET for 2. See en.m.wikipedia.org/wiki/Rule_of...
Rule of three (computer programming) - Wikipedia
en.m.wikipedia.org
December 3, 2024 at 9:02 AM
So cute! I hope they finds eggs!!
December 1, 2024 at 5:17 PM
I was just looking for something like this, and I'm elated to learn it has 366 issues!

I moderate at r/GraphicsProgramming. I'm going to share this newsletter there every week if no-one else posts it first.
November 21, 2024 at 10:18 PM