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.
Depending on whom you ask, the difference between a good developer and an excellent developer, in terms of productivity, is a factor of 10 to 20. An excellent developer is more productive because of his experience and good habits. When poor programming habits sneak into your code, they're a drain on productivity. This article demonstrates some good programming habits that can make you a better programmer.
In addition to enabling you to build code more productively, these habits can help you build code sustainable for an application's lifetime. Any code you write is likely to spend most of its lifetime in maintenance; application maintenance is a large expense. Establishing good coding habits will enhance design factors like modularity, and your code will be easier to understand and, thus, easier and cheaper to maintain.
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:
1. Use good naming.
2. Take smaller bites.
3. Document your code.
4. Handle error conditions.
5. Never, ever, copy and paste.
Read More...
Showing posts with label Programming tips. Show all posts
Showing posts with label Programming tips. Show all posts
Friday, December 5, 2008
Tuesday, November 25, 2008
How to Set a WordPress Blog to Under Construction
If you need to take your site down for a little while to work on it, you can set the WordPress site to under construction. In this tutorial, I will show you how to set a WordPress Blog to Under Construction and use a personal message to do it.
There is no magic button that you can press to place your site under construction. Instead, you can create a static front page that says under construction on it. This tutorial will show you how to create the static page and how to set it as your front page. So, when people visit your website, they will see the Under Construction page. The downside is the links are still clickable.
Login to your Admin Panel and click the Write tab. Under the Write tab, you will need to click the Page link. Create a new page and type your under construction message in the body. Publish the page as you normally would.
Click the Settings tab and click the Reading link. On this page, you will need to look for the Front Page Displays box. It should be the first box in this section. Tick the Static field and drop the pages box down. Select the Under Construction page that you created. Then click the Save Changes button.
Now you can open your home page and see your under construction page. When you are ready to take the page down, go back to your Settings section and click Reading. Then tick the Your Latest Posts field and click the Save Changes button. Then click the Manage tab and select the pages link. Tick the field next to the under construction page and click the Delete button.
This method is the easiest way to notify your readers that the site is under construction from the WordPress blog or website. Hopwever, some control panels will allow you to set your site to under construction, but different control panels offer different options. If you want to use the control panel to set your site to under construction, you can look around your panel to see if you can find the Under Construction Option. If not, you can email your hosting company and ask if the option is available.
Read More..
There is no magic button that you can press to place your site under construction. Instead, you can create a static front page that says under construction on it. This tutorial will show you how to create the static page and how to set it as your front page. So, when people visit your website, they will see the Under Construction page. The downside is the links are still clickable.
Login to your Admin Panel and click the Write tab. Under the Write tab, you will need to click the Page link. Create a new page and type your under construction message in the body. Publish the page as you normally would.
Click the Settings tab and click the Reading link. On this page, you will need to look for the Front Page Displays box. It should be the first box in this section. Tick the Static field and drop the pages box down. Select the Under Construction page that you created. Then click the Save Changes button.
Now you can open your home page and see your under construction page. When you are ready to take the page down, go back to your Settings section and click Reading. Then tick the Your Latest Posts field and click the Save Changes button. Then click the Manage tab and select the pages link. Tick the field next to the under construction page and click the Delete button.
This method is the easiest way to notify your readers that the site is under construction from the WordPress blog or website. Hopwever, some control panels will allow you to set your site to under construction, but different control panels offer different options. If you want to use the control panel to set your site to under construction, you can look around your panel to see if you can find the Under Construction Option. If not, you can email your hosting company and ask if the option is available.
Read More..
Monday, November 3, 2008
Seven Essential Ways to Cut Your Tech Costs
Whether your business has just two people or two hundred, these tips can help you cut costs, save money, and let you focus on what's really important: the bottom line.
1. Use Open Source and Free Software
Let's face it--when you're trying to keep your business afloat, plunking down lots of cash for off-the-shelf software hurts like getting a cavity filled without Novocain. Thankfully, freeware and low-cost software can be a pleasant surprise in terms of robustness and functionality.
While not as polished as Microsoft's Office suite (but not as much of a memory or resource hog), OpenOffice.org is a free, open-source alternative with a full suite of applications for word processing, spreadsheets, presentations, and databases that are compatible with Microsoft Office. Though OpenOffice apps let you do nearly anything you can do in Microsoft Office, interoperability between the two suites isn't seamless. For example, if you use Word's Track Changes feature, it can be difficult to later delete or modify your edits when you use the document in OpenOffice, and vice versa.
Google Docs is another viable and free alternative to Microsoft Office--and has no software to download or install. Though it's not nearly as full-featured as either Office or OpenOffice, its basic functionality and streamlined interface may be all you'll ever need.
Creating PDF files may be crucial for business, but spending $450 on Adobe's Acrobat Professional is not. CutePDF is a free program that simply exports files to PDF. Just download and install it; from the target file, choose File, Print, and select CutePDF from the printer menu. (If you're using OpenOffice or Google Docs, you won't even need to install CutePDF--both let you export to PDF directly.)
2. Telecommute
Gartner Research predicts that by 2009, more than 25 percent of the U.S. workforce will telecommute. Telecommuting lets you save on gas costs, but you can also remain just as productive when working at home, thanks to tools that make it easy to connect and collaborate (almost as if you were in the office).
Wikis make it simple to post text or documents so that a group can make comments or changes. Some wikis are free and public, while others are more enterprise-focused, with more robust security features. PBwiki offers three flavors: Business, Academic, and Personal. The site includes WSIWYG editing tools, storage space, SSL encryption, automatic notifications via e-mail or RSS, and controls on access. It also offers reasonable business pricing--it's free for one to three users, $8 per month per user for 4 to 99 users, and $6 a month per user for 1000 to 4999 users.
The aforementioned Google Docs is also telecommuter-friendly, offering an affordable and easy way to share files (and to keep tabs on changes). Once you've created a file in Google Docs, simply invite others to collaborate online. When you're done, you can export the file to Word, Excel, PDF, or PowerPoint.
If you cringe at the thought of setting up a VPN (virtual private network), services like LogMeIn Hamachi may just be your ticket to headache-free remote VPN access. LogMeIn Hamachi promises easy setup using peer-to-peer technology to let off-site employees access files. The service works within your firewall and costs just $5 a month for one user license.
If your company doesn't have, and doesn't need, a centralized server, Central Desktop is a way to share documents online with virtually no setup. The site lets large or small groups easily share files, keep track of who's checked out which files (or modified them), and set up separate desktops for multiple groups of users.
Read More...
1. Use Open Source and Free Software
Let's face it--when you're trying to keep your business afloat, plunking down lots of cash for off-the-shelf software hurts like getting a cavity filled without Novocain. Thankfully, freeware and low-cost software can be a pleasant surprise in terms of robustness and functionality.
While not as polished as Microsoft's Office suite (but not as much of a memory or resource hog), OpenOffice.org is a free, open-source alternative with a full suite of applications for word processing, spreadsheets, presentations, and databases that are compatible with Microsoft Office. Though OpenOffice apps let you do nearly anything you can do in Microsoft Office, interoperability between the two suites isn't seamless. For example, if you use Word's Track Changes feature, it can be difficult to later delete or modify your edits when you use the document in OpenOffice, and vice versa.
Google Docs is another viable and free alternative to Microsoft Office--and has no software to download or install. Though it's not nearly as full-featured as either Office or OpenOffice, its basic functionality and streamlined interface may be all you'll ever need.
Creating PDF files may be crucial for business, but spending $450 on Adobe's Acrobat Professional is not. CutePDF is a free program that simply exports files to PDF. Just download and install it; from the target file, choose File, Print, and select CutePDF from the printer menu. (If you're using OpenOffice or Google Docs, you won't even need to install CutePDF--both let you export to PDF directly.)
2. Telecommute
Gartner Research predicts that by 2009, more than 25 percent of the U.S. workforce will telecommute. Telecommuting lets you save on gas costs, but you can also remain just as productive when working at home, thanks to tools that make it easy to connect and collaborate (almost as if you were in the office).
Wikis make it simple to post text or documents so that a group can make comments or changes. Some wikis are free and public, while others are more enterprise-focused, with more robust security features. PBwiki offers three flavors: Business, Academic, and Personal. The site includes WSIWYG editing tools, storage space, SSL encryption, automatic notifications via e-mail or RSS, and controls on access. It also offers reasonable business pricing--it's free for one to three users, $8 per month per user for 4 to 99 users, and $6 a month per user for 1000 to 4999 users.
The aforementioned Google Docs is also telecommuter-friendly, offering an affordable and easy way to share files (and to keep tabs on changes). Once you've created a file in Google Docs, simply invite others to collaborate online. When you're done, you can export the file to Word, Excel, PDF, or PowerPoint.
If you cringe at the thought of setting up a VPN (virtual private network), services like LogMeIn Hamachi may just be your ticket to headache-free remote VPN access. LogMeIn Hamachi promises easy setup using peer-to-peer technology to let off-site employees access files. The service works within your firewall and costs just $5 a month for one user license.
If your company doesn't have, and doesn't need, a centralized server, Central Desktop is a way to share documents online with virtually no setup. The site lets large or small groups easily share files, keep track of who's checked out which files (or modified them), and set up separate desktops for multiple groups of users.
Read More...
Subscribe to:
Posts (Atom)