![]() |
PHP Classes
How often do you use classes in your PHP coding? Abstract? Interface?
|
|
|
Quote:
Ruby on Rails. Thank me later. |
|
Quote:
I do not use them at all. In fact, I hate classes. There is probably something that I didn't get though. |
Quote:
Last time when i had need for class was when i need ability to store mutlidimension array based on number, not name, so had to get classes from zend framework to do that. |
Well php classes aren't for nothing, but if you aren't programming a webstore I don't see the use... must be something big to program classes.
Concerning sql, mysqli is faster than mysql on bigger tables (in sets of 5000 lines), and safe for sql injection... May also be a little speed gain, depends on what you are coding... |
Quote:
And regarding sql, that is a whole different subject which can be discussed infinitely . |
IF you are reusing your code in many applications with a little complexity, I would use classes.
I am glad I went through 2 weeks of basic OOP programming (c#) because it have saved me a lot of time. |
Quote:
|
There are two ways of doing PHP:
- the old way (basically php3/php4) where no classes are used and everything is basically in functions and you just call them when you need them - the new way (OOP in php5/php6) and it's mostly used in combination with various MVC frameworks (CodeIgniter, Yii, phpFuel, Cake, Angular) and this is very useful when: you will need to reuse the part of the code, when several people work on same project, when someone doesn't have to read all your functions before it can start some coding etc... Don't make me wrong, classes in php aren't new, but lately their use in projects increased as language developed and people wanted to fully move to OOP. Here's one useful php link: PHP: The Right Way |
I don't use classes too much myself either, 90% of the case my own framework functions based does the job and does it well, but lately everyone and their moms want frameworks, classes and OOP. Which is not a bad thing, but imo it's overkill in most of the cases.
|
I use classes... I don't use php...
|
only when i am copying something from github...
else i play with functions directly., |
Never, fuck classes.
|
when im doing wordpress stuff, i usally only use them in plugins, never in themes.
|
I, as a beginner, sometimes use codeacademy classes but usually forums
|
i take it most of you aren't working on very large or modern php projects.
you should be using classes anytime you are writing more then just a quick script. once you get used to OOP PHP its pretty easy to follow. these are things you will want to know and learn if you plan to jump to other languages as well. |
All times are GMT -7. The time now is 02:50 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc