|

Reuseability

Code

A few months ago I developed a Scrubs Quotes application for Facebook. This is a simple app that displays a random quote from the show on your profile. One of the first lessons/ideas being taught to me in the Software Engineering Masters program here at the University of Scranton is that when you develop software, you should make it as abstract and general as possible. Reusable code is key. With that in mind, I set out to make my quotes app a little more reusable.

As far as the scope of the project goes, it wasn’t that daunting of a task. When programming in PHP, I usually make everything a function anyway because of the ease of use. But there were some things I needed to clean up. The first thing I did was create a config file with all of the application specific information- database connection info, application title, links to include in the app, etc. This makes changing the app as easy as changing a single file. Other files that I felt could be edited I placed in separate files as well. This includes the style sheet, which up until that point was included in the header file.

Once that was done, there was not a heck of a lot more to do. In an upcoming version of this software, I want to include an SQL file to generate the databases, and an easy switch to make the app sightly different if there is a single person being quoted, or multiple people.

My first use of this reusable version of the app manifests itself in a Demetri Martin Quotes application. The set up was really easy and I was able to have the app up and running in just minutes. This is a pretty exciting little project for me because it’s a great practice in system design and software development. As time goes on I hope to grow this engine and possibly make releases of the software for others to use. I would like to learn how to make this easily updateable as far as adding features go and see how scalable it really is.

Leave a Reply

Your email address will not be published. Required fields are marked *