mostafatalebi Posted November 18, 2012 Share Posted November 18, 2012 Hello everybody 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. Quote Link to comment Share on other sites More sharing options...
jcbones Posted November 19, 2012 Share Posted November 19, 2012 It is a matter of opinion, and what you are most comfortable with. If this is a one time thing, or a website that has a small potential for growth, and I didn't have a large class library at my disposal, I would go the traditional (procedural) way, or go with a specific MVC library like cakePHP. Quote Link to comment Share on other sites More sharing options...
trq Posted November 19, 2012 Share Posted November 19, 2012 I know both of them  Then you should be able to answer this question yourself. Quote Link to comment Share on other sites More sharing options...
Iluvatar+ Posted November 19, 2012 Share Posted November 19, 2012 It is in fact a matter of option however the advantages of OOP in my own options are far greater than the out dated un-structured messy procedural approach. My advice to you is take the project into account if it requires an extensive amount of code them OOP way is prob the best root for you for the following reasons... Â - 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 Quote Link to comment Share on other sites More sharing options...
mostafatalebi Posted November 19, 2012 Author Share Posted November 19, 2012 Then you should be able to answer this question yourself. 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. 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. Quote Link to comment Share on other sites More sharing options...
KevinM1 Posted November 19, 2012 Share Posted November 19, 2012 So, like trq suggested, you were able to answer the question yourself. Â 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. Quote Link to comment Share on other sites More sharing options...
Maq Posted November 19, 2012 Share Posted November 19, 2012 Take a step back and read the comments you made about each paradigm:  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. Quote Link to comment Share on other sites More sharing options...
Hall of Famer Posted November 19, 2012 Share Posted November 19, 2012 (edited) Of course OOP, unless you are building an amateur fan site. OOP is the standard for quality programming, and since your site actually has online-payment Id say you will need such professionalism. In a perfect script everything is an object. You cannot be perfect, but you can approach as close as you can. Edited November 19, 2012 by Hall of Famer Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 19, 2012 Share Posted November 19, 2012 (edited) You still refuse to accept the fact that procedural is not in any way, shape or form, inherently  "amateur", huh? That makes you the true amateur. Edited November 19, 2012 by Pikachu2000 Quote Link to comment Share on other sites More sharing options...
Psycho Posted November 20, 2012 Share Posted November 20, 2012 Here are a couple of quotes from people that no one could accuse of being amateurish: Â 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. Quote Link to comment Share on other sites More sharing options...
akphidelt2007 Posted November 20, 2012 Share Posted November 20, 2012 As long as your client is happy it doesn't matter how you write it. BUT, that means if there is a problem in the future and it takes you days to pile through a mess of procedural code than your client probably will not be happy. If you write it neat and tidy and you have good documentation of how the site works than there is nothing wrong with how you write it. Just in my personal experience, OOP makes all the tedious, redundant work easy and let's you get to the meat of the code and all the fun stuff right away... which also greatly improves your efficiency. Quote Link to comment Share on other sites More sharing options...
mostafatalebi Posted November 20, 2012 Author Share Posted November 20, 2012 Take 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. 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. Quote Link to comment Share on other sites More sharing options...
Hall of Famer Posted November 20, 2012 Share Posted November 20, 2012 (edited) 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 November 20, 2012 by Hall of Famer Quote Link to comment Share on other sites More sharing options...
mostafatalebi Posted November 20, 2012 Author Share Posted November 20, 2012 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 Quote Link to comment Share on other sites More sharing options...
Hall of Famer Posted November 20, 2012 Share Posted November 20, 2012 (edited) 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 November 20, 2012 by Hall of Famer Quote Link to comment Share on other sites More sharing options...
mostafatalebi Posted November 20, 2012 Author Share Posted November 20, 2012 SO WELCOME OOP Quote Link to comment Share on other sites More sharing options...
Christian F. Posted November 20, 2012 Share Posted November 20, 2012 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 organisation. No matter which coding style you prefer. Quote Link to comment Share on other sites More sharing options...
mostafatalebi Posted November 20, 2012 Author Share Posted November 20, 2012 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. As most parts in Computer Science, techniques complete their tasks but not similar to each other! 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. Quote Link to comment Share on other sites More sharing options...
Iluvatar+ Posted November 20, 2012 Share Posted November 20, 2012 If you ask for an opinion you’re going to get an opinion and most likely a justification. You have stated you’re a programmer who is competent in both methods of development therefore you should know the pros and cons of both. 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. Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted November 20, 2012 Share Posted November 20, 2012 To be perfectly honest, I'd probably use both. If the shoe fit's, so to speak. I don't think, personaly, it is always in the overall best interests to hold vehemently to a single paradigm unless the language its self forces you to. I have found it quite convenient in the past to mix both OO and Procedural into a single application. Quote Link to comment Share on other sites More sharing options...
mostafatalebi Posted November 20, 2012 Author Share Posted November 20, 2012 If you ask for an opinion you’re going to get an opinion and most likely a justification. You have stated you’re a programmer who is competent in both methods of development therefore you should know the pros and cons of both. 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. If you are criticizing me, I should say I have thanked all the people who have spent their time replying to this post, but on each comment I comment back as it helps me to be remarked by users at necessary cases, and also I thanks you for doing so. The major point I see crucial to highlight is that I am not a stone or anything still, I am human, organic, with brain living and a heart pumping. Last thing, I said this is my first EXPERIENCE in web development. Quote Link to comment Share on other sites More sharing options...
Iluvatar+ Posted November 20, 2012 Share Posted November 20, 2012 A bit dramatic dont you think? Quote Link to comment Share on other sites More sharing options...
akphidelt2007 Posted November 20, 2012 Share Posted November 20, 2012 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.  It might be best to do version one procedurally. OOP works best when you can understand the benefit of it. And there is no better way to get an understanding of the power of OOP than writing out an application procedurally. So right now if you are asking what you "should" use... than OOP probably would not make your life any easier. My first application that was ever actually used in the work place was written procedurally and worked for over two years. Now, it was a heaping mess and I had to act like Sherlock Holmes to figure out where and how to make changes... but it still worked. But this process made me understand exactly what power OOP can bring to your application development. Some of us non programming computer science elitist need to get a job done... and without having the proper background in understanding OOP, you just learn trial by fire. Quote Link to comment Share on other sites More sharing options...
Jessica Posted November 20, 2012 Share Posted November 20, 2012 My first application that was ever actually used in the work place was written procedurally and worked for over two years. Now, it was a heaping mess and I had to act like Sherlock Holmes to figure out where and how to make changes...  The exact same thing can be said about an application that is entirely done in OOP - OOP stuff can easily be as bad if not worse than procedural. The problem in your application was not the lack of objects. Quote Link to comment Share on other sites More sharing options...
mostafatalebi Posted November 20, 2012 Author Share Posted November 20, 2012 yes dramatic it is but I did not mean any insult Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.