Question about PHP

For discussions about game development that does not fit in any of the other topics.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Question about PHP

Post by Jackolantern »

All this talk on this board about using PHP to write web-based games has finally converted me. I am now picking out some books to read on the topic (I know there are probably thousands of tutorials on the internet, but what can I say, I like books :roll: ), and I am noticing something. They all seem to play down OOP. Most of them either save the OOP discussion until waaay down the line of the book, or they don't discuss it at all.

How important is OOP to PHP? I am an experienced programmer, but almost all my experience is with strictly OOP languages. The last time I used a procedural language, I was a kid and did not have a very good grip on programming at all. Are most PHP scripts written in a procedural paradigm?
The indelible lord of tl;dr
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Question about PHP

Post by hallsofvallhalla »

anyone you ask who has used PHP for a long time will tell you its two totally different worlds with using PHP in a OOP style and using it just as procedural. Once you start using it more of a OOP based you will never go back :)

I don't use very classes and such very often but PHP is far more powerful with them. PHP is one of those languages where you can get by without using them so hence many people do not fool with the Object Oriented side of it. That's not to say it doesn't have one, its very powerful. Sometimes its easier to teach people the basics and getting them actually producing before introducing too much.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Question about PHP

Post by Jackolantern »

That makes sense. So I am assuming that it is a multi-paradigm language then, like C++, where you can drop back to just writing C-style procedural code, or you can work in a semi-OOP fashion using a mixture of classes and global code?

Honestly, I feel much more comfortable with OOP than with procedural programming because I really cut my coding chops with Java, and then moved into "OOP-heavy", but not OOP-enforced languages like VB.NET.
The indelible lord of tl;dr
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Question about PHP

Post by hallsofvallhalla »

That makes sense. So I am assuming that it is a multi-paradigm language then, like C++, where you can drop back to just writing C-style procedural code, or you can work in a semi-OOP fashion using a mixture of classes and global code?
Exactly...


I am a mixed person, I like some oop and some procedural. I don't believe in spending 3 hours to make code 10 lines shorter though either. In today's coding work force they expect you to do that....My favorite work quote I hear often...Stop working so fast, you will make the rest of us look bad!
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Question about PHP

Post by Jackolantern »

I definitely see that. A completely OOP-enforced scripting language would be ridiculous due to the length of about 90% of the PHP and Javascript scripts out there. But for larger projects (like a game), it is good to know that is is available.
The indelible lord of tl;dr
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Question about PHP

Post by Jackolantern »

Anyone ever used Codelobster before?
The indelible lord of tl;dr
User avatar
Sakar
Posts: 520
Joined: Thu Apr 23, 2009 2:59 am

Re: Question about PHP

Post by Sakar »

It's a pretty good editor IMO. Might start using it for HTML and PHP coding instead of Notepad++.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Question about PHP

Post by Jackolantern »

Apparently, it has some code-completion functions like Visual Studio and Netbeans. Last time I tried Notepadd++, the only real benefit was that it was connected to the compiler (which of course in PHP is meaningless) and the syntax highlighting. Maybe it is better now.

What is kind of odd was how lacking the PHP edition of Netbeans was, in my opinion. I am very familiar with Netbeans, and wanted to use it, but it just seemed kind of flat.
The indelible lord of tl;dr
User avatar
Noctrine
Posts: 928
Joined: Thu Apr 23, 2009 9:57 pm

Re: Question about PHP

Post by Noctrine »

Most people just use it because of the syntax highlighting (Notepad++). It has some other stuff in it sure, but for me its just notepad with multiple windows, syntax finding and find/replace.
Jesse Dorsey
ProjectANI - Lead Developer Person
http://about.me/jessedorsey
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Question about PHP

Post by hallsofvallhalla »

context isnt bad for a free program. Its what I use in the videos...though I am using dreamweaver and it is so hard to use anything else now. :)
Post Reply

Return to “General Development”