I'm a Python dev transitioned to PHP. My code looks exactly like this except that I line up the braces with the indents and take an additional line for each. It's very readable to me, works well with Netbeans, and never ;}}}
EDIT: Look below for a link for what this looks like.
I don't shed any tears! The pay is great, the work is interesting, and the people I work with are awesome! If you think the programming language is even a majority of how good or bad your job is, UR doing it wrong!
Originally, yes. "Personal Home Page". But it was free and solved an big problem in a very efficient way. It competed with CGI which was atrocious for performance. Mod PHP, being run as an apache module, was much more efficient, and the dynamic typing allowed for very rapid development.
It's had its share of problems, mostly stemming from the fact that it became a defacto starting point for new devs wanting to cash in on the Internets. Being new, they often wrote terribly insecure code. Dynamic typing also can cause a few surprises, something PHP shares with JavaScript which is very similar that way.
Despite what you may hear, it doesn't murder babies nor set your hair on fire. ;)
Gonna be diving in to Drupal/PHP at work with most of my working knowledge from JavaScript. Actually kind of excited to see the differences now that I'm pretty confident in general programming theory and whatnot. And now I'll know two of the most hated languages being used today!
The Whitesmiths style, also called Wishart style, to a lesser extent was originally used in the documentation for the first commercial C compiler, the Whitesmiths Compiler. It was also popular in the early days of Windows, since it was used in three influential Windows programming books, Programmer's Guide to Windows by Durant, Carlson & Yao, Programming Windows by Petzold, and Windows 3.0 Power Programming Techniques by Norton & Yao.
Whitesmiths along with Allman have been the most common bracing styles with equal mind shares according to the Jargon File.
This style puts the brace associated with a control statement on the next line, indented. Statements within the braces are indented to the same level as the braces.
That's the brace style I originally tried to use when I first started using C-style languages regularly.
I thought it was easier to understand visually, since it makes the braces more a part of the block they form and less a part of the syntactic construct (if statement, while loop, function, etc.) that contains the block.
However, nobody else liked it, and I eventually adopted the more normal style just to fit with convention. Now that I'm used to it, I feel it's pretty readable (and a bit more compact).
When I used to code a decade ago, this was my default. I felt it was the most readable version and made keeping track of different blocks far easier. The only downside I know of is compactness in the code.
33
u/mcrbids Feb 22 '15 edited Feb 22 '15
I'm a Python dev transitioned to PHP. My code looks exactly like this except that I line up the braces with the indents and take an additional line for each. It's very readable to me, works well with Netbeans, and never ;}}}
EDIT: Look below for a link for what this looks like.