Re: [PHP] Code should be selv-maintaining!
On 11-08-31 08:20 PM, Tedd Sperling wrote: On Aug 30, 2011, at 3:09 PM, Robert Cummings wrote: On 11-08-30 11:36 AM, Richard Quadling wrote: On 30 August 2011 15:04, Tedd Sperlingtedd.sperl...@gmail.com wrote: To all: I prefer the Whitesmiths style: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php But style is really up to the individual -- what works best for you is the best (unless it's a team effort or the clients demand). Cheers, tedd At last Someone's code I could read without having to reformat it every bloody time!!! http://en.wikipedia.org/wiki/Indent_style#Whitesmiths_style You're just saying that so Tedd will be your friend!! Come now, let's be honest with everyone... Whitesmith's is -GLEE! ;) Cheers, Rob. No, not indenting braces is T LYY. Make things uniform -- a condition followed by indented code located between equally indented braces makes sense to me. How people read other code styles is a mystery to me. Come now Tedd! It's only Thursday and yet you jest so!! :) Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
On 2011-08-31, at 11:44 PM, Ross McKay wrote: On Tue, 30 Aug 2011 10:04:54 -0400, Tedd Sperling wrote: I prefer the Whitesmiths style: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php But style is really up to the individual -- what works best for you is the best (unless it's a team effort or the clients demand). I note on your page that you prefer Whitesmiths (truly ugly!) style even for JavaScript. I'd strongly recommend against that, and also Allman style, due to semicolon insertion. e.g. (randomly selected from Google) http://encosia.com/in-javascript-curly-brace-placement-matters-an-example/ http://robertnyman.com/2008/10/16/beware-of-javascript-semicolon-insertion/ Sure, instances of the problem are minimal, but if you're in the habit of Dangerous Open Brace Placement then you just might fall afoul of it. Besides, my editor (Geany) folds code mostly neatly with KR :) --- FWIW, am working my way through an O'Reilly book (HTML5 Canvas) right now and they appear to use The One True Brace Style in their code examples. Not religious about it, but it does help me know which code I wrote and what was touched by someone else! George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
On 11-09-01 01:44 AM, Ross McKay wrote: On Tue, 30 Aug 2011 10:04:54 -0400, Tedd Sperling wrote: I prefer the Whitesmiths style: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php But style is really up to the individual -- what works best for you is the best (unless it's a team effort or the clients demand). I note on your page that you prefer Whitesmiths (truly ugly!) style even for JavaScript. I'd strongly recommend against that, and also Allman style, due to semicolon insertion. e.g. (randomly selected from Google) http://encosia.com/in-javascript-curly-brace-placement-matters-an-example/ http://robertnyman.com/2008/10/16/beware-of-javascript-semicolon-insertion/ Sure, instances of the problem are minimal, but if you're in the habit of Dangerous Open Brace Placement then you just might fall afoul of it. Besides, my editor (Geany) folds code mostly neatly with KR :) That's because JavaScript is broken in some ways. As much as I like JavaScript, some parts of the language were thrown together by flinging crap at a fan and seeing what sticks to the wall... this being a prime example. Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
Robert Cummings wrote: That's because JavaScript is broken in some ways. As much as I like JavaScript, some parts of the language were thrown together by flinging crap at a fan and seeing what sticks to the wall... this being a prime example. Sounds a lot like PHP :) which I must add I love dearly, though it certainly resembles your remark much more closely than JavaScript. But on-topic, novices using a coding style and feeling their way around a new language would be better served by the 1TB style than anything that easily allows statement insertion (either by them, or by silly language defects like JavaScript's semicolon insertion). -- Ross McKay, Toronto, NSW Australia Hold very tight please! Ting! Ting! - Flanders and Swann -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
On 11-09-01 02:39 AM, Ross McKay wrote: Robert Cummings wrote: That's because JavaScript is broken in some ways. As much as I like JavaScript, some parts of the language were thrown together by flinging crap at a fan and seeing what sticks to the wall... this being a prime example. Sounds a lot like PHP :) which I must add I love dearly, though it certainly resembles your remark much more closely than JavaScript. But on-topic, novices using a coding style and feeling their way around a new language would be better served by the 1TB style than anything that easily allows statement insertion (either by them, or by silly language defects like JavaScript's semicolon insertion). Oh for sure, it's necessary that novices have something towards which they can evolve. If they start with Allman's then how could they improve their brace style :) Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
On 30 August 2011 23:25, Richard Quadling rquadl...@gmail.com wrote: On 30 August 2011 20:09, Robert Cummings rob...@interjinn.com wrote: You're just saying that so Tedd will be your friend!! Come now, let's be honest with everyone... Whitesmith's is -GLEE! ;) Beauty is in the eye of the beholder. So I think we've all established that Whitesmith's is the way to go, but what about markup languages? Take our own lovely PHPDocumentation. Here, in the main, we have all subordinate elements starting on their own line, indented. Is there really any other way that would make sense? -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] Code should be selv-maintaining!
On 01 Sep 2011 at 11:42, Richard Quadling rquadl...@gmail.com wrote: On 30 August 2011 23:25, Richard Quadling rquadl...@gmail.com wrote: On 30 August 2011 20:09, Robert Cummings rob...@interjinn.com wrote: You're just saying that so Tedd will be your friend!! Come now, let's be honest with everyone... Whitesmith's is -GLEE! ;) Beauty is in the eye of the beholder. So I think we've all established that Whitesmith's is the way to go, I've been using the Whitesmith's style since I started coding in BCPL in the mid-70s. Having the braces line up is a big help. -- Cheers -- Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
On Sep 1, 2011, at 8:16 AM, Tim Streater wrote: On 01 Sep 2011 at 11:42, Richard Quadling rquadl...@gmail.com wrote: On 30 August 2011 23:25, Richard Quadling rquadl...@gmail.com wrote: On 30 August 2011 20:09, Robert Cummings rob...@interjinn.com wrote: You're just saying that so Tedd will be your friend!! Come now, let's be honest with everyone... Whitesmith's is -GLEE! ;) Beauty is in the eye of the beholder. So I think we've all established that Whitesmith's is the way to go, I've been using the Whitesmith's style since I started coding in BCPL in the mid-70s. Having the braces line up is a big help. Good. Not only do I use the Whitesmith style for PHP, but I use it for Javascript, CSS, and everything that has braces (excepting grandchildren). In addition, I also teach college level programming where I present my view on style. While I may not influence established programmers (good habits or no), young minds are open to suggestion. :-) Cheers, tedd _ t...@sperling.com http://sperling.com
RE: [PHP] Code should be selv-maintaining!
Genius! -Original Message- From: Matt Graham [mailto:danceswithcr...@usa.net] Sent: Tuesday, August 30, 2011 5:59 PM To: php-general@lists.php.net Subject: Re: [PHP] Code should be selv-maintaining! From: David Harkness davi...@highgearmedia.com I don't always use braces, but when I do I use Compact Control Readability style. Stay coding, my friends. ...and when you use CCR style, you can sing, I see a bad brace a-risin'? -- Matt G / Dances With Crows The Crow202 Blog: http://crow202.org/wordpress/ There is no Darkness in Eternity/But only Light too dim for us to see -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
On Aug 30, 2011, at 3:09 PM, Robert Cummings wrote: On 11-08-30 11:36 AM, Richard Quadling wrote: On 30 August 2011 15:04, Tedd Sperlingtedd.sperl...@gmail.com wrote: To all: I prefer the Whitesmiths style: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php But style is really up to the individual -- what works best for you is the best (unless it's a team effort or the clients demand). Cheers, tedd At last Someone's code I could read without having to reformat it every bloody time!!! http://en.wikipedia.org/wiki/Indent_style#Whitesmiths_style You're just saying that so Tedd will be your friend!! Come now, let's be honest with everyone... Whitesmith's is -GLEE! ;) Cheers, Rob. No, not indenting braces is T LYY. Make things uniform -- a condition followed by indented code located between equally indented braces makes sense to me. How people read other code styles is a mystery to me. Cheers, tedd _ t...@sperling.com http://sperling.com
Re: [PHP] Code should be selv-maintaining!
On Wed, Aug 31, 2011 at 08:20:14PM -0400, Tedd Sperling wrote: On Aug 30, 2011, at 3:09 PM, Robert Cummings wrote: On 11-08-30 11:36 AM, Richard Quadling wrote: On 30 August 2011 15:04, Tedd Sperlingtedd.sperl...@gmail.com wrote: To all: I prefer the Whitesmiths style: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php But style is really up to the individual -- what works best for you is the best (unless it's a team effort or the clients demand). Cheers, tedd At last Someone's code I could read without having to reformat it every bloody time!!! http://en.wikipedia.org/wiki/Indent_style#Whitesmiths_style You're just saying that so Tedd will be your friend!! Come now, let's be honest with everyone... Whitesmith's is -GLEE! ;) Cheers, Rob. No, not indenting braces is T LYY. Make things uniform -- a condition followed by indented code located between equally indented braces makes sense to me. How people read other code styles is a mystery to me. Indeed it is a mystery, a religious one. The way we do it is because we finally broke through the clouds of earthly obfuscation to comprehend the blinding truth that is KR. Amen. (Nah, it wasn't Kool-Aid. Tasted more like a cross between RC Cola and Dr Pepper.) ;-} Paul -- Paul M. Foster http://noferblatz.com http://quillandmouse.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
On Tue, 30 Aug 2011 10:04:54 -0400, Tedd Sperling wrote: I prefer the Whitesmiths style: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php But style is really up to the individual -- what works best for you is the best (unless it's a team effort or the clients demand). I note on your page that you prefer Whitesmiths (truly ugly!) style even for JavaScript. I'd strongly recommend against that, and also Allman style, due to semicolon insertion. e.g. (randomly selected from Google) http://encosia.com/in-javascript-curly-brace-placement-matters-an-example/ http://robertnyman.com/2008/10/16/beware-of-javascript-semicolon-insertion/ Sure, instances of the problem are minimal, but if you're in the habit of Dangerous Open Brace Placement then you just might fall afoul of it. Besides, my editor (Geany) folds code mostly neatly with KR :) -- Ross McKay, Toronto, NSW Australia Let the laddie play wi the knife - he'll learn - The Wee Book of Calvin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
On Aug 29, 2011, at 4:32 PM, George Langley wrote: The One True Brace Style: http://en.wikipedia.org/wiki/Indent_style Didn't know there was a name for the way I learned to indent! Make sense to me - looks so much cleaner and less scrolling/printing. And, I already add a comment to confirm the end brace: } // end if($myVar) to clarify any long nests. George To all: I prefer the Whitesmiths style: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php But style is really up to the individual -- what works best for you is the best (unless it's a team effort or the clients demand). Cheers, tedd --- t...@sperling.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
On 30 August 2011 15:04, Tedd Sperling tedd.sperl...@gmail.com wrote: To all: I prefer the Whitesmiths style: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php But style is really up to the individual -- what works best for you is the best (unless it's a team effort or the clients demand). Cheers, tedd At last Someone's code I could read without having to reformat it every bloody time!!! http://en.wikipedia.org/wiki/Indent_style#Whitesmiths_style -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
On 11-08-30 11:36 AM, Richard Quadling wrote: On 30 August 2011 15:04, Tedd Sperlingtedd.sperl...@gmail.com wrote: To all: I prefer the Whitesmiths style: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php But style is really up to the individual -- what works best for you is the best (unless it's a team effort or the clients demand). Cheers, tedd At last Someone's code I could read without having to reformat it every bloody time!!! http://en.wikipedia.org/wiki/Indent_style#Whitesmiths_style You're just saying that so Tedd will be your friend!! Come now, let's be honest with everyone... Whitesmith's is -GLEE! ;) Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
I don't always use braces, but when I do I use Compact Control Readability style. Stay coding, my friends.
RE: [PHP] Code should be selv-maintaining!
LOLercopter! -Original Message- From: David Harkness [mailto:davi...@highgearmedia.com] Sent: Tuesday, August 30, 2011 12:57 PM To: Robert Cummings Cc: rquadl...@gmail.com; Tedd Sperling; php-general@lists.php.net Subject: Re: [PHP] Code should be selv-maintaining! I don't always use braces, but when I do I use Compact Control Readability style. Stay coding, my friends. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Code should be selv-maintaining!
David Harkness ...you must be... the most interesting coder in the world ;) -Original Message- From: David Harkness [mailto:davi...@highgearmedia.com] Sent: Tuesday, August 30, 2011 2:57 PM To: Robert Cummings Cc: rquadl...@gmail.com; Tedd Sperling; php-general@lists.php.net Subject: Re: [PHP] Code should be selv-maintaining! I don't always use braces, but when I do I use Compact Control Readability style. Stay coding, my friends. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
On 30 August 2011 20:09, Robert Cummings rob...@interjinn.com wrote: You're just saying that so Tedd will be your friend!! Come now, let's be honest with everyone... Whitesmith's is -GLEE! ;) Beauty is in the eye of the beholder. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
On Aug 30, 2011, at 6:25 PM, Richard Quadling wrote: On 30 August 2011 20:09, Robert Cummings rob...@interjinn.com wrote: You're just saying that so Tedd will be your friend!! Come now, let's be honest with everyone... Whitesmith's is -GLEE! ;) Beauty is in the eye of the beholder. I always thought that was beer holder? Is it friday yet? ;) Jason Pruim li...@pruimphotography.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
From: David Harkness davi...@highgearmedia.com I don't always use braces, but when I do I use Compact Control Readability style. Stay coding, my friends. ...and when you use CCR style, you can sing, I see a bad brace a-risin'? -- Matt G / Dances With Crows The Crow202 Blog: http://crow202.org/wordpress/ There is no Darkness in Eternity/But only Light too dim for us to see -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Code should be selv-maintaining!
Dont get me wrong, I love programming! But what an absolute pain in the ass it is when you re-use old code only to discover something less well made. You all know about this right? You go into your homemade library of code to re-use some piece that you already are using 12 other places in production. Now, last time you worked on the code you thought it was almost perfect. While working on the code this time you find an undiscovered bug or some part of the code that looks like you where on drugs when you made it. Of course we develop experience and more skills all the time, and as a good programmer we never stop doing that, but what a pain it is when the above happens and you have to patch the code being used those 12 other places too, and each place maybe has a slightly different usage, so minor changes affect other stuff. And this goes on while your head is spinning around trying to stay focused on the very task at hand that originated the need for a quick re-usage of old code in the first place. Why the hell can't code be self-maintaining!? :)) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
On 11-08-29 03:42 PM, Rico Secada wrote: You go into your homemade library of code to re-use some piece that you already are using 12 other places in production. Now, last time you worked on the code you thought it was almost perfect. While working on the code this time you find an undiscovered bug or some part of the code that looks like you where on drugs when you made it. *lol* Yes, I think we've all seen it from time to time. Have you ever gone back and looked at your school assignments in coding? *shudder*. The horror is compounded by the fact I was using KR style indentation back then ;) Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Code should be selv-maintaining!
-Original Message- From: Rico Secada [mailto:coolz...@it.dk] Sent: Monday, August 29, 2011 3:42 PM To: php-general@lists.php.net Subject: [PHP] Code should be selv-maintaining! Dont get me wrong, I love programming! But what an absolute pain in the ass it is when you re-use old code only to discover something less well made. You all know about this right? You go into your homemade library of code to re-use some piece that you already are using 12 other places in production. Now, last time you worked on the code you thought it was almost perfect. While working on the code this time you find an undiscovered bug or some part of the code that looks like you where on drugs when you made it. Of course we develop experience and more skills all the time, and as a good programmer we never stop doing that, but what a pain it is when the above happens and you have to patch the code being used those 12 other places too, and each place maybe has a slightly different usage, so minor changes affect other stuff. And this goes on while your head is spinning around trying to stay focused on the very task at hand that originated the need for a quick re-usage of old code in the first place. Why the hell can't code be self-maintaining!? :)) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php In a framework this is not a problem, and easy to update. Development as a whole, is a living document ever growing and expanding it abilities. If taking advantage of the new ability is a long upgrade process then the design is stagnate . This is called the longevity of a design and is why many developers No longer use what is called as flat text programming. Thinking object oriented programming in frameworks is the only way I do business. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code should be selv-maintaining!
On Mon, 29 Aug 2011, Rico Secada wrote: You go into your homemade library of code to re-use some piece that you already are using 12 other places in production. Now, last time you worked on the code you thought it was almost perfect. While working on the code this time you find an undiscovered bug or some part of the code that looks like you where on drugs when you made it. This is why it's good to write this kind of thing as functions. Then if you find some great problem with it later, you can drop in the replacement functions and the code that calls it (hopefully) won't need modification. Of course, it's easier to be cleverer after the event. Geoff. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php