GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP Classes (https://gfy.com/showthread.php?t=1182985)

VladS 01-15-2016 08:08 PM

PHP Classes
 
How often do you use classes in your PHP coding? Abstract? Interface?

Coup 01-15-2016 08:29 PM


kkkkkk 01-15-2016 08:36 PM


Google Expert 01-15-2016 08:46 PM

Quote:

Originally Posted by VladS (Post 20701239)
PHP

LOL


Ruby on Rails. Thank me later.

kkkkkk 01-15-2016 08:47 PM


CHMOD 01-16-2016 03:38 AM

Quote:

Originally Posted by VladS (Post 20701239)
How often do you use classes in your PHP coding? Abstract? Interface?


I do not use them at all. In fact, I hate classes.
There is probably something that I didn't get though.

Klen 01-16-2016 03:41 AM

Quote:

Originally Posted by CHMOD (Post 20701405)
I do not use them at all. In fact, I hate classes.
There is probably something that I didn't get though.

I dont see need for them either. Such a fuss about OOP coding and classes, yet not needed in most cases.
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.

nightslit 01-16-2016 04:33 AM

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...

Klen 01-16-2016 05:37 AM

Quote:

Originally Posted by nightslit (Post 20701421)
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...

Yeah, same goes with using frameworks, unless you are making a big script with a lot of modules, no point in using framework.

And regarding sql, that is a whole different subject which can be discussed infinitely .

Ferus 01-16-2016 05:46 AM

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.

yuu.design 01-16-2016 06:43 AM

Quote:

Originally Posted by Coup (Post 20701249)

hahahah, mean guy!

HomerSimpson 01-16-2016 08:43 AM

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

VladS 01-16-2016 11:56 AM

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.

matureisland 01-16-2016 12:25 PM

I use classes... I don't use php...��

freecartoonporn 01-17-2016 05:25 AM

only when i am copying something from github...
else i play with functions directly.,

Relic 11-19-2016 02:51 AM

Never, fuck classes.

fris 11-20-2016 08:34 AM

when im doing wordpress stuff, i usally only use them in plugins, never in themes.

ina.susie 11-20-2016 09:48 AM

I, as a beginner, sometimes use codeacademy classes but usually forums

Why 11-20-2016 11:37 AM

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