Object Oriented Programming Or Traditional Coding?
#1
Posted 18 November 2012 - 05:42 PM
I am going to build and design a new website. This is my first experience in making a website. This website is fully dynamic, with online-payment, registration, user ticketing, file upload and file-center exhibition and many more functionalieties.
How should I go to accomplish the job, Object Oriented or Traditional Way of Coding?
I know both of them bu traditional one naturally is easier for me.
Autodesk Maya, Autodesk Mudbox, Nvidia Mental Images Mental Ray, Adobe Photoshop, Adobe Illustrator, Adobe After Effects, CorelDraw
#2
Posted 18 November 2012 - 08:29 PM
#3
Posted 18 November 2012 - 08:59 PM
I know both of them
Then you should be able to answer this question yourself.
http://thorpesystems.com | http://proemframework.org | http://github.com/trq
SmtpCatcher - A very simple mock sendmail useful for testing PHP mail scripts.
#4
Posted 19 November 2012 - 05:30 AM
- Organization
- Reusability
- Flex ability in frontend development (ability to change allot without messing with the data controllers)
- More secure to use public, private and protected methods (php 5 +)
... the list can go on.
If you require a simple sever side solution on an simple website then i see no floor in using a the procedural method
#5
Posted 19 November 2012 - 06:56 AM
Consider the fact that you know both rice cooking and egg cooking, which is harder? this goes here. What indeed tempts me to use OOP is its very clean and neat result. My website would probably turn to be a powerful website due to the service it is going to give visitors and customers.Then you should be able to answer this question yourself.
Traditional coding is easier but a chaotic result is what you get compared with clean well-organized OOP. And the reason why I did ask this question was to know other programmers' taste and experience.
Autodesk Maya, Autodesk Mudbox, Nvidia Mental Images Mental Ray, Adobe Photoshop, Adobe Illustrator, Adobe After Effects, CorelDraw
#6
Posted 19 November 2012 - 10:05 AM
Kidding aside, I think the general rule of thumb is that OOP is the way to go for anything that's not trivial. If you can justify the overhead, use it.

My rarely updated, incredibly rambing, questionably informative blog || Don't go to w3schools || Using 'global' is a sign of doing it wrong
#7
Posted 19 November 2012 - 02:51 PM
OOP
- powerful
- very clean and well organized
- neat result
Procedural
- Easier
Given the description of the components & features of your website, it doesn't seem like a trivial task and most likely you will be updating & adding to it. I think you can figure out which one suits your situation.
ini_set ("display_errors", "1");
error_reporting(E_ALL);
#8
Posted 19 November 2012 - 04:52 PM
Edited by Hall of Famer, 19 November 2012 - 05:03 PM.
Welcome to the world of OOPHP! In a perfect script, everything is an object. You cannot be perfect, but you can approach as close as can.

#9
Posted 19 November 2012 - 06:00 PM
Edited by Pikachu2000, 19 November 2012 - 06:11 PM.
Why $_SERVER['PHP_SELF'] is bad. || Why ORDER BY RAND() is bad || Every problem can be solved with rm -rf *
Random Quote:
"
#10
Posted 19 November 2012 - 07:33 PM
Paul Graham (co-founder of what become the Yahoo! Store and known for his work on Lisp)
Object-oriented programming generates a lot of what looks like work. Back in the days of fanfold, there was a type of programmer who would only put five or ten lines of code on a page, preceded by twenty lines of elaborately formatted comments. Object-oriented programming is like crack for these people: it lets you incorporate all this scaffolding right into your source code. Something that a Lisp hacker might handle by pushing a symbol onto a list becomes a whole file of classes and methods. So it is a good tool if you want to convince yourself, or someone else, that you are doing a lot of work.
Eric Lippert (principal developer on the C# compiler team)
What I sometimes see when I interview people and review code is symptoms of a disease I call Object Happiness. Object Happy people feel the need to apply principles of OO design to small, trivial, throwaway projects. They invest lots of unnecessary time making pure virtual abstract base classes -- writing programs where IFoos talk to IBars but there is only one implementation of each interface! I suspect that early exposure to OO design principles divorced from any practical context that motivates those principles leads to object happiness. People come away as OO True Believers rather than OO pragmatists.
I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net
#11
Posted 19 November 2012 - 08:59 PM
#12
Posted 19 November 2012 - 11:28 PM
Yes exactly...But read my post, I told this is my first web experience..so it means that I want to know more about methods being employed these daysTake a step back and read the comments you made about each paradigm:
Given the description of the components & features of your website, it doesn't seem like a trivial task and most likely you will be updating & adding to it. I think you can figure out which one suits your situation.
akphidelt2007
That is my own web and I am going to establish a CMS.
Autodesk Maya, Autodesk Mudbox, Nvidia Mental Images Mental Ray, Adobe Photoshop, Adobe Illustrator, Adobe After Effects, CorelDraw
#13
Posted 20 November 2012 - 12:16 AM
Yes exactly...But read my post, I told this is my first web experience..so it means that I want to know more about methods being employed these days
akphidelt2007
That is my own web and I am going to establish a CMS.
Well if this is your first time into web development, you'd probably want to start off with procedural programming unless you really know what you are doing with PHP. I do recommend you to learn OOP while developing your site, since it is one huge step for amateurs to turn into professionals. Someday you may want to go full OO once you are good at it, and that your site gets bigger and more complex. Good luck, theres always enough to learn in the world of programming.
Edited by Hall of Famer, 20 November 2012 - 12:17 AM.
Welcome to the world of OOPHP! In a perfect script, everything is an object. You cannot be perfect, but you can approach as close as can.

#14
Posted 20 November 2012 - 12:36 AM
Autodesk Maya, Autodesk Mudbox, Nvidia Mental Images Mental Ray, Adobe Photoshop, Adobe Illustrator, Adobe After Effects, CorelDraw
#15
Posted 20 November 2012 - 12:47 AM
I'm amateur in PHP but not in Programming. I'm programmer in MEL script, a branch of C++ in Animation and Visual Effects. Now I have no problem in using OOP in my project, that's the reason I asked it. Thanks
No worries, if so I am more than certain that you should be using OOP, a non-amateur programmer should be fine with OOP and should stick to it. PHP is much more similar to Java and C#, although C++ is not that much different. Can be a bit tricky if you are so used to using friend classes/properties/methods though.
Edited by Hall of Famer, 20 November 2012 - 12:48 AM.
Welcome to the world of OOPHP! In a perfect script, everything is an object. You cannot be perfect, but you can approach as close as can.

#16
Posted 20 November 2012 - 04:00 AM
Autodesk Maya, Autodesk Mudbox, Nvidia Mental Images Mental Ray, Adobe Photoshop, Adobe Illustrator, Adobe After Effects, CorelDraw
#17
Posted 20 November 2012 - 04:58 AM
Personally I prefer a mixture of procedural and OOP. The two methods have their own set of benefits and detractions, after all.
Procedural is perfect for small and simple tasks that (might) needs to be repeated, where you don't really need to group a whole lot of logic together. Like validating user input, for example. OOP, on the other hand, is great when you have complex tasks with a lot of associated logic. As a couple of examples you have template engines, database interaction, and similar stuff.
However, the most important factors are planning and organisation. No matter which coding style you prefer.
#18
Posted 20 November 2012 - 07:50 AM
As most parts in Computer Science, techniques complete their tasks but not similar to each other!I wouldn't put too much stock in Hall of Famer's posts when it comes to OOP vs anything, as some others have hinted towards above. Just so you know.
Personally I prefer a mixture of procedural and OOP. The two methods have their own set of benefits and detractions, after all.
Procedural is perfect for small and simple tasks that (might) needs to be repeated, where you don't really need to group a whole lot of logic together. Like validating user input, for example. OOP, on the other hand, is great when you have complex tasks with a lot of associated logic. As a couple of examples you have template engines, database interaction, and similar stuff.
However, the most important factors are planning and organization. No matter which coding style you prefer.
I can code my site traditionally since basically it has user authentication of two types: customer, translator. And just a file upload for customer and file download for translator and vice verse, but the fact is that within a month or two significant features would be incorporated into the site that needs a highly organized foundation. Such as commercial dictionary, direct chatting with administrator, custom dictionaries, adding-word to the dictionary and many more features...all of them after a year would turn to make a super-functional site in translation services.
Autodesk Maya, Autodesk Mudbox, Nvidia Mental Images Mental Ray, Adobe Photoshop, Adobe Illustrator, Adobe After Effects, CorelDraw
#19
Posted 20 November 2012 - 09:15 AM
If you are unaware of the pros and cons take these options and justifications as good advice from people who do understand the vast difference between the two methods.
#20
Posted 20 November 2012 - 10:11 AM
function makePass($word=''){
$dbSalt = '$2a$07$'.substr(hash('whirlpool',$word),0,22);
$dbPass = crypt($word, $dbSalt);
return substr($dbPass,12);
}My SQL/PHP Blog
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












