Entries tagged "code comments"

Proofreading Your Code Comments before Posting Them Online

You already spell check the text on your website(s)…right? Well, what about those code comments? Although few people are likely to ever see the comments, it's worth keeping this topic in mind in case you ever decide to publicize your code. Or if you share code samples with potential employers.

[Continue reading]

Making It Easy to Locate and Remove Test Code

When troubleshooting, sometimes it's necessary to add code to test various features. The problem is that the code may accidentally be left in when going live. Removing the extra code as you go may work in most situations. Or maybe you just know where the test code is located and removing it doesn't seem like a problem. However, what happens if you're pulled away from the task by some other emergency or deadline? Over time, the test code you were so familiar with may not be as obvious. Instead of depending on memory, here are some options for making test code stand out. [Continue reading]

Making Sure that Updates Were Applied to a Web Page with HTML Comments

When modifying a website, the effects to the page are usually apparent. But when the changes only affect the backend, how do you know you're not viewing the old page? A successful update results in the same content being displayed as before the changes. Maybe the updated page was uploaded to the wrong location. Let's see how HTML comments can help. [Continue reading]

Maintaining a Hidden Content Archive Within a PHP Page

Do you have content that cycles regularly, such as a news feed, events calendar, etc. If so, there's a good chance that the current entries would serve as useful templates for future updates. "But where do I store these content templates?" Hey, thanks for asking. If you normally delete old information and are unsure where/how to archive it, let's take a closer look at one of the methods described in last week's post (Three Simple Methods for Hiding Website Content Until It’s Ready)—hiding content with PHP comments. [Continue reading]

Three Simple Methods for Hiding Website Content Until It’s Ready

How do you handle content that needs to be temporarily removed from a website? Maybe there is some text that gets recycled on a regular basis or something that hasn't been approved for posting yet. HTML comments could be utilized to hide everything until it's ready to go live. Just keep in mind that the content is still accessible via the browser for those who know where to look. If that's an issue, the information could be moved to a separate file and saved offline…or you could use PHP comments. [Continue reading]