 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
NETTUTS.com: 9 Confusing Naming Conventions for Beginners
by Chris Cornutt October 25, 2010 @ 11:39:42
On NETTUTS.com there's a new article that list nine different conventions that developers (PHP, Javascript, general web) could get confused about when they are just starting out.
Especially when first getting started with various web development languages, it can prove to be a difficult task to learn all of the various naming conventions from language to language. This can be even more confusing when developers disagree on what's considered best practice. To help ease the transition for beginners, this list will describe some of the more common conventions.
Some of the conventions that they mention that are more specific to PHP developers are underscores before property names, uppercase constants, capitalized first letters in variables and alternative syntax (like ternary).
voice your opinion now!
naming convention beginner confusion
Emran Hasan' Blog: Changing the default controller naming convention in CodeIgniter
by Chris Cornutt September 21, 2009 @ 09:43:09
Emran Hasan has a quick new post to his blog today looking at how you can change the default controller naming scheme that the CodeIgniter framework uses (to prevent things like naming conflicts and the like).
CodeIgniter is one of my favorite framework and I often use it for developing application quickly. Although it is very flexible in most cases, I find its naming convention to be strict. Many times I have faced this problem when my controller's class name and a model/library's class names are the same '" a Fatal error is inevitable.
His method involves extending the core CI_Router class to change the _validate_request method to change the location and the naming convention (from Users to UsersController) for the default controller settings. Code for the update is included.
voice your opinion now!
codeigniter naming controller default tutorial
Shawn Straton's Blog: Code Readability Part 2, Code Structure
by Chris Cornutt January 19, 2009 @ 12:59:41
Shawn Straton has posted the second part of his look at code readability today. This time the focus is on the structure of the code - file structure, code layout, etc.
I've had the pleasure of
maintaining a legacy application developed by people who were past
deadline the second they had their assignment handed to them in the
past and it can get really interesting rather quickly when you see
how sloppy you can get when you are in such a hurry. Here are some
guidelines I've given myself to ensure that the structure is correct
at the end of the day.
Some of his suggestions include:
- Breaking larger files apart into smaller, easier to maintain pieces
- Correctly naming functions/variables/etc
- Tabbing/spacing in to indent code blocks
- Input validation and error checking should always be included
voice your opinion now!
readable maintain structure naming convention
Keith Casey's Blog: Useful Naming Conventions
by Chris Cornutt December 09, 2008 @ 15:31:15
In a new post to his blog Keith Casey shares a few tips on naming conventions that can help increase readability in your code and make maintenance simpler in the future.
In my regular web wanderings recently, I found a great post entitled "The 7 Worst Verbs Programmers Use In Function Calls" and couldn't help but be reminded of a system that I worked on a few years ago. The core function of the system was named - no kidding - "doStuff". Everything in the application led towards that, used it, and then did other things as a result.
He suggests a structure he uses - "verbAjectiveNounStructure". Starting with an action, moving to a description of the action, to the target of the action and finally an optional structure - how the returned data is formatted.
voice your opinion now!
useful naming convention verb adjective noun structure
IBM developerWorks: Five good programming habits in PHP
by Chris Cornutt December 04, 2008 @ 12:04:56
Nathan Good has posted five tips PHP developers should use in their work to develop good programming habits to the IBM developerWorks site today.
Just like any language, developers can write code in PHP that ranges in quality from truly awful to very good. Learn good programming habits that can help you bridge the productivity gap. [...] Bad coding habits seem to accompany defects in code and can cause code to be difficult to change without introducing new defects. The following five good habits, when applied to your PHP code, will help you avoid these pitfalls.
Here's the list:
- Use good naming.
- Take smaller bites.
- Document your code.
- Handle error conditions.
- Never, ever, copy and paste.
voice your opinion now!
programming habit bestpractice document naming error copynpaste
Chris Hartjes' Blog: Dynamic Models in CakePHP 1.2
by Chris Cornutt August 06, 2008 @ 09:34:33
In this new post to his blog Chris Hartjes mentions a "nifty little feature" that the latest version of the CakePHP framework has - dynamic models.
By default now, Cake will automatically use the AppModel class and create a unique alias to a database table if it does not find the file. This means that if you have a table that follows the Cake conventions, needs no validation, and has no associations to other tables, you don't even have to create the model file any more. Woah, talk about a serious time saver in some cases.
He also mentions a gotcha to keep an eye out for - misspelling the model name when you use it. It'll definitely break things. You can find out more about models in CakePHP from this section in their manual, The Cookbook.
voice your opinion now!
dynamic model cakephp framework appmodel naming convention
Chris Hartjes' Blog: Namespaces in PHP? Why *wouldn't* you want them?
by Chris Cornutt July 01, 2008 @ 11:14:51
With more recent talk about namespaces in PHP 5.3, bloggers all over are tossing their comments into the discussion. Chris Hartjes is one of the latest with his thoughts on the point of the functionality.
I'm an outsider when it comes to tracking the going-on in the world of PHP internals. So, because of that, I'm not going to comment on the actual syntax of how namespaces will be implemented or it's impact on internals. That's not really important as far as this particular discussion goes.
He mentions one of the primary arguments for namespaces from the casual developer's perspective - keeping things separate and so classes can have the same naming as some of their cousins in other namespaces.
voice your opinion now!
namespace php5 syntax framework naming class
Tobias Schlitt's Blog: iRefuseToUse aNamingScheme
by Chris Cornutt July 01, 2008 @ 10:25:30
Tobias Schlitt has posted some comments on things recently said on PHP's upcoming support for namespaces - specifically on the ideas about naming classes the could conflict with PHP's own internal ones.
Namespaces are potentially coming in PHP 5.3 (does anyone believe?) and people start discussion about how they can even shorten their names from Abstract to aSomething and from Interface to iAnotherthing. I'm a fan of short names. [...] I agree with these rules and am of the opinion that class names must all above anything contain a semantic. Interfaces indicate what you can do with an object, while abstract classes model that different classes have a common base and can be used in the same mannor. And indeed you can add these semantics to names without using the terms.
He gives a few examples, things like Persistable, Configurable and Reflector.
voice your opinion now!
semantics naming scheme php5 namespace scheme conflict
|
Community Events
Don't see your event here? Let us know!
|