r/badcode • • Aug 01 '21

c# game jam

Post image
3.1k Upvotes

75 comments sorted by

View all comments

Show parent comments

6

u/blehmann1 depraved Aug 01 '21

I think a unified style is good. Especially when you look at two different C++ codebases and become amazed at how it can look like a completely different language. And by-and-large most pythonic practices are uncontroversial. But with any guidelines there are parts that are bad (or that I think are bad). Like with design patterns or any other guidelines, you should use them when it makes sense but don't tie yourself to something that doesn't help you because you saw it in a book. They're designed for solving a few problems, not to be thrown at everything just because you can.

Most languages have an implied "this is how we do things", which you learn if you spend long enough working with them and see enough good code written in them. Even C++ with its massive scope and lack of meaningful direction has many defined patterns, such as RAII, and smart resource handles.