473,661 Members | 2,506 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

working with classes + php

I'm new to working with classes. I'm pretty much a self taught php
programmer that uses php mostly for database entry and listings. I would
like to expand my talents and start working with classes. Is there a good
tutorial out there on the web that a novice can understand. I currently
wanting to add a password generator class to one of my existing webpages at
my helpdesk. The class is located at PHPclasses.com
(class.password .generator.php) . Thanks for any help that you can give.

A
May 15 '07 #1
20 3401
On May 15, 3:09 pm, "Auddog" <wil...@hotmail .comwrote:
I'm new to working with classes. I'm pretty much a self taught php
programmer that uses php mostly for database entry and listings. I would
like to expand my talents and start working with classes. Is there a good
tutorial out there on the web that a novice can understand. I currently
wanting to add a password generator class to one of my existing webpages at
my helpdesk. The class is located at PHPclasses.com
(class.password .generator.php) . Thanks for any help that you can give.

A
I think learning OOP in PHP causes bad habits. There are too many
different ways to do it. If you learn from a language like Java, you
will certainly get it down very well. PHP5 has many of the features of
Java OOP (not all of them, though).

If you don't have a plethora of time and need to go with the more
practical approach of learning OOP where you will be using it, in PHP,
the PHP manual is the most accurate way to learn it.

http://php.net/oop

-Mike PII

May 15 '07 #2
I think learning OOP in PHP causes bad habits. There are too many
different ways to do it. If you learn from a language like Java, you
will certainly get it down very well. PHP5 has many of the features of
Java OOP (not all of them, though).

On the contrary. Java also has quite a few unwanted characteristics as
an OO language. I agree that Eiffel would be a better place to start,
but it remains abstract, as it is hardly used. Also, PHP programmers
often have to learn javascript as well, so you gain an understanding of
both class-based and template-based object orientation.

I think the "bad habits" are a good thing to start from. As a resource
on how to learn OO programming, I would also recommend "Refactorin g" by
Martin Fowler. The examples alone in that book can teach you as much as
a good theory book.

I think PHP offers you the opportunity of gently discovering the
advantages of objects. In fact, a lot of people only need to realize the
power of a component like PHPMailer or FPDF to give abstract words like
"code reuse" a firm body.

Best regards
May 15 '07 #3
Dikkie Dik wrote:
>I think learning OOP in PHP causes bad habits. There are too many
different ways to do it. If you learn from a language like Java, you
will certainly get it down very well. PHP5 has many of the features of
Java OOP (not all of them, though).


On the contrary. Java also has quite a few unwanted characteristics as
an OO language. I agree that Eiffel would be a better place to start,
but it remains abstract, as it is hardly used. Also, PHP programmers
often have to learn javascript as well, so you gain an understanding of
both class-based and template-based object orientation.

I think the "bad habits" are a good thing to start from. As a resource
on how to learn OO programming, I would also recommend "Refactorin g" by
Martin Fowler. The examples alone in that book can teach you as much as
a good theory book.

I think PHP offers you the opportunity of gently discovering the
advantages of objects. In fact, a lot of people only need to realize the
power of a component like PHPMailer or FPDF to give abstract words like
"code reuse" a firm body.

Best regards
I don't know what "unwanted characteristics " java has as an OO language.
It is a pure OO implementation. And I agree with Mike - I think Java
is a much better language to learn OO programming.

And I've found the "bad habits", once you get into them, are very hard
to break. I don't know how many times I've had C++ programmers who got
off to the wrong start with OO programming and the result was a
horrendous mess of OO and non-OO code.

Smalltalk is also a great language for learning OO, but it's not used in
web programming.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
May 16 '07 #4
Jerry Stuckle wrote:
<snip>
I don't know what "unwanted characteristics " java has as an OO
language. It is a pure OO implementation.
I'm curious why you think Java "is a pure OO implementation? "
--
Visit <http://blogs.instreamf inancial.com/anything.php>
to read my rants on technology and the finance industry.
May 16 '07 #5
Thomas Gagne wrote:
Jerry Stuckle wrote:
><snip>
I don't know what "unwanted characteristics " java has as an OO
language. It is a pure OO implementation.
I'm curious why you think Java "is a pure OO implementation? "

Because it is designed that way. It has all the aspects of OO, and you
must do everything in an OO manner.

But that doesn't mean you can't write bad code in it.

Why do you think it isn't?

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
May 16 '07 #6
On 17.05.2007 03:01 Jerry Stuckle wrote:
I don't know what "unwanted characteristics " java has as an OO language.
It is a pure OO implementation. And I agree with Mike - I think Java
is a much better language to learn OO programming.
Technically, Java is not "pure OOP" language, because it has many
non-oop features, e.g. primitives.

As to learning, why if you try to explain to someone who is new to
programming, why this

class Test {
public static void main(String[] args) {
System.out.prin tln("hello");
}
}

