There is a lot to learn related to web development while surfing the web, but there are a few common mistakes that you should not make while you integrate HTML, CSS, and a dynamic language like PHP.  I’m choosing this topic because there are number of famous writers/authors and coders who have tons of knowledge and written about almost everything that they have learnt throughout their professional careers.  But Emma Edgar motivated me to write something from my own experience and just to give it few minutes of my time, but as it is going to be my first ever blog post in last five years it took me a day to think about “What should I write?”.  

As per my experience, most of the programmers around the world have a sound knowledge of programming fundamentals, HTML and CSS. But still I noticed most make silly mistakes while writing code. There are so many reasons for these silly mistakes, the ones I have noticed are:

 

  • Lack of co-ordination and understanding between team members.
  • Lack of proper knowledge about the CMS that they are working on.
  • Lack in understanding of coding.
  • Lack of differentiation between dynamic and static HTML Elements, ids, classes.
  • Lack of conditional statements where they are actually required.

It is our common practices that we use to code day by day. To improve on these, we need a proper understanding of coding standards including where to put conditional statements and what are the various elements and classes that we can use to assign styles in CSS.  But most important is when you are working in a team, you should co-ordinate properly to understand and to make other team members understand that what is/was the requirement to make the particular changes.

Here are some common mistakes most of the UI Developers and Functionality Developers make when writing code:

  • Mistakes in putting conditional statements:
    <div>
    <?php if() {
    // Code
    } ?>
    </div>
    While it should be like mentioned below so the div should not appear while condition is false:
    <?php  if() {
    <div>
    // Code
    </div>
    } ?>
  • Should be more careful about writing CSS for classes and ids – If you are working on a project using some sort of CMS (Content Management System) like: WordPress, Joomla, PrestaShop etc. you must be careful about the styling work. You must be aware of which are the common classes or ids you can use that are not coming randomly by any scripting language/programming code. Also, use common classes to apply similar styles to number of blocks.  For example: A “widget” class for several widgets in the sidebar. This will also reduce the work and save a lot of time writing styles for different classes.
  • The most common problem I have seen among most of the Web Developers and UI Developers around the world is overwriting code written by other developers while working with a team. Someone always forgets to take latest code from the server or forgets to ask from team members if anyone updated anything.  This causes developers to have to rewrite all the modules, which causes delay in project delivery.
    To overcome these problems there are number of premium and open source solutions called Subversion Management systems available.
    For Example: SVN, GIT etc. helps in maintaining different versions of the development process, where anytime anyone can have it rolled back to previous version of the project.

Please write a comment bellow if you found this helpful or if you have any advice or suggestions.

Thank you!

One thought on “Mistakes You Shouldn’t Make While Writing Code

Comments are closed.