![]() |
|
E-Learning Center « E-Learning tutorials and competitions. » |
![]() |
|
Share | Thread Tools | Search this Thread |
![]() |
#1 |
Ma ghayro
Last Online: 04-19-2018
Join Date: Dec 2005
Posts: 5,592
Thanks: 1,765
Thanked 4,201 Times in 2,361 Posts
Groans: 12
Groaned at 18 Times in 11 Posts
|
![]()
I don't know how many PHP developers we got in VC community, i just thought about opening this thread for who it may concerns.
As you may know PHP5 best feature is the big improvement done in object modeling (interfaces, access modifiers...) while php4 has very limited OOP capability. But still some people believe that procedural has a better performance and no need for OOP in PHP since PHP was not made to be OOPed such as java and c++ Personally, i switched lately (1 month ago) to OOP and still very excited about the idea, i created some large and complex classes and doing just fine. It's way easier to modify extend using inheritance and of course debug since your page code will be way smaller than a procedural. Yet, i see many online on-fire debates about this matter. The question comes here, do you prefer Procedural Programming or Object Oriented Programming in PHP and why?
__________________
http://twitter.com/danymoussa
|
![]() |
![]() |
![]() |
#2 |
info@sync.com.lb
Last Online: 06-05-2018
Join Date: Apr 2006
Posts: 3,827
Thanks: 1,348
Thanked 2,391 Times in 1,306 Posts
Groans: 0
Groaned at 16 Times in 15 Posts
|
![]()
well xcoder, akid u know that i am a fan of classic programming aka procedural, even when using C, C++, but as i was discussing this with you, The OOP makes life easier, even though, in its first stages may appear a little bit harder, but later on you will realise that OOP, is a great improvement in the development of programming, it help modifing and diagnosing errors ways faster than classical programming. and decrease the number of code and pages writin => decrease the compiling time = fast interpretation.
finally i think this depend on each programmer, and how he feels comfortable.
__________________
http://www.gamync.com Lebanese Produced Mobiles Games by http://www.sync.com.lb |
![]() |
![]() |
![]() |
#3 |
Ma ghayro
Last Online: 04-19-2018
Join Date: Dec 2005
Posts: 5,592
Thanks: 1,765
Thanked 4,201 Times in 2,361 Posts
Groans: 12
Groaned at 18 Times in 11 Posts
|
![]()
Thanks for your reply icemaker,
Indeed, that's what i think 2. For example i am working on a BIG project currently and i have 2 tables for users the first one for managers who work in the control panel and the second one for public users who register on the website to have access to some utilities. In the procedural way you will have to write the code twice for user registration once in the control panel and the second one on the public page which is not the case in OOP. I simply created a rich featured users class and use it whenever i need. In case i had more fields in the managers table let's say i can simply extend the class to inherit all (public,protected) methods and data members in the parent class and add the new ones. a small basic example: Code:
$manager=new User; $manager->setUser($user); $manager->setPass($pass); if($manager->login()){ $manager->updateLastLogin(); $manager->createSession($manager::getSessName()); header("location: index.php"); }else{ $manager->updateLoginFailure(); $manager->lastLoginAttempt(); $manager->genError(); login_form(); } I am so excited about OOP, i m spending long hours coding daily. Seeing the difference between php4 and php5 makes me wonder what would php6 be hiding.
__________________
http://twitter.com/danymoussa
|
![]() |
![]() |
![]() |
#4 |
Registered Member
Last Online: 12-12-2008
Join Date: Dec 2008
Posts: 14
Thanks: 0
Thanked 3 Times in 3 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
|
![]()
Of course, OOP is better but one won't notice the difference unless he/she is building large scale applications...
|
![]() |
![]() |
![]() |
#5 |
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
|
![]() |
![]() |
![]() |
![]() |
#6 |
Registered Member
Last Online: 04-15-2018
Join Date: Feb 2006
Posts: 624
Thanks: 2
Thanked 299 Times in 276 Posts
Groans: 0
Groaned at 1 Time in 1 Post
|
![]()
doesnt php lack some important oop featureslike function overloading and operator overloading. the workarounds make life harder.
as for large or small scale well basicly having a class that manages ur sql connections is an example of everyday php uses that manages a small scale project and makes life easier.
__________________
I pwn n00bs |
![]() |
![]() |
The Following User Says Thank You to ZeRaW For This Useful Post: | xcoder (12-17-2008) |
![]() |
#7 | |
Ma ghayro
Last Online: 04-19-2018
Join Date: Dec 2005
Posts: 5,592
Thanks: 1,765
Thanked 4,201 Times in 2,361 Posts
Groans: 12
Groaned at 18 Times in 11 Posts
|
![]()
Thanks for your replies guys,
Quote:
However, all-time-OOP-programmers say that the goal of making everything OOP is harder at the beginning but on the long run you will have your own sweet private library that will make your future applications easier to make and faster to launch. However OOP requires more hardware resources but it certainly worth it.
__________________
http://twitter.com/danymoussa
|
|
![]() |
![]() |
![]() |
#8 |
Registered Member
Last Online: 12-11-2011
Join Date: Dec 2006
Posts: 946
Thanks: 388
Thanked 601 Times in 294 Posts
Groans: 4
Groaned at 3 Times in 3 Posts
|
![]()
Hey! I dont use PHP and i dont code using C++ nor C# but instead i use VB.NET and while coding for a website we use the ASP.NET technology. As you all know, VB.NET is totally OOP and i find it very interesting... It can help you in a lot of procedures like dropping some stuff from the toolbox and not havin to define it programmatically! and you can use classes to inherit from and use in many forms(while coding a windows application) or in many website pages, and you can later store those classes in a library that can be used whenever you want in any other project
![]() |
![]() |
![]() |
![]() |
#9 |
Registered Member
Last Online: 04-15-2018
Join Date: Feb 2006
Posts: 624
Thanks: 2
Thanked 299 Times in 276 Posts
Groans: 0
Groaned at 1 Time in 1 Post
|
![]()
I am not sure why Msft is keeping so much technologies C#, VB.Net, ...
Maybe because they have some communities or something. What you can do in VB.Net you can do in a better way in C#. Simply because writing VB is very much like writing a script not a code. you have to Dim a variable and stuff. I used to like it but C# is better if you have a C++ experience. But in the end it is just a matter of what you like, as they all achieve the same result. Personally I just liked php cuz function names r pretty close to c :P and I hated ASP cuz it is close to VB.net ![]()
__________________
I pwn n00bs |
![]() |
![]() |
The Following User Says Thank You to ZeRaW For This Useful Post: | Sheriff Ice (12-20-2008) |
![]() |
|
Tags |
oop, php5, procedural |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
|
|