is any better than

echo "hello";
;)
>
Smalltalk is also a great language for learning OO, but it's not used in
web programming.
Seaside (http://www.seaside.st) is a great Smalltalk-based
web-development framework.

I personally find Ruby (which is essentially "smalltalk for the masses")
an ideal language to learn OOP and webprogramming.
--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
May 16 '07 #7
>I'm curious why you think Java "is a pure OO implementation? "
Why do you think it isn't?
Because it is not pure OO. Not everything is an object. There are "basic
types" and "objects" in java. And Strings, that are both/neither basic
types and objects.

In pure OO languages (like Ruby), ALL types are objects. Including
integers, floats, etc.

--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
May 16 '07 #8
gosha bine wrote:
On 17.05.2007 03:01 Jerry Stuckle wrote:
<snip>
>>
Smalltalk is also a great language for learning OO, but it's not used
in web programming.

Seaside (http://www.seaside.st) is a great Smalltalk-based
web-development framework.

I personally find Ruby (which is essentially "smalltalk for the
masses") an ideal language to learn OOP and webprogramming.

Stuckle is partially correct--nothing indicates that Smalltalk for
growing as a web language as fast as other languages are, but I did hear
at conference two weeks ago the Ruby on Rails presenter (a big Ruby fan)
suggesting anyone using Seaside would be moving backwards to Rails.
Indicating that if you think Rails is cool (and it is) you should see
what Seaside can do.

--
Visit <http://blogs.instreamf inancial.com/anything.php>
to read my rants on technology and the finance industry.
May 16 '07 #9
Mike P2 wrote:
I think learning OOP in PHP causes bad habits. There are too many
different ways to do it. If you learn from a language like Java, you
will certainly get it down very well.
I'd agree with what others have posted that Java is not an ideal place to
start learning object-oriented programming, though for different reasons.

In object-oriented programming, everything's focused on "nouns". In real
life, verbs are just as important. In pure OO, a verb (method) can only
exist as an appendage to a noun (object). Thus instead of creating a
function like log_error(), OO programmers create an object ErrorLogger
with a method doIt() and somehow imagine that this is a better design.

This leads to a proliferation of FooProvider, FooFacilitator, FooFactory
and FooInitialiser objects in large OO programs.

There's a good article on such problems here...
http://steve-yegge.blogspot.com/2006...-of-nouns.html

PHP, I think, as a much better balance than Java. It has good OO
facilities, but doesn't force you to use them when they're not the
best tool for the job.

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
May 16 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1855
by: Richard | last post by:
All, I have coded an Outlook automation Addin in C# and .NET. I created the project using the Extensibility wizard. The Addin installs and runs Ok on my machine. However I am unable to succsefully install the Addin on other machines. The install runs without error, it does unpack necessary files, and it does create many Addin related registry keys - but Outlook does not seem to be
5
2746
by: Paul de Goede | last post by:
I set the Response.Filter in my aspnet application but I have noticed that if you do a Server.Transfer that the filter doesn't get called. And in actual fact the response is mostly empty. It seems that only scripts get rendered. I have seen this mentioned on this newsgroup before but with no resolution. Can anyone give any insight into this problem. Is there a work around? Manually push the Reponse.OutputStream through your filter after...
8
2516
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs file (present under the Properties folder of the project) 3. Now I created a file called test.js on the root folder of the project,
2
14823
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but for some it just suddenly stopped working. After a build it'll work maybe once or twice, then stop. I've tried repairing my installation of Visual Studio 2003 but that didn't help. Is Microsoft working on a fix for this, or is there something...
1
3855
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but for some it just suddenly stopped working. After a build it'll work maybe once or twice, then stop. I've tried repairing my installation of Visual Studio 2003 but that didn't help. Is Microsoft working on a fix for this, or is there something...
9
3209
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. What it does is to call a webservice with two parameters, one being a integer, the other one being a "String" which contains XML (not the best practice, however that is the target interface and we cannot change that).
7
4037
by: vamichael | last post by:
When I try to run the Website Administration Tool from my published application using http://localhost/myapp/webadmin.axd I am getting a "resource not found" error message. I can use the Admin tool from the IDE however. I noticed some people referring to a directory called c:\Inetpub\wwwroot\aspnet_webadmin\, which i do not have on my system.
4
3574
by: JohnB111 | last post by:
Hi Environment: Windows XPPRO SP2 IIS 5.1 AVG Anti Virus (Not script Blocking) The following code used to work perfectly on my local development machine and still does on my web server.
9
2158
by: JT | last post by:
Here is the overall structure I will be referring to: End-program ProvideWorkFlow.dll Forms and methods that properly manipulate calls to methods in AccessUtils AccessUtils (a web service) Hide.dll methods and data I want to remain hidden I have a DLL, Hide.dll, that contains methods that I want to handle for
0
8762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.