10 Most Common Coding Mistakes
So through research, experience, and recent observations, I thought I would share a list I compiled of ten common coding mistakes I see web developers make—and how it impacts you.
Writing Old-School HTML
As our first common coding mistakes, lets tackle Writing old-school HTML. The early days of the internet offered much fewer options for markup than we have today. However, old habits die hard, and many people write their HTML as if we were still in the 20th century. Examples here are using <table> elements for layout, <span> or <div> elements when other semantic-specific tags would be more appropriate, or using tags that are not supported in current HTML standard, such as <center> or <font>, or spacing items on a page with a large number of ( ) entities.
Impact: Writing the last decade’s HTML can result in over-complicated markup that will behave inconsistently across multiple browsers. And it’s not necessary in more recent modern browsers like Microsoft Edge and even past versions of Internet Explorer (11, 10, 9).
“It Works in My Browser…”
A developer may be fond of a particular browser or really despise one, and may primarily test web pages with that bias in view. It is also possible that code samples found online may be written without factoring how it would render in other browsers. Also, some browsers have different default values for styles.
Impact: Writing a browser-centric site will likely result in very poor quality when displayed in other browsers.
Bad Form, an other one of common coding mistakes
Prompting a user to provide any information (especially when entered into a text field) and assuming the data will be received as intended.
Impact: Many things can (and likely will) go wrong when user entry is trusted. Pages may fail if required data is not provided, or data received is not compatible with an underlying data scheme. Even more serious is the intentional violation of the site’s database, perhaps through Injection attacks
Impact: The time to have a page completely render becomes long enough for some users to give up or even impatiently re-request the whole page again. In some cases, errors will occur if page processing is taking too long.
Creating Code That Should Work
Impact: Sites without proper error checking may reveal the errors to the end users in an ugly way. Not only can the user experience be dramatically impacted, but also the type of error message content could provide clues to a hacker as to how to infiltrate a site.
Writing Forking Code
With the noble notion of supporting all browsers and versions, a developer creates code to respond to each possible scenario. The code becomes a heap of if statements, forking in all sorts of directions.
Impact: As new versions of browsers update, management of code files becomes bulky and difficult to manage. And as mentioned in #1, it’s increasingly unnecessary.
Unresponsive Web Design
This is one of the worst coding mistakes. Site development assumes viewing in the same size monitor as the developer/designer.
Impact: When viewing the site on mobile devices or very large screens, the user experience suffers with either not being able to see important aspects of the page or even preventing navigation to other pages.
Making Meaningless Pages
Producing public-facing pages with content that might be very useful, but doesn’t provide any hints to search engines. Accessibility features are not implemented.
Impact: Pages are not as discover-able through search engines, and therefore may receive little or no visits. The page content may be very cryptic to users with impaired vision.
Producing Sites That Are Too Refreshing
Creating a site that requires full refreshes of a page for each interaction.
Impact: Similar to bloated pages (see mistake #4), performance of page loading time is affected. The user experience lacks fluidity, and each interaction could cause a brief (or long) resetting of the page.
Working Too Much, one of the common coding mistakes
A developer spends a long time creating web content. Time might be spent doing repetitive tasks, or simply typing a lot.
Impact: Time for initial website launch or subsequent updates is too lengthy. Value of the developer diminishes when it appears other developers are doing comparable work in less time and with less effort. Manual labor is prone to mistakes, and troubleshooting mistakes takes even more time.
By identifying common mistakes, web developers can eliminate much frustration that others have already endured. Not only is it important to acknowledge, but when we understand the impact of a mistake and take measures to avoid it, we can create a development process catered to our preferences—and do so with confidence!
Web development is an extremely broad term that can legitimately encompass development of a website, web service, or complex web application.
The main takeaway of this web development guide is the reminder that you should always be careful about authentication and authorization, plan for scalability, and never hastily assume anything – or be ready to deal with a long list of web development problems!