Page 1 of 2
Question about PHP
Posted: Wed Jul 15, 2009 7:12 pm
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

), 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?
Re: Question about PHP
Posted: Wed Jul 15, 2009 7:20 pm
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.
Re: Question about PHP
Posted: Wed Jul 15, 2009 9:08 pm
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.
Re: Question about PHP
Posted: Wed Jul 15, 2009 9:31 pm
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!
Re: Question about PHP
Posted: Wed Jul 15, 2009 9:39 pm
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.
Re: Question about PHP
Posted: Thu Jul 16, 2009 3:05 am
by Jackolantern
Anyone ever used Codelobster before?
Re: Question about PHP
Posted: Thu Jul 16, 2009 5:23 am
by Sakar
It's a pretty good editor IMO. Might start using it for HTML and PHP coding instead of Notepad++.
Re: Question about PHP
Posted: Thu Jul 16, 2009 8:09 am
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.
Re: Question about PHP
Posted: Thu Jul 16, 2009 11:30 am
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.
Re: Question about PHP
Posted: Thu Jul 16, 2009 1:38 pm
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.
