Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I want to build a website that runs e-commerce (C2C), thus I want to ask which programming approach is more appropriate and advanced in terms of website's functionality?

share|improve this question

closed as too broad by MichaelT, Bart van Ingen Schenau, Martijn Pieters, GlenH7, gnat May 19 '14 at 13:36

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs. If this question can be reworded to fit the rules in the help center, please edit the question.

If you're asking this question, you might want to start smaller. Not meaning to be mean or anything, just sayin'. –  Crazy Eddie Feb 26 '11 at 8:23
What makes OOP languages (not the OOP itself!) useful in large systems is their module system. On the other hand, there are languages with similar or much more powerful module systems, that does not enforce you into an endless loop of hopeless attempts of fitting your problem domain into an alien and counterproductive OO setting. So, choose a language with decent modules, if you can't - use an OO language as if classes were just modules. –  SK-logic Feb 26 '11 at 12:05

6 Answers 6

up vote 6 down vote accepted

Most modern user level applications (ie, desktop software, web applications) and languages use some level of object oriented programming. You dont necessarily have to, but for applications that need to model the real-world (ie, catalog items, sales records), OOP tends to be a more useful approach.

share|improve this answer
Why do you think so? –  Jervis Feb 26 '11 at 7:10
That's what OOP is good at; modeling systems. That's why most enterprise software uses it. –  System Down Feb 26 '11 at 7:35
@System Down, OOP is awful in modeling the real world. World is not made of classes, objects and messages. It is stupid to try to fit the vast complexity of the real world into such an oversimplified way of thinking. There are problem domains which shines when represented in OO, of course. But they're limited, and thus OO approach itself is very limited and must be used only where appropriate. –  SK-logic Feb 26 '11 at 12:37
@SK-logic: "OOP tends to be a more useful approach" (my emphasis). OO may not be perfect, and it indeed has problems. But it is the best we have to model the real world. What other approach would you suggest, and why, to model the real world, that is superior to OO? –  CesarGon Sep 25 '11 at 17:53
@CesarGon: Why do you want to model the real world? The real world is not made for computation. Figure out the data structures and algorithms that work well to solve your problems. That's your model. –  Peter Alexander Sep 25 '11 at 22:07

If you don't know yet, then I would suggest Functional Programming (like Haskell)

It might seem a bit strange at first, but the containment of side effects and the absence of "invisible" changes make them very amenable to modelling complex systems.

share|improve this answer

If you have teams of mediocre programmers and want to stop them from ruining your code - use OOP. If you are modeling one of the examples given in books on OOP - different types of dogs, whatever - use that. But if you want to write fast, clear code rather than bloat, use something else.

share|improve this answer

I don't even think about that anymore. I just try to write correct, testable, well-factored, and understandable code. In Java I'm forced to use OO techniques, since the language doesn't support anything else. In more powerful languages I tend to use a mixture of OO and functional techniques.

share|improve this answer

Not exactly the question you asked, but I would say the reuse approach. Start with a widely-used and tested implementation like ubercart and customize for your needs. There are a zillion tiny little issues they have already solved that you or I haven't even thought of yet.

And FYI, ubercart happens to be object-oriented, which I think puts a pretty big plus in that category.

share|improve this answer

Blockquote I want to build a website that runs e-commerce (C2C) Blockquote

Your project sounds like a serious project, unless you are a very fast learner, don't venture into learning a technology from scratch in a real project. Use what you know well, even if it is not the best tool. If you have the luxury of choice, choose a tool which can be maintained by many people, easy to read and write, has an IDE, has 3rd party support, can integrate with your infrastructure and architecture, etc.

The original term structured programming came about in 1968 (the good old days of Cobol, PL/I,etc.) and "at a low level, structured programs are often composed of simple, hierarchical program flow structures. These are sequence, selection, and repetition" (quote from:enter link description here)

The main techniques used in structured programming still hold in OOP (with some terminology twists).

So I guess that good code in OOP languages would benefit from structured programming techniques anyway.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.