May 6th, 2005, 1:37 pm
Hello,no, it is not *necessary* to use objects, especially not in C++ which still contains C as a subset (for legacy reasons) and thus makes it quite possible to write "C++ programs" that have no connection with OO at all.If you use a language like Java, you will need to start out with a class. However, the language again cannot force you to continue designing your program the OO way beyond that, and so procedural programmers end up writing 10,000 line programs which consist of a single class used as a wrapper for a functional program.What I am trying to say is that you will have to see the benefits of OO before you are really going to use it. There is nothing about any computer language that forces you into a clean OO approach.The actual benefits themselves are less clear cut than a mathematical argument. There are C people who have checked OO and decided it is not worth the move. Huge systems (e.g. the Unix operating system) have been successfully implemented in a purely functional way. What I found is that OO looked very much the superior approach once I had played around with it for a while; however it needed to sink in first. I believe that programming is a craft rather than a science.If you are specifically interested in how a basic MC simulation would be done using OO, and what arguments could be made in favour of the OO case, may I suggest Mark Joshi's C++ book which contains precisely that sort of discussion.