News for hackers. Stuff that matters.
Re:Pointers Are More Abstract Than You Might Expect in C by sethrin on Monday July 02, 2018 @05:24PM (#17445439)
Say you decide to make a video game, and you decide to make a couple of classes for your game objects to inherit from. You make the classes Tool and Weapon. You have just prevented yourself from making the game Clue. The solutions to this tend to be ugly, and your object relations will tend to change over time, often in ways that are difficult to reconcile. Thus, GoF suggests to prefer composition instead of inheritance.
Re:Pointers Are More Abstract Than You Might Expect in C by TheArcane on Tuesday July 03, 2018 @04:15AM (#17448385)
GoF?
Re:Pointers Are More Abstract Than You Might Expect in C by Wildgoose on Tuesday July 03, 2018 @05:47AM (#17448828)
The "Gang of Four", the four authors who wrote the classic "Design Patterns" book, (subtitled "elements of re-usable object-oriented software").
Re:Pointers Are More Abstract Than You Might Expect in C by sethrin on Tuesday July 03, 2018 @08:36AM (#17449626)
As Wildgoose says, it's a frequently-used initialism for the Design Patterns book, which is otherwise somewhat awkward to refer to concisely and unambiguously.