Web Development
No, this isn’t a blatantly obvious attempt to generate reader feedback. This is a look at why developers should use well-commented code throughout their projects and how this seemingly simple addition can change the world–or at least, make people’s lives easier.
What are comments?
//this function does x
or
#this line does y
These lines of text are comments. They may have slightly different syntax, depending on the language used, but their purpose is the same–to quickly inform those reading the code exactly those particular lines do.
Why you should comment:
1. It helps other people understand it. This seems like a no-brainer, but you never know when someone else might need to understand your code. If you release the code under certain licenses–GPL, GNU–or another open source, it is important for those who will obtain the source code to be able to modify and add to the overall functionality of your code. Even if you aren’t releasing it under an open source license, consider the fact that someone else may eventually have to fix/add to it. I’ve personally have come across some intense code (spread across several dozen files) without any documentation and unraveling how all the pieces fit together took longer than the actual repair.
2. It helps you understand it.Comments can help you quickly troubleshoot an error. You exude a certain confidence when you are able to tell someone “I think I know exactly what’s causing that.” In addition, you never know when you might have to put down the code and come back to it later. If you’re looking to extend your code, you can easily remember what everything does and can better integrate any additional functionality.
3. It helps you write better code. After seeing a need for several occurrences of a similar command, you may be able to condense your code as a result of comments. You also have a chance to logically address and document each step as it occurs, so you may consider errors or other situations that you might not have otherwise.
Well-Commented
The key word here is well-commented. You don’t need to comment every line. In fact, it’s often better if you don’t since comments, as a general rule, shouldn’t match exceed the amount of actual code. Comments should describe the overall functionality of several lines, or help to define variables or cases that otherwise may not be readily apparent to someone reading your code for the first time. You must assume that the reader does have some general knowledge of the language in order to avoid overloading with comments.
//This is a blatantly obvious attempt to generate reader feedback. Please use the following form to share your experience with commented code–or, if you aren’t a developer, a similar experience.
Peter Burgin is a web developer and instructor who’s not afraid of debugging, large textbooks, or speaking in front of huge crowds.
All Posts, Marketing, Web Design
As 2011 starts to get closer to end, we as entrepreneurs and self startups all start to think of what we will improve on for the coming year. We reflecting on all of our accomplishments for this year, as well as any pitfalls that we learned from. As a designer, 2011 had many new apps, design improvements, and devices that helped contribute to our creativity. For all the small businesses out there, here are some great items you should implement to your website for better engagement and ROI.
Video – Having a 30-90 second video on your homepage is a great way to briefly talk about your products and services. It gives your visitors a great visual look at your products in action or how truly effective your services are against your competition. My only suggestion is to turn off the auto play option on your embedded video. There’s nothing more frightening than a loud video that automatically starts playing even before a website loads and your visitor scrambling for a mute button or just closing out of your site all-together.
Call To Action – Most everyone who is on the internet has an email address. They’ve got a Twitter handle, a cell, phone, and a physical address. Though they have all of this, it doesn’t mean they’re just going to hand it over to you for nothing. Give them a reason to give you their contact information with something they are looking for too. Could be a short e-book on how to make their own business card out of clip art for starters. Or how to find the best hosting company with the most options for a WYSIWYG editor. Change your CTA maybe each month and see which “gimmick” lands you the most leads. And tailor to suit after that.
Google Analytics – I can’t stress enough how having data is vital to your website. Knowing how many people view your site with some free site-hit button at the bottom of your page is so 90’s. How about knowing which pages people view the most; or how long people stay on each of your website pages; or what buttons and links they click on. What browsers they use (mobile, Firefox, IE, etc). There’s so much more Google offers you for free in data it will blow your mind. What’s key about all that data is that you continue to use it to tweak your site.
Social Media – I don’t need to beat the horse on this one, but your newer potential clients are out there talking about your products and services. They’re talking about you and your competition. If you want free crowd-sourcing social media will give it to you in a lot more than 31 flavors. Your business needs to join and be part of the online conversations that are happening right now. Take advantage of using specials with FourSquare Check-ins or Facebook Places. Check your listings on Yelp. Promote a one day sale with Twitter. Host a webinar and post it on YouTube and inspire people to watch and share it.
You – Yes you, you need to be on your website. For those of you that think a website is only important just to have and not to monitor and keep up with, you’re wrong. I’ve seen too many websites (good and bad) fail to keep updated. Plan a date with your website at least once a month. Our team at Design Theory make it a point to reach out with our clients at least once a month to discuss their website performance, things learned from the previous month, and new ideas and tactics we’ll try for the following month(s).
So what do you plan on doing with your website for 2012? Anything more than what we’ve listed above? Share in the comments below. We’d love to dialog with you.
About Design Theory, All Posts
So we’re pretty excited about the upcoming year. It would seem as though this year flew by pretty quickly now looking back. We’ve learned so much about the design industry yet feel there is still way more to learn. We’ve learned and met a lot of you readers both online and in person and look forward to meeting more as the next year rolls in.
There’s a couple of reasons for the excitement. Aside from it just being a new year and a sense of renewal in life and business; we are expanding the content we’re going to be writing about in this blog. It will be a bit more personal, transparent, and more diverse. We’ve brought on a new intern and look forward to her contributions to the blog as well as the Design Theory brand. I won’t get into that too much just yet until we’re ready to officially introduce her. As for the personality, you’re going to hear a bit more about the team. Who we are and more of what we do individually to contribute to this firm. The transparency I think will be interesting. Giving you an in-depth look at what we really do, what programs and apps and tactics we use, and honesty on things we feel need to be said in terms of reviews and strategies.
Video interviews are coming! We’re going to get out there among our business partners and find out what makes them tick. What makes them successful, and what makes them stand apart from their competition. We’ll also be highlighting some firms that are doing it right in the fields of
- IT and Technology
- Social Media
- Marketing
- Design
- and more
So we’d also like to hear from you. If there’s something you’ve been looking to get a real answer on that can help you and your business, feel free to ask us. You’d be surprised at the questions we get via email and phone from our clients each week that sometimes are similar between them. We’re hear to help!