Thread: Is OOP better
View Single Post
  #2  
Old 08-31-2015, 09:19 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 329,497
Hall of Famer is on a distinguished road
Default

Yes OOP is better, and better by every aspect once you get a hang of it. The truth for most programmer is that, the moment they fully understand OOP, they will be reluctant to code in procedural style any longer. OOP makes code much more organized, modular, extensible and reusable.

OOP is indeed somewhat harder than procedural programming, since it requires a totally different way of thinking, but a very humanized way of thinking. Instead of worrying about how to instruct machines to do work for you in procedural style, OOP focuses more on each object/entity it interacts. So take a step back from how to get the program to execute a series of code, just start to model basic entities such as User, Adoptable, Item, etc. What is a user, what can an adoptable do, how do users, adoptables, and all kinds of entities interact with each other? If you can model your objects in this way, it will be easier for you to learn and appreciate OOP. Id say part of the difficulty in learning OOP is a direct result of the books/online-tutorials failing to teach beginners OOP in the right way.

Procedural programming is looked down as dirty because it is not by definitions scalable. With BMR's rusnak adoptables, procedural programming works about fine, but once I took over and started to add features and features on it, I found it became increasingly challenging to get things to work, and bugs may arise from nowhere. With OOP, it will be a lot easier to add new features and improve upon an existing script, given that you know how to write the appropriate code.

A fair comparison of procedural and OO programming is high school diploma and college degree. Procedural code is like high school diploma, enough to get you started with a basic job, but will place serious limitation on how far you can reach. OO code is like college or graduate level degree, its harder to get started and take longer to learn, but will help out in a long run once you are in the job market. Hope you understand the analogy here.

Mysidia Adoptables is moving towards OO because its gradually turning into a medium to large sized application. It's not the old Rusnak era anymore, with the way new features have come along. Doing OOP means that I have to spend a lot of time upfront before the new script is released, but once it's ready I will find it a lot easier and faster to implement new features. It's a tradeoff between initial development cost and continuous development cost, but in a long run OOP will pay off.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote