Re: [PHP] Howdy (new in here)
On 2/18/11 8:39 AM, Kirk Bailey wrote: Oh hey, that's a good point. All the stuff i saw so far indented 2 spaces. WHY? Can I just indent a TAB if my editor permits this? indenting 4 spaces (2 nests) is easy, but suppose I hit one extra space- not enough difference to be really noticeable. Let's talk about indentation in php for a moment, could we? I use PHPEclipse for an editor. It has the best code beautifier I've used for PHP class editing. I hit Ctrl+Shift+F and the whole file jumps into the format I have predefined. It handles indentation, curly braces up or down, spacing, etc. I can take code snippets from anywhere and with a couple keystrokes, the format adheres to my preferences and is readable. -- Dante On 2/16/2011 6:36 PM, Tamara Temple wrote: On Feb 15, 2011, at 11:23 PM, Brian Waters wrote: On Tue, Feb 15, 2011 at 11:46 PM, Tamara Temple tamouse.li...@gmail.com wrote: I was unlucky enough to find someone who coded a function that went on for 30 pages one (this was in C, not PHP) and *that* was hard to untangle. Why!?!?!?!?!?!?! - BW (un?)fortunately, he was no longer with the company, which was why I got to take it over. It wasn't the oddest thing, by far. His designs were hugely complex (way overengineered for the task at hand, plus they didn't work), and he didn't use any consistent indenting style. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
Hello Micky, And I prefer this: if ($foo==$baz) :-). I don't know if it's kosher not to put spaces around the == but still... -- With best regards from Ukraine, Andre Skype: Francophile My blog: http://oire.org/menelion (mostly in Russian) Twitter: http://twitter.com/m_elensule Facebook: http://facebook.com/menelion Original message From: Micky Hulse rgmi...@gmail.com To: php-general@lists.php.net Date created: , 3:43:57 AM Subject: [PHP] Howdy (new in here) On Tue, Feb 15, 2011 at 2:00 PM, David Harkness davi...@highgearmedia.com wrote: I use KR. I started with it just as shown but as monitors increased in size I stopped cuddling the else so it's now on its own line, aligning the if, elseif, and else nicely. One of the developers at my company uses the truly abominable Horstmann style which makes moving code around a serious KR here, unless existing guidelines are in place... CodeIgniter framework and ExpressionEngine wants folks to use Allman. I use a programming lang called Objectscript at work, and it will give an error if there is not space between the if and the first (... For example: if(...) -- errors out. I have had to learn to put a space in there: if (...) So I don't forget, I do this for everything now... I actually kinda like the breathing room now. Speaking of spaces, I am not a fan of putting spaces around the argument: if ( foo == baz ) { I definitely prefer this: if (foo == baz) { More on spaces: I am so glad that most PHP folks I know use tabs for indentation and not spaces! Oops, did I just go there? Oh no I didn't! Good thread! Thanks for that link Tedd! Cheers, Micky -- 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] Howdy (new in here)
Tamara Temple wrote: On Feb 15, 2011, at 4:17 PM, Donovan Brooke wrote: [snip] This is what I show my students: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php Cheers, tedd I didn't know there were names for bracing styles... but Neither did I -- just the KR style was the only name I recognized. (I still have a first edition!) However, I think on my next project, I will use Whitesmith's Style. I would be more inclined to try other styles if my editor of choice, TextMate, were to easily support them; as it is now, TextMate automatically un-indents the line when you type a closing } on an open line, and automatically indents on an open line after a opening { -- so, what to do? I don't really want to dive into programming my editor's functions (which I could do with TextMate) as that is really getting into non-productive tweaking. The issue I had at times with the KR style was locating the the matching (open or closed) brace.. as they were not on the same character column. I never really found this to be a problem as long as I kept the various branches short enough. I was unlucky enough to find someone who coded a function that went on for 30 pages one (this was in C, not PHP) and *that* was hard to untangle. Of course, one of the first things I did when I had a spare moment was to chop it up in to individual functions Well, in either case it add's a bit of complexity.. if you are not searching for an end brace, you are scrolling to find a function (or include file perhaps)... but yes, I try to keep them short as well. One thing I do at times is comment what end brace is what.. } // end to: if $num == 6 I still can't get away from BBedit, but the only automatic thing I have turned on is text suggestion... which I think about turning off every time I code. ;-) -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
On Feb 15, 2011, at 11:23 PM, Brian Waters wrote: On Tue, Feb 15, 2011 at 11:46 PM, Tamara Temple tamouse.li...@gmail.com wrote: I was unlucky enough to find someone who coded a function that went on for 30 pages one (this was in C, not PHP) and *that* was hard to untangle. Why!?!?!?!?!?!?! - BW (un?)fortunately, he was no longer with the company, which was why I got to take it over. It wasn't the oddest thing, by far. His designs were hugely complex (way overengineered for the task at hand, plus they didn't work), and he didn't use any consistent indenting style. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
On Mon, Feb 14, 2011 at 20:26, Brian Waters brianmwat...@gmail.com wrote: Hi everyone! I'm just starting out with PHP so I'm looking for a good place to ask some questions, have my code critiqued (read: visciously ripped apart), and generally BS about PHP and programming in general (if that's OK). I know that PHP sometimes has a reputation for having (some) lousy developers, and I'd like to avoid becoming one of those people. To that end, I've subscribed here because I've always found mailing lists to have much higher-quality discourse than the average online foum. Looking forward to participating! Welcome aboard, Bri. P.S, The rules page on the web (http://us2.php.net/reST/php-src/README.MAILINGLIST_RULES) is currently broken, but this one works: http://us2.php.net/reST/php-src/trunk_README.MAILINGLIST_RULES. Just a heads up to whoever is in charge of that. Duly-noted. Thank you, sir. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
At 8:26 PM -0500 2/14/11, Brian Waters wrote: Hi everyone! I'm just starting out with PHP so I'm looking for a good place to ask some questions, have my code critiqued (read: visciously ripped apart), and generally BS about PHP and programming in general (if that's OK). I know that PHP sometimes has a reputation for having (some) lousy developers, and I'd like to avoid becoming one of those people. To that end, I've subscribed here because I've always found mailing lists to have much higher-quality discourse than the average online foum. Looking forward to participating! - BW -BW: Welcome to the list. A few points: We seldom viciously rip apart code. We won't write code for you -- unless it's interesting to us. We don't usually critique code -- because usually there's too much code presented when people try to go that route. We don't agree that PHP has a reputation of having some lousy developers -- because that's simply not true. We (or at least I do) agree that mailing lists have higher-quality discourse than other mediums (i.e., forums, books, web sites) -- because what is published on this list is immediately reviewed by very smart people using their experience and current technology to backup their position. So after all is said, what we do is to give you our best guess at what needs to be addressed in the problem you present. Cheers, tedd PS: We seldom point out spelling errors, but it's good to review what you post. Remember, what you post will be public for generations to come. -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
Welcome to the list, Brian. I'm fairly new to PHP and the list myself, and I've found it to be a great resource. Another is stackoverflow.com, especially for How do I do X? type questions. I often find someone else has already provided an answer. On Tue, Feb 15, 2011 at 8:51 AM, tedd tedd.sperl...@gmail.com wrote: PS: We seldom point out spelling errors. --- http://sperling.com/ I've been meaning to tell you for a while . . . your URL is misspelled. Oh wait, it's not Friday. My apologies. :) David
Re: [PHP] Howdy (new in here)
On Feb 15, 2011, at 10:51 AM, tedd wrote: At 8:26 PM -0500 2/14/11, Brian Waters wrote: Hi everyone! I'm just starting out with PHP so I'm looking for a good place to ask some questions, have my code critiqued (read: visciously ripped apart), and generally BS about PHP and programming in general (if that's OK). I know that PHP sometimes has a reputation for having (some) lousy developers, and I'd like to avoid becoming one of those people. To that end, I've subscribed here because I've always found mailing lists to have much higher-quality discourse than the average online foum. Looking forward to participating! - BW -BW: [/snip] We don't agree that PHP has a reputation of having some lousy developers -- because that's simply not true. Humm I seem to agree with the OP. But, that being said, unlike most language fanboys PHP'ers usually fully admit it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
Welcome to the list, Brian. I'm fairly new to PHP and the list myself, and I've found it to be a great resource. Another is http://stackoverflow.comstackoverflow.com, especially for How do I do X? type questions. I often find someone else has already provided an answer. On Tue, Feb 15, 2011 at 8:51 AM, tedd mailto:tedd.sperl...@gmail.comtedd.sperl...@gmail.com wrote: PS: We seldom point out spelling errors. --- http://sperling.com/http://sperling.com/ I've been meaning to tell you for a while . . . your URL is misspelled. Oh wait, it's not Friday. My apologies. :) David David: No, that's German for Sparrow -- and it's spelled correctly. Besides, that's my logo. In any event, I'll take up your comments with my ancestors some day. Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
At 11:37 AM -0600 2/15/11, Nicholas Kell wrote: On Feb 15, 2011, at 10:51 AM, tedd wrote: At 8:26 PM -0500 2/14/11, Brian Waters wrote: (if that's OK). I know that PHP sometimes has a reputation for having (some) lousy developers, and I'd like to avoid becoming one of those We don't agree that PHP has a reputation of having some lousy developers -- because that's simply not true. Humm I seem to agree with the OP. But, that being said, unlike most language fanboys PHP'ers usually fully admit it. I guess that we run in different worlds. Most of the PHP programmers I know are very good. Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
On Feb 15, 2011, at 11:52 AM, tedd wrote: At 11:37 AM -0600 2/15/11, Nicholas Kell wrote: On Feb 15, 2011, at 10:51 AM, tedd wrote: At 8:26 PM -0500 2/14/11, Brian Waters wrote: (if that's OK). I know that PHP sometimes has a reputation for having (some) lousy developers, and I'd like to avoid becoming one of those We don't agree that PHP has a reputation of having some lousy developers -- because that's simply not true. Humm I seem to agree with the OP. But, that being said, unlike most language fanboys PHP'ers usually fully admit it. I guess that we run in different worlds. Most of the PHP programmers I know are very good. I have to agree with you, tedd. Most of the PHP devs that I know are also quite good. But, the fact that both you and I know mostly good devs is not going to change the perceived reputation of PHP harboring lousy developers. I also believe that the rep that PHP has, is in part to blame that PHP is a first (and sometimes only) language for a lot of people. That, mixed with the publishing rate of code, makes for some lousy code to be seen by all. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
On Tue, Feb 15, 2011 at 12:52 PM, tedd tedd.sperl...@gmail.com wrote: At 11:37 AM -0600 2/15/11, Nicholas Kell wrote: On Feb 15, 2011, at 10:51 AM, tedd wrote: At 8:26 PM -0500 2/14/11, Brian Waters wrote: (if that's OK). I know that PHP sometimes has a reputation for having (some) lousy developers, and I'd like to avoid becoming one of those We don't agree that PHP has a reputation of having some lousy developers -- because that's simply not true. Humm I seem to agree with the OP. But, that being said, unlike most language fanboys PHP'ers usually fully admit it. I guess that we run in different worlds. Most of the PHP programmers I know are very good. I didn't mean to suggest anything. Nor do I necessarily subscribe to the idea (that PHP has some lousy developers). It's just something I've heard bouncing around - probably on those noisy internet forums. - BW P.S: On Tue, Feb 15, 2011 at 11:51 AM, tedd tedd.sperl...@gmail.com wrote: PS: We seldom point out spelling errors, but it's good to review what you post. Remember, what you post will be public for generations to come. I'm aware that I misspelled viciously in my original post but was too lazy to rectify the situation. P.P.S, Apologies for backchanneling tedd there; I'm used to mailing lists with a default Reply-To: t...@mailinglist.com header. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
I would say all languages have their 'lousy developers', however, since very few schools focus on teaching the 'proper coding style' for PHP it leads to people learning from a variety of resources available online, and this leads to them receiving mixed messages from the tutorials and allowing people the ability to choose the method they prefer. Since there is very little syntactic consistency among the code produced by developers, it leads to the perception that the developers are 'lousy'. On Tue, Feb 15, 2011 at 2:03 PM, Brian Waters brianmwat...@gmail.comwrote: On Tue, Feb 15, 2011 at 12:52 PM, tedd tedd.sperl...@gmail.com wrote: At 11:37 AM -0600 2/15/11, Nicholas Kell wrote: On Feb 15, 2011, at 10:51 AM, tedd wrote: At 8:26 PM -0500 2/14/11, Brian Waters wrote: (if that's OK). I know that PHP sometimes has a reputation for having (some) lousy developers, and I'd like to avoid becoming one of those We don't agree that PHP has a reputation of having some lousy developers -- because that's simply not true. Humm I seem to agree with the OP. But, that being said, unlike most language fanboys PHP'ers usually fully admit it. I guess that we run in different worlds. Most of the PHP programmers I know are very good. I didn't mean to suggest anything. Nor do I necessarily subscribe to the idea (that PHP has some lousy developers). It's just something I've heard bouncing around - probably on those noisy internet forums. - BW P.S: On Tue, Feb 15, 2011 at 11:51 AM, tedd tedd.sperl...@gmail.com wrote: PS: We seldom point out spelling errors, but it's good to review what you post. Remember, what you post will be public for generations to come. I'm aware that I misspelled viciously in my original post but was too lazy to rectify the situation. P.P.S, Apologies for backchanneling tedd there; I'm used to mailing lists with a default Reply-To: t...@mailinglist.com header. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Mujtaba
Re: [PHP] Howdy (new in here)
On Feb 15, 2011, at 1:20 PM, Mujtaba Arshad wrote: I would say all languages have their 'lousy developers', however, since very few schools focus on teaching the 'proper coding style' for PHP it leads to people learning from a variety of resources available online, and this leads to them receiving mixed messages from the tutorials and allowing people the ability to choose the method they prefer. Since there is very little syntactic consistency among the code produced by developers, it leads to the perception that the developers are 'lousy'. +1, I fully agree. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
At 2:03 PM -0500 2/15/11, Brian Waters wrote: On Tue, Feb 15, 2011 at 12:52 PM, tedd tedd.sperl...@gmail.com wrote: I guess that we run in different worlds. Most of the PHP programmers I know are very good. I didn't mean to suggest anything. Nor do I necessarily subscribe to the idea (that PHP has some lousy developers). It's just something I've heard bouncing around - probably on those noisy internet forums. - BW - BW: I think what you may be finding is there is an element within the programming industry that if you are to be considered a true developer you must program in [insert what language you use] and on [insert what platform you use]. Realize that we program in an open source language competing with a closed M$ environment -- and that generates a lot of biased self-interested rhetoric. Not all, but enough non-PHP programmers bad-mouth PHP because they want the perceptions of true programmers to be what they are. I remember one time when I was hired to do a Macintosh application where the client insisted on using Metrowerks Code Warrior C++. After three months working with two other developers on what I thought was a very simple project, I found that we had not moved very far at all. People were arguing about double inheritance and other such tech stuff. So, I took a *weekend* and programmed about 90 percent of application in FutureBasic. I then created a shell application and forwarded it to the client. After receiving the application, the client said Yes, this is exactly what I want -- except I want it in C++. When I asked Why? The application works and I can finish it up in a week! He replied he had friends who worked at Metrowerks and if he told them his application had been created in FutureBasic, they would laugh at him. Shortly after I quit the project. Quite often perceptions are stronger than reality. Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
At 12:52 PM -0600 2/15/11, Nicholas Kell wrote: On Feb 15, 2011, at 11:52 AM, tedd wrote: I guess that we run in different worlds. Most of the PHP programmers I know are very good. I have to agree with you, tedd. Most of the PHP devs that I know are also quite good. But, the fact that both you and I know mostly good devs is not going to change the perceived reputation of PHP harboring lousy developers. I also believe that the rep that PHP has, is in part to blame that PHP is a first (and sometimes only) language for a lot of people. That, mixed with the publishing rate of code, makes for some lousy code to be seen by all. I have yet to meet a programmer who I could not learn from. Sometimes it's how NOT to do something. :-) Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
At 2:20 PM -0500 2/15/11, Mujtaba Arshad wrote: I would say all languages have their 'lousy developers', however, since very few schools focus on teaching the 'proper coding style' for PHP it leads to people learning from a variety of resources available online, and this leads to them receiving mixed messages from the tutorials and allowing people the ability to choose the method they prefer. Since there is very little syntactic consistency among the code produced by developers, it leads to the perception that the developers are 'lousy'. I don't know if I buy that or not -- I didn't learn programming in school. I learned by using rocks instead of ones. It was a few years later that we created the concept of using the absence of rocks as zeros and were finally able to build things other than pyramids. Style became a matter of choice -- it's what makes sense to you and that usually works. For example, while it's true that Rob and I disagree on brace style, there are many different types to choose from. This is what I show my students: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
On Tue, Feb 15, 2011 at 3:37 PM, tedd tedd.sperl...@gmail.com wrote: So, I took a *weekend* and programmed about 90 percent of application in FutureBasic. I then created a shell application and forwarded it to the client. After receiving the application, the client said Yes, this is exactly what I want -- except I want it in C++. Of course, that's a ridiculous reason to choose one language over another. But to augment what you're saying, sometimes certain languages are chosen because of the availability of libraries and tools, and, more importantly, because of the availability of skilled programmers. That's especially important if a client has to expand and modify a solution in the future. - BW PS, Once again, tedd, apologies for backchanneling you... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
On Tue, 2011-02-15 at 15:54 -0500, tedd wrote: At 2:20 PM -0500 2/15/11, Mujtaba Arshad wrote: I would say all languages have their 'lousy developers', however, since very few schools focus on teaching the 'proper coding style' for PHP it leads to people learning from a variety of resources available online, and this leads to them receiving mixed messages from the tutorials and allowing people the ability to choose the method they prefer. Since there is very little syntactic consistency among the code produced by developers, it leads to the perception that the developers are 'lousy'. I don't know if I buy that or not -- I didn't learn programming in school. I learned by using rocks instead of ones. It was a few years later that we created the concept of using the absence of rocks as zeros and were finally able to build things other than pyramids. Style became a matter of choice -- it's what makes sense to you and that usually works. For example, while it's true that Rob and I disagree on brace style, there are many different types to choose from. This is what I show my students: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php Cheers, tedd -- --- http://sperling.com/ Tedd: Your bracing style is WRONG. Whitesmiths Style sucks... and Allman Style is the best way to do it. :) My personal bracing style is the Allman Style... I've been doing it that way forever, it just made sense to me (even before I knew there was that style name... which was about 3 minutes ago). everything lined up nice and neat. Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
On 11-02-15 04:08 PM, Steve Staples wrote: Tedd: Your bracing style is WRONG. Whitesmiths Style sucks... and Allman Style is the best way to do it. :) My personal bracing style is the Allman Style... I've been doing it that way forever, it just made sense to me (even before I knew there was that style name... which was about 3 minutes ago). everything lined up nice and neat. Steve I started with KR and quickly migrated to Allman style. The advantage I see with Allman is that the braces form a visual pocket into which the associated code gets placed :) 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] Howdy (new in here)
On Tue, Feb 15, 2011 at 1:08 PM, Steve Staples sstap...@mnsi.net wrote: My personal bracing style is the Allman Style. I use KR. I started with it just as shown but as monitors increased in size I stopped cuddling the else so it's now on its own line, aligning the if, elseif, and else nicely. One of the developers at my company uses the truly abominable Horstmann style which makes moving code around a serious PITA. :( David
Re: [PHP] Howdy (new in here)
@tedd I was interested about the reasons why people perceive php as a poor language. I came across the following stackoverflow thread: http://stackoverflow.com/questions/309300/defend-php-convince-me-it-isnt-horrible The guy answering him immediately after brought up some very good rebuttals, however, there are some really fundamental things that people have come to expect from programming languages that php doesn't offer and this is probably why people have issues with it. Two in particular, that people might have issues with, were brought up: 1. method/function name insensitivity 2. inconsistent naming of built in and library functions However, since this is an open-source project behind some of the biggest internet based businesses, I am personally quite fond of it. I have no issues with the language as the above two points can easily be countered with a good IDE or a little experience. Finally, I would like to say, if you are going to look for it, you can find faults with any and all programming languages. It comes down to preference, that is why you have people in the industry coding things with Java instead of C++, or vice versa, even though the other might be better for the application. On Tue, Feb 15, 2011 at 4:08 PM, Steve Staples sstap...@mnsi.net wrote: On Tue, 2011-02-15 at 15:54 -0500, tedd wrote: At 2:20 PM -0500 2/15/11, Mujtaba Arshad wrote: I would say all languages have their 'lousy developers', however, since very few schools focus on teaching the 'proper coding style' for PHP it leads to people learning from a variety of resources available online, and this leads to them receiving mixed messages from the tutorials and allowing people the ability to choose the method they prefer. Since there is very little syntactic consistency among the code produced by developers, it leads to the perception that the developers are 'lousy'. I don't know if I buy that or not -- I didn't learn programming in school. I learned by using rocks instead of ones. It was a few years later that we created the concept of using the absence of rocks as zeros and were finally able to build things other than pyramids. Style became a matter of choice -- it's what makes sense to you and that usually works. For example, while it's true that Rob and I disagree on brace style, there are many different types to choose from. This is what I show my students: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php Cheers, tedd -- --- http://sperling.com/ Tedd: Your bracing style is WRONG. Whitesmiths Style sucks... and Allman Style is the best way to do it. :) My personal bracing style is the Allman Style... I've been doing it that way forever, it just made sense to me (even before I knew there was that style name... which was about 3 minutes ago). everything lined up nice and neat. Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Mujtaba
Re: [PHP] Howdy (new in here)
On 11-02-15 04:59 PM, Brian Waters wrote: On Tue, Feb 15, 2011 at 4:50 PM, Robert Cummingsrob...@interjinn.com wrote: I started with KR and quickly migrated to Allman style. The advantage I see with Allman is that the braces form a visual pocket into which the associated code gets placed :) What about KR for control structures, and Allman for function and class definitions? That style is quite common. I find a homogenous style to be most aesthetic :) Additionally, the pocket visualization still applies. 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] Howdy (new in here)
[snip] Allman Style is the best way to do it. [/snip] Only if you're playing guitar Junior. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
[snip] This is what I show my students: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php Cheers, tedd I didn't know there were names for bracing styles... but I used the KR Style on my last project, which I would call the Larry Ullman style since that is where I took it from. However, I think on my next project, I will use Whitesmith's Style. The issue I had at times with the KR style was locating the the matching (open or closed) brace.. as they were not on the same character column. Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
Hello David, As for me, I use KR style, also. I find it the most readable, accessible and maintainable. -- With best regards from Ukraine, Andre Skype: Francophile My blog: http://oire.org/menelion (mostly in Russian) Twitter: http://twitter.com/m_elensule Facebook: http://facebook.com/menelion Original message From: David Harkness davi...@highgearmedia.com To: sstap...@mnsi.net Date created: , 12:00:52 AM Subject: [PHP] Howdy (new in here) On Tue, Feb 15, 2011 at 1:08 PM, Steve Staples sstap...@mnsi.net wrote: My personal bracing style is the Allman Style. I use KR. I started with it just as shown but as monitors increased in size I stopped cuddling the else so it's now on its own line, aligning the if, elseif, and else nicely. One of the developers at my company uses the truly abominable Horstmann style which makes moving code around a serious PITA. :( David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
On 15 February 2011 20:42, tedd tedd.sperl...@gmail.com wrote: At 12:52 PM -0600 2/15/11, Nicholas Kell wrote: On Feb 15, 2011, at 11:52 AM, tedd wrote: I guess that we run in different worlds. Most of the PHP programmers I know are very good. I have to agree with you, tedd. Most of the PHP devs that I know are also quite good. But, the fact that both you and I know mostly good devs is not going to change the perceived reputation of PHP harboring lousy developers. I also believe that the rep that PHP has, is in part to blame that PHP is a first (and sometimes only) language for a lot of people. That, mixed with the publishing rate of code, makes for some lousy code to be seen by all. I have yet to meet a programmer who I could not learn from. Sometimes it's how NOT to do something. :-) Cheers, tedd And it isn't always about programming. Talking to clients and understanding what they need (not just what they say they want as quite often, they don't know). Understanding the requirements of the business. Basically, the programming is often the easy part. Richard. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
On 15 February 2011 21:08, Steve Staples sstap...@mnsi.net wrote: Your bracing style is WRONG. Whitesmiths Style sucks... and Allman Style is the best way to do it. It's not Friday. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
On Tue, Feb 15, 2011 at 2:00 PM, David Harkness davi...@highgearmedia.com wrote: I use KR. I started with it just as shown but as monitors increased in size I stopped cuddling the else so it's now on its own line, aligning the if, elseif, and else nicely. One of the developers at my company uses the truly abominable Horstmann style which makes moving code around a serious KR here, unless existing guidelines are in place... CodeIgniter framework and ExpressionEngine wants folks to use Allman. I use a programming lang called Objectscript at work, and it will give an error if there is not space between the if and the first (... For example: if(...) -- errors out. I have had to learn to put a space in there: if (...) So I don't forget, I do this for everything now... I actually kinda like the breathing room now. Speaking of spaces, I am not a fan of putting spaces around the argument: if ( foo == baz ) { I definitely prefer this: if (foo == baz) { More on spaces: I am so glad that most PHP folks I know use tabs for indentation and not spaces! Oops, did I just go there? Oh no I didn't! Good thread! Thanks for that link Tedd! Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Howdy (new in here)
On Feb 15, 2011, at 4:17 PM, Donovan Brooke wrote: [snip] This is what I show my students: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php Cheers, tedd I didn't know there were names for bracing styles... but Neither did I -- just the KR style was the only name I recognized. (I still have a first edition!) However, I think on my next project, I will use Whitesmith's Style. I would be more inclined to try other styles if my editor of choice, TextMate, were to easily support them; as it is now, TextMate automatically un-indents the line when you type a closing } on an open line, and automatically indents on an open line after a opening { -- so, what to do? I don't really want to dive into programming my editor's functions (which I could do with TextMate) as that is really getting into non-productive tweaking. The issue I had at times with the KR style was locating the the matching (open or closed) brace.. as they were not on the same character column. I never really found this to be a problem as long as I kept the various branches short enough. I was unlucky enough to find someone who coded a function that went on for 30 pages one (this was in C, not PHP) and *that* was hard to untangle. Of course, one of the first things I did when I had a spare moment was to chop it up in to individual functions -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php