Having trouble understanding patterns
Hello, I`m a second year student and I'm reading about patterns like a factory pattern. I have trouble understanding why I should use patterns and when to use which pattern.
Example ex = new ExampleBuilder().SetFieldA(1).SetFieldB(2).Build(); type of architecture. Which is bad design cuz we have Example ex = new Example { A = 1, B = 2 } syntax. The true purpose of the Factory pattern is to alleviate downstream changes, in which if you change something it should be ABI compliant unless its a function sig change.
Example ex = new ExampleBuilder().SetFieldA(1).SetFieldB(2).Build();Example ex = new Example { A = 1, B = 2 }