General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
p11
ThePrimeTime
comments
Comments by "p11" (@porky1118) on "Solid Programming - No Thanks" video.
24:00 A square, which inherits from rectangle is such a stupid idea. If I want a square I don't want to store width AND height. If I want my square to be a rectangle, I don't use different types at all, but instead use a rectangle directly. If I have a square and I do setHeight(1) and then setWidth(2), which is totally fine for a rectangle I get results I don't want, and probably want to get an error. If I want square and rectangle to be different types to be sure that squares will always be squares, I'd use an interface with getters for height and width, but still different internal representations.
1
1:00 I talked to somebody at an indie gamedev meeting, and he told me I should use established programming languages and SOLID ;)
1