What is difference between functional and imperative programming languages?

Most of the mainstream languages, including object-oriented programming (OOP) languages such as C#, Visual Basic, C++, and Java were designed to primarily support imperative (procedural) programming, whereas Haskell/gofer like languages are purely functional. Can anybody elaborate on what is the difference between these two ways of programming? I know it depends on user requirements to … Read more

Constructors vs Factory Methods [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago. Improve this question When modelling classes, what is the preferred way of initializing: Constructors, or Factory Methods And what … Read more

DDD – the rule that Entities can’t access Repositories directly

In Domain Driven Design, there seems to be lots of agreement that Entities should not access Repositories directly. Did this come from Eric Evans Domain Driven Design book, or did it come from elsewhere? Where are there some good explanations for the reasoning behind it? edit: To clarify: I’m not talking about the classic OO … Read more

Aspect Oriented Programming vs. Object-Oriented Programming

Like most developers here and in the entire world, I have been developing software systems using object-oriented programming (OOP) techniques for many years. So when I read that aspect-oriented programming (AOP) addresses many of the problems that traditional OOP doesn’t solve completely or directly, I pause and think, is it real? I have read a … Read more

OOP vs Functional Programming vs Procedural [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago. Improve this question What are the differences between these programming paradigms, and are they better suited to particular … Read more

Constructors in Go

I have a struct and I would like it to be initialised with some sensible default values. Typically, the thing to do here is to use a constructor but since go isn’t really OOP in the traditional sense these aren’t true objects and it has no constructors. I have noticed the init method but that … Read more