To object orient code or not?
Moderator: General Moderators
To object orient code or not?
Should I be programming php in object oriented style? Is "unstructured" out of date completely?
Re: To object orient code or not?
Like every single thing related to programming, whether you should use it or not depends on the situation.
Re: To object orient code or not?
Like Tasairis said, it depends on what you're doing.
If your program is a larger one, and will require the reuse of code, then you should look into using an OOP style. This will encourage DRY programming (Don't Repeat Yourself).
However, if your project is smaller and won't require much (if any) reuse of code, then it's more economical from a time standpoint to use a procedural style of coding.
If your program is a larger one, and will require the reuse of code, then you should look into using an OOP style. This will encourage DRY programming (Don't Repeat Yourself).
However, if your project is smaller and won't require much (if any) reuse of code, then it's more economical from a time standpoint to use a procedural style of coding.
Re: To object orient code or not?
It doesn't matter, that are just heuristics that if followed yield in better designs. Better in terms of scientifically measurable. These are things like
Coupling (minimize)
Cohesion (maximize)
Duplication (minimize)
Cyclomatic Complexity (Minimize)
Test Coverage / Test Harnesses (maximize)
Google each one in turn and read up
(FYI most programmers would agree object orientation does a better job at achieving these goals)
Coupling (minimize)
Cohesion (maximize)
Duplication (minimize)
Cyclomatic Complexity (Minimize)
Test Coverage / Test Harnesses (maximize)
Google each one in turn and read up
(FYI most programmers would agree object orientation does a better job at achieving these goals)