Warning Long!!! Suggested coding conventions document

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

Hockey wrote:Programming is about the only engineering profession I can htink of that doesn't have absolute guidlines to follow...
Damn you, that's exactly what I thought to myself the other day!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I don't want to get into a large debate here so I'll refrain from responding to some things and skip to the meat.
Hockey wrote:Programming is about the only engineering profession I can htink of that doesn't have absolute guidlines to follow...I may be wrong as I'm not an engineer, but I've been in contact with many professors, engineers, etc over the years via email, person, etc...and this is definetely the impression I'm left with :)
Most other engineers don't have as many choices as we do. We literally have millions of combinations of choices at almost any given time to get from point a to point b.
Hockey wrote:This industry needs more hardened standards...
There are a few programming languages out there that are extremely strict in codestyle by enforcing it in the compiler. Now, as far as I know, they aren't doing so well compared to similar their peer solutions that aren't as strict in codestyle. If you want more strict conventions, Java may be of interest. :)
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

feyd wrote:Most other engineers don't have as many choices as we do. We literally have millions of combinations of choices at almost any given time to get from point a to point b.
Exactly. I find this, sometimes, confusing as you are not sure which way to take.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

My take on this thread was that if anyone wants to browse it and see the different styles people use (it is styling after all..) and they can pick or chose whichever they want.

Admittedly I didn't read all of the first post, but I didn't get any inclination that this was aimed at getting an agreed style for the boards. I thought perhaps Hockey is like me and changes styles more often than I change underwear..
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

IMO, I think a set style for the boards would imply to readers that this particular style is "correct" and "the way it should be". With that said, I disagree. With coding style flexibility an option, that just makes it more appealing to users who feel more comfortable with style A than style B. Or, it may discourage others from developing their own style like I and many others have.

I think I might just code on one line from now on.

Code: Select all

if($var===true){$content='this';}else{$content='somethingelse'}$array=newarray();for($i=0;$i<100;$i++){$aray[]=$data;}echo'<pre>';print_r($data);echo'</pre>';
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I think what hockey was trying to do was to establish a standard for code submitted on the boards. Nothing more, nothing less. Unles I read this thread wrong, it just appears that, given the various conventions available to PHP developers, there is a wealth of variety that we, on these boards, may face by either submitted code for review or by submitted code for inspection. Either way, their is not standard use on the boards.

As for a 'right' way or a 'wrong' way, I don't think that was the intent hockey had. I think he was shooting for the PHPDN 'accepted' way of coding. Either way, this has been a good discussion on coding. Howerver, I think many of us are set in out ways when it comes to our conventions and trying to get anyone to change them is going to be difficult if not impossible.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Hockey wrote:Programming is about the only engineering profession I can htink of that doesn't have absolute guidlines to follow...I may be wrong as I'm not an engineer, but I've been in contact with many professors, engineers, etc over the years via email, person, etc...and this is definetely the impression I'm left with :)

No wonder software is so buggy compared to other engineering practices...

This industry needs more hardened standards...blueprints if you will...and coding conventions is one of them...IMHO anyways...
First of all, in most of the professions you mention you need to pass examinations to be certified -- whereas most programmers are truly amatuers.

Our industry has a huge body of standards and practices, but many programmers seem more interested in underscores than dealing with the important aspects of software engineering for the quite simple reason that they are (like similar issues in other professions you mention) -- difficult.
Last edited by Christopher on Fri Aug 18, 2006 8:14 pm, edited 1 time in total.
(#10850)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

As for a 'right' way or a 'wrong' way, I don't think that was the intent hockey had.
That is correct...partially...as I believe to some degree even something as creative as code styling has some good points and bad points...

My reasoning was that a dozen minds would be able to come to a census which was solid or at least as solid as solid could be given the context :)
Howerver, I think many of us are set in out ways when it comes to our conventions and trying to get anyone to change them is going to be difficult if not impossible
Agreed... :P
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I would have expected electrified gelatinous goo, instead of solid decisions. These conversations rarely end in a simple consensus. They take great lengths of time to hammer out in finite detail unless participants simply don't care what decision is made. This is analogous to the passing of a law in the US I think. Someone makes a proposal, it's discussed for weeks, either denied or passed, then moves to the other house for a repeat. It takes a long time, it's difficult and generates a lot of paper.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

^^^ Exactly... :P

I made a reference to in regards to the house of commons...see above :)

Anyways, I was guessing it wouldn't happen overnight we'd all settle on any given convention...

I figured we could each (those that wanted) make a claim for our case and the community would vote (hopefully non-biased) on a convention, majority rules, just like laws... :)

What's good for the gaggle, in this case, is good for the goose as well :P

I always approach everything with a democratic mindset...as I'm a firm believer in: two heads are better than one :)

I figured a solid "open" community who appeared so accepting of standards, compliance, etc would consider it an open invitation to hammer something out...

Instead, I get opposition and innuendoes hinting at my lack of experience

Freedom of speach is absolutely very important to me, so I like when people speak their minds...of course I also can appreciate people when their polite about it too...but still... :)

I say...this argument continues, as it's for the good of a community and it's source code...I don't think I will contribute any more thoughts on the subjet though, so if anyone else doesn't I guess this thread will die a slow painful death 8O

Also, if you can't justify your answers with rational arguments, not just "Because everything Hockey says is stupid and cuz he's a silly, inexperienced, poopey-head programmer" well then, your voting rights should be revoked :lol:

p.s-There will be no paper work...as everything here is electronic...so no worries about the environment :wink:
Post Reply