TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-16-2008, 09:42 PM   #1 (permalink)
The Contributor
 
Ross's Avatar
 
Join Date: Jan 2008
Location: England, UK
Posts: 83
Thanks: 3
Ross is on a distinguished road
Default Coding Standards

We need to make a decision on this before any code is written - and we all want to get started.

Below is my natural way of coding - there will almost certainly be parts you disagree on and will want to change. Post what you would do differently. We will work on the code type that is most popular - simply so most of us aren't working differently than the way we would normally - unless it could be more efficient to use a different format (conditionals etc.).

PHP Code:
<?php

     
/**
      * Multi line comment/docblock
      * 5 spaces / tab
      */
     
     /**
      * @class MyClass
      * @final
      */
     
final class MyClass{
          private 
$config;
          
          
/**
           * Constructor
           * @param array Argument array
           */
          
public function __construct($args){
               if(
count($args) < 10 && !is_object($args)){
                    die(
'lolage');
               }
               
               (
is_array($args)) ? echo('foo') : echo('bar');
          }
     }

?>
(May expand on tomorrow, this was a quick one).

As for tabs/spaces any decent editor will convert tabs to spaces for you. I've recently started using NetBeans for Java, and then found a PHP plugin to use with it. This supports tabs to n spaces. Tabs display differently so I propose we use spaces as standard for indetation.
Ross is offline  
Reply With Quote
The Following User Says Thank You to Ross For This Useful Post:
codefreek (07-19-2008)
Old 07-17-2008, 02:17 AM   #2 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Shouldn't it just be treated like a forum for the team, where the team can bring up any issues, ideas, comments or suggestions as they see fit? Maybe ask Adam to grant you access in this forum to make certain topics sticky and just el-stickify the ones you want to always remain on top, and let the rest of the team chat away as they please below that.

Just seems like you shouldn't stop them from brainstorming to me, but it's up to you.
-m
delayedinsanity is offline  
Reply With Quote
Old 07-17-2008, 08:53 AM   #3 (permalink)
Jim
The Addict
 
Jim's Avatar
 
Join Date: Nov 2007
Location: the Netherlands
Posts: 281
Thanks: 2
Jim is on a distinguished road
Default

Yeah CF don't go too far. About the coding standards, I'm fine with anything. The only thing i like to see are variable names in camelCase and like $szVar $iVar etc.
__________________
Nunchaku! Who doesn't like martial arts? =)
Send a message via MSN to Jim Send a message via Skype™ to Jim
Jim is offline  
Reply With Quote
Old 07-17-2008, 04:24 PM   #4 (permalink)
The Acquainted
 
drewbee's Avatar
 
Join Date: May 2008
Posts: 175
Thanks: 9
drewbee is on a distinguished road
Default

I also propose we code with error_reporting = E_ALL. You never know what wil lbe turned on / off on another surver. This is best practice for different server setups.

I tend to program with CamelCased variables and methods, but either method is fine.

For the tabs... usually 4 spaces is a default tab.
__________________
There are No Stupid Questions. But there a LOT of Inquisitive Idiots.
Send a message via AIM to drewbee
drewbee is offline  
Reply With Quote
Old 07-17-2008, 05:32 PM   #5 (permalink)
The Contributor
 
Ross's Avatar
 
Join Date: Jan 2008
Location: England, UK
Posts: 83
Thanks: 3
Ross is on a distinguished road
Default

I see, personally I've been getting annoyed at the general way you handle things and now I'm told that I'm not allowed to create a topic about something that needs to be discussed.

This is a discussion board - in this case a place for discussing unfinalised topics. Coding standards are a key part of the pre-planning section of this project. All people who write code for this project need to have their say in this matter as it affects them.

Quote:
Originally Posted by codefreek
Pm me with information on what you wanna add and i will put it up not you.

This is the rules.
please follow them
If only managers are allowed to create topics please ask Wildhoney to make you a moderator so you have complete control. However if this is the way things will continue to be handled count me out of the whole thing.
Ross is offline  
Reply With Quote
Old 07-17-2008, 06:27 PM   #6 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

I know you guys aren't planning on using google code anymore, but didn't you all start putting up the standards there covering this? They were the Kohana standards if I recall correctly, pretty much verbatim, but standards nonetheless. I think I saw only one objection to a guideline set forth in those standards, and that was regarding the usage of AND over && -- why don't you settle that issue, add the final decision to the standards you currently have up at google code (until the project tools system here is finalized), and move past this issue on to other things?
-m
delayedinsanity is offline  
Reply With Quote
Old 07-17-2008, 06:33 PM   #7 (permalink)
The Contributor
 
Ross's Avatar
 
Join Date: Jan 2008
Location: England, UK
Posts: 83
Thanks: 3
Ross is on a distinguished road
Default

Quote:
Originally Posted by delayedinsanity View Post
I know you guys aren't planning on using google code anymore, but didn't you all start putting up the standards there covering this? They were the Kohana standards if I recall correctly, pretty much verbatim, but standards nonetheless. I think I saw only one objection to a guideline set forth in those standards, and that was regarding the usage of AND over && -- why don't you settle that issue, add the final decision to the standards you currently have up at google code (until the project tools system here is finalized), and move past this issue on to other things?
-m
You're right, I forgot about those.

As for camelCase variables - I usually use underscores but I can code with either.

CodingStandards - talkphp - Google Code
Ross is offline  
Reply With Quote
Old 07-17-2008, 07:20 PM   #8 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

The nice thing about this being a community project and not a corporate addendum is that it also retains the ability to evolve at any time. It would be nice to have it set in stone pre-anything gets coded, but as long as you have the basis, if you decide a few weeks in that something needs to be different, the ability is there to make changes.

I think you need to get some people coding. There's some ansy folk out there that were right into this project from the start that are starting to lose a lot of interest. Is there even a generic generic outline of what you guys want? It is an image gallery right? If you can't get people working on the core of the project, assign a few side projects getting them doing some functions you can tie into it at a later date.

Is SVN set up? Is there documentation on how you want the project members to access SVN?

Even if there's no outline of the project yet, do you have teams set up? Does everybody know what area they're going to be working in, or are they just 'coders' at this point?

Is there middle-management? You may want to make sure you assign some middle-management, otherwise this project could become wildly successfully and take over the open source community, and we don't want that. Form a committee or something.

In the words of the immortal Larry/Mater,

GIT-R-DONE!
delayedinsanity is offline  
Reply With Quote
Old 07-17-2008, 07:50 PM   #9 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

What is the point of all the talking we have done if we go into this without a plan? Sure we know what we are bulding, but we have not decided features or how we will go about them. A detailed plan of to-do things must be made before we can start coding or we will be randomly coding things and they wont fit. Its like starting on a puzzle without knowing what the end product should look like and who will do what.

What we can start coding is stuff like our SQL cleaning class, but thats not my call.
__________________

Village Idiot is offline  
Reply With Quote
The Following User Says Thank You to Village Idiot For This Useful Post:
codefreek (07-19-2008)
Old 07-17-2008, 08:00 PM   #10 (permalink)
The Acquainted
 
drewbee's Avatar
 
Join Date: May 2008
Posts: 175
Thanks: 9
drewbee is on a distinguished road
Default

VI,

I believe this will be a perfect use for VB Projects if it ever gets setup. While there will be a bug zone, a feature/request will exist too, and each one can be followed through with something of the following:

IE
- Build main core/foundation of system
- Build plugin
- Build language pack
- Create ability to view full size images

Also, I am not one to re-invent the wheel; I highly request the use of a javascript framework within this as well -- which my vote is for jQuery.

Of course... we really need wild to get us up and running.
__________________
There are No Stupid Questions. But there a LOT of Inquisitive Idiots.
Send a message via AIM to drewbee
drewbee is offline  
Reply With Quote
Old 07-17-2008, 08:01 PM   #11 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

I was saying what I'll say again at the end of this post; there's been a lot of talking, and a lot of talking, and there should have been a plan a long time ago. For all the "we need this, and we need that", there isn't. Everybody knows what needs to be done, and they're relying on a few people to do it, and it's not getting done.

