PHP -OO or Functional for speed/ knowledge demonstration?

  • PHP
  • Thread starter jgg
  • Start date
  • #1
jgg
40
0

Main Question or Discussion Point

My second PHP question this week....:smile:

I'm writing a PHP app which includes things such as form validation and database interaction. So far, almost everything has been written procedurally. However, I started playing around with PHP's OO stuff, and it's cool. Problem is, this app is being submitted for a competition, and it's graded both on speed and how well I know the language. It would make me seem more 'knowledgeable' (I think) if I broke everything up into object, but on the other hand it requires more lines of code than doing it procedurally. So which should I go with? I hear that OO is slower (and thinking about it this makes sense), however I wanted verification.
 

Answers and Replies

  • #2
jgg
40
0
...allow me to add the program will barely reach 200 lines (counting comments, not counting HTML code), if even that.
 
  • #3
You're project doesn't seem like it need the to be OOP, because design wise you don't have anything to gain from using OOP. Don't get me wrong OOP is nice, but it is a waste if it doesn't clean up your code, or use OOP features like polymorphism or inheritance. If you are trying to make you code tight the best way to do that it to avoid clauses on validation and use regular expressions instead.

I programmed in PHP for a few years, there was only one case that it was really convient to use classes.
 

Related Threads on PHP -OO or Functional for speed/ knowledge demonstration?

  • Last Post
Replies
4
Views
3K
  • Last Post
Replies
2
Views
7K
  • Last Post
Replies
9
Views
1K
  • Last Post
2
Replies
40
Views
19K
  • Last Post
Replies
4
Views
639
  • Last Post
Replies
6
Views
5K
  • Last Post
Replies
6
Views
3K
Replies
2
Views
9K
Top