To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Code Critique

Code Critique Having someone critique your code is always a great way to hone the skills. Stop in and post your code to see what your peers may have done differently.

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-02-2003, 02:04 AM   #1
BuzzLY
2($infinity) && $beyond
 
BuzzLY's Avatar
 
Join Date: Nov 2002
Location: Star Command
Posts: 2,535
Exclamation Code Critique Rules and Guidelines

As always, please feel free to let me know if you think anything should be added, changed, or removed.

The Rules:
(aka "failure will result in a LARTing!"*)
  1. Please only post finished code in this forum for which you would like to receive criticism. If your code isn't working, or is buggy, and you need help with it, take it to the Coding or General Help forum. Again, this is for complete code only. This doesn't mean it has to be a complete application -- the code simply needs to be in a completed state, without known bugs.
The Guidelines:
(aka "critiques in advance")

These are not the "rules" of the forum, but rather an attempt to come up with a few standards and guidelines. Feedback is appreciated as always.
  1. The Code Critique forum was created to allow you to show off your coding skills, and to request feedback from others. It is intended for complete code only. If you have code that you are having trouble with, and are looking for help, you have come to the wrong forum. In this case, please take your question to the appropriate forum (such as Coding or General Help)
  2. I know this is common sense, but we all make mistakes. Please remember to double check any code you post to make sure you've removed/changed any sensitive data like passwords, usernames, IP addresses, host names, etc.

    It's on you if you post it. Please be careful.
  3. When posting code, please comment it well, or at least describe in your post what the code is supposed to do. This forum is meant for critique and feedback, not for showing off how well you can obfuscate your code.
  4. Whenever possible, keep your code snippets short -- include that which is necessary to demonstrate what you are trying to do, and want feedback on. If your code is excessively long (more than 50 lines), then please either attach it as a text file, or provide a link to a .phps file on your server. I suggest the .phps file, since it's easily updated, and can always reflect your latest version, rather than requiring you to upload a new file to phpbuilder.
  5. Be sure to use the [ php] and [/php] tags around your code so that it is easier for us to read.
  6. Indent your code properly -- if you want people to read it, make it easier to follow
  7. PLEASE limit the width of your code so that it fits in the thread properly. Remember that PHP allows wrapping code to a new line in almost any situation -- that is why all lines must end with a semi-colon ( ; ):
    PHP Code:
    echo "Putting this
    on several lines is
    perfectly acceptable"
    ;
  8. Don't take criticism personally. This forum is for critique, so just take it that way.
  9. Don't be mean. When critiquing someone's work, remember that they put a lot of hard work into it so far. Be fair and objective ("you might think about doing it this way..."), not personal ("you are stupid if you think that...").
  10. Remember that any suggestions you receive in this forum are just that -- suggestions. You and you alone are responsible for the final code you write. If someone convinces you to write code that ends up hacking the Pentagon, then you must take sole responsibility for that code. The bottom line: test, test, test!
As I said, please feel free to reply to this and suggest additions to these guidelines. Most of all... have fun. We're all here to learn from each other!

*Luser Attitude Readjustment Tool
__________________
New to the board? Check out the guidelines
| Color Picker | Blogification |
¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
With all its sham, drudgery, and broken dreams, it's still a beautiful world.

Last edited by BuzzLY; 08-08-2005 at 04:41 PM. Reason: clarification
BuzzLY is offline   Reply With Quote
Old 10-02-2003, 02:44 AM   #2
Moonglobe
Better fan than rebelo!
 
Moonglobe's Avatar
 
Join Date: Apr 2003
Location: brain://localhost:left-side
Posts: 2,381
phew, it's only been up for a day or two and already two stickies........ wow


anyway im already guilty of plenty of those (in one post no less!) but that's another story..........

i also think you should add a disclaimer. i know we all like to think we're the best coders in the world, and from what i've seen some of us are, but still no one is perfect, and if you get cracked because you used code suggested here, well tough luck, you obviously didn't test it enough.

just a thought
__________________
there's no place i can be, since i found serenity.
Moonglobe is offline   Reply With Quote
Old 10-02-2003, 06:03 AM   #3
Weedpacket
Custom User Title™
 
Weedpacket's Avatar
 
Join Date: Aug 2002
Location: Rapid Offensive Unit "Foreign Object Damage"
Posts: 19,126
Re: Code Critique Guidelines