GIT-R-DONE.
delayedinsanity is offline  
Reply With Quote
Old 07-17-2008, 08:04 PM   #12 (permalink)
The Acquainted
 
drewbee's Avatar
 
Join Date: May 2008
Posts: 175
Thanks: 9
drewbee is on a distinguished road
Default

I would love it to be; Wild has disapeared off the face of the internet. -- He was all for putting it up... but hasn't been around. We need something to manage our plans. And while all this talking is just talking... we need it to be organized and orchestrated... or things will get really chaotic; which is where they are right now. lol.
__________________
There are No Stupid Questions. But there a LOT of Inquisitive Idiots.
Send a message via AIM to drewbee
drewbee is offline  
Reply With Quote
Old 07-17-2008, 08:12 PM   #13 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

I'm sure Adam has his reasons for not being around and that getting the project tools up is out of his hands for now. Whomever is in control of this project however, or whomever happens to be aiding in that control needs to step up at this point and lay something down. It may wind up being the same situation, once the plan is laid out, the coding may never get started. The first class may never get finished. But at this point there is no direction, and it's going to kill this project. Somebody needs to step up and say "okay, here's what we're doing. If you have any ideas, or suggestions, I will gladly take them into account, but here's the basis for what we're doing. Here's your assignments. Here's the outline."

At this point step one hasn't even been achieved. We haven't gotten past the brainstorming area.
-m
delayedinsanity is offline  
Reply With Quote
Old 07-17-2008, 09:45 PM   #14 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

omg turn me out to be the villain here thats great thank you!

lets see how much you guys get done by having like 100 brainstorming topics? the first one started and is on like 10 pages long and then one more and now one more?
yeah ok great that you bring ideas but i have posted already what should be looked at before even the coding can start so why even talk about this now ?..
and do you guys know noting about the meaning of manager? i try to manage it to the goal oh well. nvm forget i ever said anything...

also look at the posts you are making not even related to the coding standards thats why i don't want everyone to be able to post topics because you start a topic and it turns out to become something that its not. but oh ¤¤.well.¤¤






Thank you.

Last edited by codefreek : 07-18-2008 at 03:28 AM.
codefreek is offline  
Reply With Quote
Old 07-17-2008, 11:48 PM   #15 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Relax, nobody is trying to make you out to be the villain. Brainstorming is an integral part to any design process or pretty much any development type of process. Having multiple topics on one subject that turns into another isn't a bad thing, it's how things get done, and it's pretty important that everybody involved have the ability to voice their opinions. Do you want to run a democracy here, or a dictatorship? They both have their merits in application development, but you need to choose now which you are going to run, and make it clear what everybody's role and purpose is.

Just because the posts don't directly relate to what you desire them to be at this point in the process does not mean they are not valid or important to the end result.

I'm sorry if I instigated anything, I really think I would like to be part of this project at some point, if I can volunteer the time. It's been over a month since everything was initially suggested, things should be moving forward, should they not?
-m
delayedinsanity is offline  
Reply With Quote
Old 07-18-2008, 03:28 AM   #16 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

we are still waiting for wildhoney

PS: Can some one host the Project Tools?
so we don't have to wait.
codefreek is offline  
Reply With Quote
Old 07-19-2008, 12:39 PM   #17 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

I code exactly the way you do, so I'm more than alright with that way.
However, I would have no disagreement if we desided to name the variables $szString, $iInt, etc..
__________________
Tanax is offline  
Reply With Quote
The Following User Says Thank You to Tanax For This Useful Post:
codefreek (07-19-2008)
Old 07-19-2008, 03:30 PM   #18 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

i like the code standard redSHIFT posted its clean and simple.
i am up for that.
codefreek is offline  
Reply With Quote
Old 07-20-2008, 12:40 PM   #19 (permalink)
The Acquainted
 
drewbee's Avatar
 
Join Date: May 2008
Posts: 175
Thanks: 9
drewbee is on a distinguished road
Default

Not me. There are several things in that list that I wonder how that made it as a standard for an open source project. They are pretty much on que with the comments at the bottom of the page.
__________________
There are No Stupid Questions. But there a LOT of Inquisitive Idiots.
Send a message via AIM to drewbee
drewbee is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 09:54 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design