2012 is a new year and for many, a fresh start. I see 2012 as an opportunity to do something new, start fresh on other items and a chance to turn a new leaf. Often, your colleagues, bosses and friends whom known you for a long time and will not allow you to turn a new leaf; Do it anyways! Push forward in making yourself a better person this year. Do not let others hold you back. This is your chance to rid yourself of bad habits, learn something new, implement new ideas and grow as a person. Continue reading New Year – Fresh Start
Websites Responsive to Screen Size
I own a desktop, laptop, iPad and an HTC Android phone. Each device has a different screen size. I had never tried my website on the iPad and the Android phone until after the DIG 2011 conference in London Ontario. Jeffery Zeldman and Derek Featherstone spoke on the importance of having your website visible on multiple devices and this struck home to me. Continue reading Websites Responsive to Screen Size
Driving to Your Goals
Monday night at London Western Toastmasters, I gave a speech about getting the momentum going. It was geared to getting used to speaking, getting in front of the club and practicing. I had equated it to driving a 5 speed transmission car. When we start looking at our goal, we are stuck in neutral. Continue reading Driving to Your Goals
DIG London in Review
Wow, what a great day to be had.
I had attended the web developer stream of DIG London which started off with a Keynote by Jeffery Zeldman. Jeffery had shown us the importance of responsive design and suggested a few ways to look at it. Continue reading DIG London in Review
Be Kind to Those You Meet
You never know when you meet someone what they will be to you in your life. You may meet them in a service club, be a customer of yours, be a friend or an in-law. You just never know when that argument with the sales associate be something that bites you down the road. Continue reading Be Kind to Those You Meet
My Cover Letter
Dear Business Owners, Team Leaders and Information Officers;
I am not just a developer. I am a developer who can blend in with a team, lead a team and be part of a team. Continue reading My Cover Letter
How I Achieved Decent Search Ranking
I recently showed my hit stats for my website to a friend, which include the GOOGLE and Yahoo queries. I was asked how I achieved my ranking. I typically see a rank between 3 and 20, which I consider respectable. Most of my ranking is under 10, which is really good. I am actually surprised how people find me as it can be a very obscure search.
Could it be better? Probably, but this seems to work for me
Example ( real rankings 11/03/2011 ):
Ranking 22: www.google.co.uk — c#/ .net blogs in london + cv
Ranking 02: www.google.ca — software developer london ontario
Ranking 05: www.google.com — how to use equalsignorecase in javascript
Ranking 01: wwww.google.lv — excel interop in web service
Ranking 14: www.google.ca — london ontario computer programmer
Here is how:
1. Fresh Content ( Blog, Twitter Feed, Other Dynamic Content )
2. Have description and keyword meta tags relevant to your content on the page ( Each Page should be unique )
3. Put title attributes on links / menu items
4. Put alt attributes on images describing the image
5. Have unique titles on each page
6. Do not use tables to structure your web page
7. Use H1 and H2 tags for page and paragraph titles
8. Optimize your webpage and images for speed.
9. Have a site map ( link page ) outlining links to your content
10. Use GOOGLE’s and Yahoo’s webmaster tools for site maps and analytics
11. Use and understand GOOGLE Analytics tool
12. Have other sites link back to you that our relevant to your site.
13. Use Twitter, LinkedIn and Facebook to promote your fresh content.
Code Reviews
Developers often seem scared to allow another person to look at their code. It is like they have a fear of someone stealing what they had done or that someone is looking over their shoulder. Software developers and web developers often hold tight to their projects. In almost every business work is proof read or reviewed. It is not because a lack of trust, but rather many eyes will catch mistakes.
Why do we do code reviews?
The reason for code reviews may be obvious, but since the resistance it needs to be mentioned. Code reviews are primarily to catch logic mistakes, missing business rules and team coding standards.
When a developer is so close to a project and looks at the same code for days, weeks or months, it is easy to invert logical expressions or entirely miss basic variable checks. Assuming both purposely and by accident that routines return the perfect values is often the biggest mistake and we are suddenly surprised when a NULL value sneaks in.
Often when we start a project we are handed pages and pages of business rules and requirements. It is very easy to miss the small things and even the big things. As easily it is to cross items off a list, it is just as easy to entirely miss one. It is very viable to have a second set of eyes to review what we had just written. Better to catch mistakes before the customer does.
Lastly team coding standards; they are standards that either the team lead or the team together decided they would follow. These standards are to ensure that the team writes the code in the same structure and using the same variable naming convention. Having coding standards allows the team to work together and have the ability to read each other’s code. It allows quick debug and editing by any team member. Without these standards projects would be a wild wild west and would differ from team member to team member.
Types of Code Reviews
- Team Code Reviews – Team members together would focus on a method or a group of methods. The team together would offer suggestions and ideas to enhance the code for which they are reviewing. It is not a time to rip the developer apart, but to offer constructive suggestions. If a developer gets out of line, that person should be asked to leave the room. A projector should be used if available; otherwise printing off the code or have each developer view it on their laptops are adequate methods as well. The team lead should take a leadership role in this method guiding conversation and making notes to send out after the meeting.
- Colleague Code Reviews – These reviews should be done by a senior or a team lead person. The senior can be greater or equal in experience. Same as a team review, everything should be done in a constructive manner. If a senior developer is doing the review; the senior should be assigned by the team lead to prevent a biased review. When the review is complete – the review should be covered in person with all developers involved.
Tips for the Reviewer
- Ask questions, do not make statements
- Do not be too critical, remember to praise
- Be sure you have your company coding standards available as a reference
- Keep the review on the code and not the coder. Do not make it personal
- Keep in mind that there is more than one way to do something
Tips for the Developer
- Remember, you wrote the code, but the code is not you.
- Make a check list of things that are often found in the code reviews
- Be involved in the maintenance of the coding standards
- Always do your best and do not look for short cuts
Building a C-Sharp Class
I have created this example of a C# class to demonstrate one way of creating a basic class cbject representing one employee. This class could be used as a starting point for just about any object.
Take note that there are no business rules in this example. It is of my opinion that you create a basic object first and create a business class second which extends the basic object. In the business class you may put an EmployeeNumber generator, MaxLength controls on the fields, Phone number validation and other rules that may apply based on your business practices. A business class will be demonstrated in a later blog.
You may also want to create a collection class. A collection class or a manager class would manage a collection of objects with Add, Remove, Select, Sort type functions. This too will be demonstrated in a later blog.
/// <summary> /// Class Object Representing Employee /// </summary> public class Employee : Dictionary<String, Object>, IEmployee { // ***********************| Properties |*********************** /// <summary> /// Employee Number /// </summary> public String EmployeeNumber { get { return (String)this[GetName()]; } set { this[GetName()] = value; } } /// <summary> /// Employee's First Name /// </summary> public String FirstName { get { return (String)this[GetName()]; } set { this[GetName()] = value; } } /// <summary> /// Employee's Last Name /// </summary> public String LastName { get { return (String)this[GetName()]; } set { this[GetName()] = value; } } /// <summary> /// Employee's Address Line 1 /// </summary> public String Address1 { get { return (String)this[GetName()]; } set { this[GetName()] = value; } } /// <summary> /// Employee's Address Line 2 /// </summary> public String Address2 { get { return (String)this[GetName()]; } set { this[GetName()] = value; } } /// <summary> /// Employee's City /// </summary> public String City { get { return (String)this[GetName()]; } set { this[GetName()] = value; } } /// <summary> /// Employee's Province / State /// </summary> public String Province { get { return (String)this[GetName()]; } set { this[GetName()] = value; } } /// <summary> /// Employee's Country /// </summary> public String Country { get { return (String)this[GetName()]; } set { this[GetName()] = value; } } /// <summary> /// Employee's ZIP / Postal Code /// </summary> public String ZipPostal { get { return (String)this[GetName()]; } set { this[GetName()] = value; } } /// <summary> /// Employee's Home Phone Number /// </summary> public String HomePhoneNumber { get { return (String)this[GetName()]; } set { this[GetName()] = value; } } /// <summary> /// Employee's Cell Phone Number /// </summary> public String CellPhoneNumber { get { return (String)this[GetName()]; } set { this[GetName()] = value; } } /// <summary> /// Employee's Full Name ( ReadOnly ) /// </summary> public String FullName { get { return String.Format("{0}, {1}", FirstName, LastName); } } /// <summary> /// Employee's Start Date /// </summary> public DateTime StartDate { get { return (DateTime)this[GetName()]; } set { this[GetName()] = value; } } /// <summary> /// Employee's TerminationDate ( Nullable ) /// </summary> public DateTime? TerminationDate { get { return (DateTime?)this[GetName()]; } set { this[GetName()] = value; } } // ***********************| Constructor(s) |*********************** /// <summary> /// Constructor /// </summary> public Employee() { Initialize(); } /// <summary> /// Employee /// </summary> /// <param name="employeeNumber">Initial Employee Number</param> public Employee(String employeeNumber) { Initialize(); EmployeeNumber = employeeNumber; } // ***********************| Methods |*********************** /// <summary> /// Initialize the Class /// </summary> private void Initialize() { EmployeeNumber = ""; FirstName = ""; LastName = ""; Address1 = ""; Address2 = ""; City = ""; Province = ""; Country = ""; ZipPostal = ""; HomePhoneNumber = ""; CellPhoneNumber = ""; } /// <summary> /// Get Method Name /// </summary> /// <returns>First and Last Name</returns> public String GetName() { StackTrace stackTrace = new StackTrace(); StackFrame stackFrame = stackTrace.GetFrame(1); MethodBase methodBase = stackFrame.GetMethod(); return methodBase.Name.Replace("set_", "").Replace("get_", ""); } /// <summary> /// Re-initializes the Class /// </summary> public void Reset() { this.Clear(); Initialize(); } }
Failure
Failure is an opportunity to find an alternate way of finding success.
Dig deep, learn from the events and change.
Through change, you can overcome failure.
Change brings failure or success; it is a 50% wager.
Evolve, learn and morph with every failed attempt and eventually you will find success.