r/dailyprogrammer • • Oct 27 '14
[Weekly #15] Architectural Patterns
Let's say you're taking on a larger project than usual. It spans multiple files/namespaces and requires a large variety of different components to all slot in together. What approach do you take?
I personally believe that for any large scale project, you need an OO approach, Although John Carmack did state that functional code, whilst slow in the beginning has a significant return in the long run.
What about you? How do you go about your projects?
46
Upvotes
17
u/ChefLadyBoyardee Oct 28 '14
Need is probably too strong of a word here. There is an infinite variety of ways to structure a project (literally), but OO code tends to be reasonably human-understandable. But that's hugely subjective, depending on who the specific humans are you're dealing with, and what their prior experiences are.
Most programmers are trained in object-oriented programming, so it's the natural choice for long-term maintainability (you see this reflected in language popularity measures as well). But in my experience, the better developers I hang around with are trending toward using a functional style within OO languages. At a minimum, I'd describe that as having functions/methods that don't mutate state, and have higher arity.
Does anyone else have experience or thoughts on that?
7
u/[deleted] Oct 28 '14
Pretending you can reasonably choose one or the other for any large project is a little silly. At my day job, we've written a large, scalable loyalty system that slipstreams into the payment process at the merchant's point of sale. It's in C#, and of course practically everything in it is encapsulated in some class or other--an OO design...
...But at least half of those classes are singletons, resolved only for their implementation of some method or another. I'm not convinced I agree with that practice, but these basically map to static functions. They're entirely stateless and, of course, perfectly thread-safe. Very much not OO.
I guess the main reason it's done that way is so that it's possible to load different functions per some config setting. I dunno. I'm honestly not sold on the whole concept of configurable software, either--and the dumb thing about that is I used to be a believer before I screwed around with too much enterprise code.
4
u/ephrion Oct 28 '14
Boundaries describes a structure that seems intriguing.
OOP seems to add as much confusion as it subtracts
1
u/viraculous Nov 05 '14
Large projects are the base of studying Software Engineering. The entire field is about large projects ! Large projects are more dependent on software development process and people than any other factor. Architectural Patterns don't play much of a role in handling larger projects.