Quote:
Originally posted by BuzzLY
The Guidelines:
Regard them as "critiques in advance", if you will: they'll probably be the first things most people will remark on if they can.
__________________
On two occasions I have been asked [by Members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
Weedpacket is offline   Reply With Quote
Old 10-02-2003, 09:11 AM   #4
piersk
Moderator
 
Join Date: Aug 2002
Location: Guildford, UK
Posts: 4,279
I'd like to add something:

can we please make a rule of thumb that if your code is longer than x lines, then to attach it (just add a .txt extension) to the post. It makes it easier for those with slower connections to view the thread. It might make it easier to comment since then you can comment on individual lines of code by giving the number.

Just a thought.
piersk is offline   Reply With Quote
Old 10-02-2003, 10:48 AM   #5
Moonglobe
Better fan than rebelo!
 
Moonglobe's Avatar
 
Join Date: Apr 2003
Location: brain://localhost:left-side
Posts: 2,381
Quote:
Originally posted by piersk
I'd like to add something:

can we please make a rule of thumb that if your code is longer than x lines, then to attach it (just add a .txt extension) to the post. It makes it easier for those with slower connections to view the thread. It might make it easier to comment since then you can comment on individual lines of code by giving the number.

Just a thought.
Quote:
Originally posted by BuzzLYIf your code is excessively long (more than 50 lines) then please attach it instead.
It's already in there.
__________________
there's no place i can be, since i found serenity.
Moonglobe is offline   Reply With Quote
Old 10-02-2003, 10:53 AM   #6
piersk
Moderator
 
Join Date: Aug 2002
Location: Guildford, UK
Posts: 4,279
Doh! That'll teach me not to read posts properly...
piersk is offline   Reply With Quote
Old 10-02-2003, 11:42 AM   #7
bad76
GuruMeditation #8401.0007
 
bad76's Avatar
 
Join Date: May 2003
Location: Italy
Posts: 1,213
Hi,
there are some guidelines for those msg like "why this don't work" or "what is wrong in my code" posted here ?

Can we critique it, telling him "hey, your code don't work!", or have we to help him ?
__________________
It's statistically proven that anything can be proven by means of statistics...

Last edited by bad76; 10-02-2003 at 01:22 PM.
bad76 is offline   Reply With Quote
Old 10-02-2003, 05:56 PM   #8
Weedpacket
Custom User Title™
 
Weedpacket's Avatar
 
Join Date: Aug 2002
Location: Rapid Offensive Unit "Foreign Object Damage"
Posts: 19,126
My initial impression of this forum is that it be oriented more towards peer-review of working code that the poster is interesting in hearing comments on, and a resource for people interested in learning coding styles and techniques.

I'd've thought that if you're looking for help with some code that you're trying to get to work, then the Coding Help forum would be the place to go.
__________________
On two occasions I have been asked [by Members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
Weedpacket is offline   Reply With Quote
Old 10-02-2003, 08:19 PM   #9
Merve
black sheep with red wool
 
Merve's Avatar
 
Join Date: Jul 2003
Location: North of the 49th parallel
Posts: 2,579
I think people are really going to help other people here...this forum will really give people a sense of the community. It's like open-source...thousands of little (and big) eyes peeking at the code.
__________________
"A proof is a proof. What kind of a proof? It's a proof. A proof is a proof. And when you have a good proof, it's because it's proven." -- Jean Chrétien

The Three C's
Merve is offline   Reply With Quote
Old 11-12-2003, 05:53 PM   #10
BuzzLY
2($infinity) && $beyond
 
BuzzLY's Avatar
 
Join Date: Nov 2002
Location: Star Command
Posts: 2,535
Please remember that only code you want critiqued should be posted here. Don't post code that you need help with -- post that in the Coding forum.

Yes, Merve, you can consider this a bump. Sue me.
__________________
New to the board? Check out the guidelines
| Color Picker | Blogification |
¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
With all its sham, drudgery, and broken dreams, it's still a beautiful world.
BuzzLY is offline   Reply With Quote
Old 11-12-2003, 07:47 PM   #11
Moonglobe
Better fan than rebelo!
 
Moonglobe's Avatar
 
Join Date: Apr 2003
Location: brain://localhost:left-side
Posts: 2,381
i bet ya he'll take you up on that if you're not careful....
__________________
there's no place i can be, since i found serenity.
Moonglobe is offline   Reply With Quote
Old 11-12-2003, 10:01 PM   #12
Merve
black sheep with red wool
 
Merve's Avatar
 
Join Date: Jul 2003
Location: North of the 49th parallel
Posts: 2,579
Quote:
Originally posted by BuzzLY
Please remember that only code you want critiqued should be posted here. Don't post code that you need help with -- post that in the Coding forum.

Yes, Merve, you can consider this a bump. Sue me.
I don't consider this a bump for many reasons: 1)This is a sticky. 2)What would be the point of creating another thread for this? 3)This is your thread. 4)You're a mod. 5)I don't feel like suing you because I'm too lazy.
__________________
"A proof is a proof. What kind of a proof? It's a proof. A proof is a proof. And when you have a good proof, it's because it's proven." -- Jean Chrétien

The Three C's
Merve is offline   Reply With Quote
Old 10-12-2006, 01:01 AM   #13
schwim
Closet Nice Guy
 
schwim's Avatar
 
Join Date: Jun 2006
Location: State of confusion
Posts: 479
Hi there guys,

Forgive me if this is the wrong place to ask this, but I didn't want to post a non-review request in the rest of the forum:

All of the rules make it seem like we're only to post code that spans a single page or less. Is it also ok to post a link to a .zip file if the script is multiple pages? The script utilizes the FCKEditor, which makes the download 2mb, thereabouts.

I've written a testimonial script that I am almost finished with(never finished, but you understand what I mean...), and I really wanted to ask people on this forum to look at it, but didn't know about this forum until tonight. I felt kind of crappy about posting it, as if I was asking everyone to make my code nicer, but in all honesty, this is my "hello world" script, and I'd just like to know if my dummy books have done me any good or not. I also worry about handing out a script to people that may be insecure and cause them problems.

Thanks in advance for your time,
json
schwim is offline   Reply With Quote
Reply

Bookmarks

Tags
faq


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 12:43 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.