TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   TalkPHP Developer Team (http://www.talkphp.com/talkphp-developer-team/)
-   -   Coding Standards (http://www.talkphp.com/talkphp-developer-team/3135-coding-standards.html)

Ross 07-16-2008 09:42 PM

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.

delayedinsanity 07-17-2008 02:17 AM

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

Jim 07-17-2008 08:53 AM

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.

drewbee 07-17-2008 04:24 PM

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.

Ross 07-17-2008 05:32 PM

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.

delayedinsanity 07-17-2008 06:27 PM

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

Ross 07-17-2008 06:33 PM

Quote:

Originally Posted by delayedinsanity (Post 17162)
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

delayedinsanity 07-17-2008 07:20 PM

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!

Village Idiot 07-17-2008 07:50 PM

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.

drewbee 07-17-2008 08:00 PM

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.

delayedinsanity 07-17-2008 08:01 PM

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.

drewbee 07-17-2008 08:04 PM

^^ 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.

delayedinsanity 07-17-2008 08:12 PM

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

codefreek 07-17-2008 09:45 PM

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.

delayedinsanity 07-17-2008 11:48 PM

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

codefreek 07-18-2008 03:28 AM

we are still waiting for wildhoney

PS: Can some one host the Project Tools?
so we don't have to wait.

Tanax 07-19-2008 12:39 PM

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..

codefreek 07-19-2008 03:30 PM

i like the code standard redSHIFT posted its clean and simple.
i am up for that.

drewbee 07-20-2008 12:40 PM

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.


All times are GMT. The time now is 02:59 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0