Learn Java Script Training from the Best Tutors
Search in
I'd say it can become messy during basic syntax itself (consider you get to work on someone's code where variable names make no sense, e.g. var t = 70932; no sense in this variable at all").
Let's come back to your question when it becomes messy. Considering that by basic syntax you are pointing to essential client-side interaction code (like calling some function on button click, getting and displaying input value tc.). After basic syntax, let's say your application needs to be connected with server to fetch data, at this moment you would jump the primary coding border and dive into all those ajax calls, validating data and rendering it to your UI for end-user consumption. Here you (or anyone for that matter) can make the code messy by:
1. Not commenting what each method is supposed to do (just like "t" variable example I gave above).
2. Writing function definition inside the loop. I've seen this many devs doing especially during "success" event handler where they run through the retrieved data and writing event handler inside the loop.
3. Adding dynamic nodes to DOM. It is another terrible thing you will see where (again) after getting server data, to display it on UI, developers start adding dynamic nodes to DOM (nothing wrong in it) but most of the time they ignore the fact that where these elements are getting attached. Where in DOM hierarchy they are supposed to be, about their sibling's nodes etc. and this ignorance comes back when your data starts appearing awkwardly on UI and dev start debugging CSS (setting position, z-index, margin etc.)
4. Not respective MVC guidelines. I feel that at times, the code becomes complicated because of situations like project escalations, early release, untimely delivery where the developer is forced to do the work in a hurry. That's where developers start ignoring the fact that not writing correct code at right place might backfire eventually (and most of the time it does happen, speaking by experience). Keep your objects, UI and logic separately. It helps a lot!
5. Naming conventions are ignored (most of the time). As project life increases, team size and faces change. Old people get shifted to other projects, or they leave, and new minds take place. A couple of KT (Knowledge Transfer) sessions are never enough to understand every bit of the code, and the only favour a new coder expects from the old one is to get logical naming conventions, be it a file, variable or function.
6. Last but not least, ignoring the power of "strict mode", these two words alone can do what lines and lines of code can't do; it tells you your sin's beforehand.
There are many more factors which cause messy code and practically not all of them can be thought of, but above are the essential parameters which if prevented can help you live quite easy life at your workplace.
I hope this helps!
read lessRelated Questions
What is an Array?
Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com
Ask a QuestionRecommended Articles
Top 6 Skills Required to Become a Web Designer
Here are the top 6 must have skills for every Web Designer : Technical Skills Web designers undoubtedly require very strong technical skills. They must have hands on using Web designing software and tools, such as Adobe Dreamweaver, Fireworks, Photoshop, Flash etc. In addition to the knowledge of design...
Why Should you Become an IT Consultant
Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...
What is Applications Engineering all about?
Applications engineering is a hot trend in the current IT market. An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...
Top 5 Skills Every Software Developer Must have
Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today. In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...
Looking for Java Script Training classes?
Learn from the Best Tutors on UrbanPro
Are you a Tutor or Training Institute?
Join UrbanPro Today to find students near youThe best tutors for Java Script Training Classes are on UrbanPro
The best Tutors for Java Script Training Classes are on UrbanPro