Development Articles
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDevelopment Articles

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 9th, 2000, 11:25 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
yet another good article.

yet another good article, bravo sizlere!

id

Reply With Quote
  #2  
Old October 10th, 2000, 09:06 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: yet another good article.

Yea, I read the article, and it really seems to pull object oriented programming down from the ivory tower to something us mere mortals can use. Seems very clear. Can't wait to try it. Keep up the good work! Thanks.

Reply With Quote
  #3  
Old October 11th, 2000, 12:30 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Errata

Well, I'm a web developer that uses classes extensevely at work, and I was reading the article when I found a big mistake:

Class whatever
{

function foo()
{
}

}

There are parenthesis on the functions for the classes, instead of braces.

Now, usually this would not be a big deal, but since this article is aimed at newcomers on PHP and OOP in PHP, this can be a problem for newbies.

Reply With Quote
  #4  
Old October 11th, 2000, 10:34 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Errata

Huh?

class whatever
{

function foo()
{
// function code
}

}// end class

Is correct. It HAS to have BOTH parenthesis and braces not braces INSTEAD of parenthesis.

Reply With Quote
  #5  
Old October 11th, 2000, 07:45 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
OO concepts

This is a nice article on the use of PHP or general Object oriented classes. It would help a novice to an expert programmer to create reusable robust code.

Reply With Quote
  #6  
Old October 12th, 2000, 08:44 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Great job guys, keep up the good work!!!

Hi, just wanted to let you know i-ve been reading articles from devshed since 1998, and i think it-s the best tutorial site i-ve ever found.

This article is just perfect for non-guru guys (like me) trying to understand OOP and classes.

Thanx.

Reply With Quote
  #7  
Old October 13th, 2000, 03:50 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Table example not applicable

Well, the example of a <b>table class</b> is pretty good. But it has nothing to do with real table task, or not finished (seems to me as newbe): how would I supply the real data into the table - as <b>flexible</b> as the table class itself?

Reply With Quote
  #8  
Old October 13th, 2000, 03:54 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Errata

The code on the board is correct the syntax for functions within a class in the article are wrong.

Reply With Quote
  #9  
Old October 13th, 2000, 04:22 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Do I really need class?

The explanation of a situation where class is preferred (several objects) is not convincing.
<br>
Let's assume, I have several shopping carts.
<br>
Every cart with its own functions? Where functions are <b>the same</b>?
<br>
It can be made as well with an array of cart variables and one set of functions for all carts.
<br>
<p>
<br>
The modularity of code is also not a reason: the above mentioned array and functions can be included as separate file as well.
<br>
<p>There is something more important with classes, what is unfortunately not mentioned here.
<br>

Reply With Quote
  #10  
Old October 13th, 2000, 08:23 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Errata

Ah, you are right. I was going by what jpm wrote and didn't look at the article.

Reply With Quote
  #11  
Old October 13th, 2000, 03:05 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
code share

more than reusing in the net???? its great that ideas could be seen and more style could be heard......
code well i guess classes are good /code

Reply With Quote
  #12  
Old October 14th, 2000, 01:54 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
agreed.

Devshed sure has picken up the pace lately, great job guys! You make us happy.

Reply With Quote
  #13  
Old October 14th, 2000, 02:08 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
error in extending

IN the extension example, the draw table function uses cell spacing which is not defined in the original class but in the extended class only. The drawTable() function should be part of extended class not the original one. The drawTable() in the original should not use cell_spacing.

Reply With Quote
  #14  
Old October 16th, 2000, 01:31 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Errata Corrections

Hello!

You're absolutely correct - the function code should be included within curly braces, not regular parentheses.

I don't know how I missed that error when writing the article. Thank you for pointing the oversight out, and apologies to everyone who was affected by it.

A corrected version will be posted shortly.

icarus, Melonfire

Reply With Quote
  #15  
Old October 17th, 2000, 06:57 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
.php4??? NOoooo!!!

Please do *NOT* use the .php4 extension. It's bad practice, and a support nightmare. it should be .php, plain and simple. (there is a reason it comes that way in your httpd.conf!)

Mike

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherDevelopment Articles > Back To Class


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT