8 Things I Wish I'd Known When I Started as a Web Developer

Originally published at: http://www.sitepoint.com/8-things-wish-id-known-started-developer/

I have been in web development for more than five years and it’s been quite a journey — trying out different technologies and experimenting with different styles. I’ve been successful at times, but I’ve also had my fair share of disappointment. In this post, I’m going to talk about certain realizations I’ve had over the course of my life as a web developer, with the hope you can learn from my mistakes.

1. Write Clean Code

Source: funny-memes.org

The first thing you realize when you start making large applications is that a huge amount of time is required for debugging. Often, you’ll spend more time debugging than writing new code.

In such a situation, it’s highly important you write properly indented and commented code, which adheres to best practices. Imagine you have hundreds of lines of code, and you have no idea what’s causing a small bug. What’s worse is that if you write unreadable code, you’ll probably fail to understand what each snippet does after some time. Are you sure you want to go down that path?

2. Language first, framework later

Source: Giphy

Source: Giphy

People often first learn the tricks of a framework, and then move on to the language. That’s actually not the right way to go.

The popularity of Django can be attributed to the strengths of Python — so it’s important that you get comfortable with Python before trying out Django and not the other way round.

The simple reason here is that if you know about the underlying language, it helps you understand how the framework works. If you have no idea about the traits of a language, there is no way you will understand why something is done a certain way in the framework.

Continue reading this article on SitePoint
8 Likes

I’m guilty of a lot of those points as well, especially number 5’s: Jack of all trades, Master of none. When I first started out, I wanted to learn it all and I wanted to learn it all right that instant. I made the mistake of trying to learn too much at once and ended up slowing myself down and even becoming overwhelmed.

A ninth point that others might find useful is to beware of snippets written by others. I’ve often found myself stuck during the coding process and used to run off to find a snippet that someone else has written to do what I need. Implementing other people’s code does work, and it’s not a bad thing to do, but make sure that you understand what it’s doing and how it works before you forget it. Much like you mentioned in your first point, at a bare minimum, leave a comment with a link to the page where you got the code to remind you what the code does (and also give credit where it’s due).

I wish I had learned version control as soon as I was starting to write code. This could have saved me hours of headaches caused by accidentally deleted code. I had to rely on multiple copies of the same project on my PC.

1 Like

I’ll have to disagree with number 3, even so I learned Javascript before jQuery. I see where you are coming from here “learn the foundation and then move to a library”. If one learns jQuery, they will be saving a lot of time - and if one learn it and see it as a language, not as just a library, I’m sure they will be able to move to Javascript. Another point: when was the last time you used vanilla JS? I might be wrong, but I guess less and less people are using it.

Yes, that is true! That habit can get you in trouble later.

Happens to most people. In fact, when I first started using revision control, I was really skeptical.

I believe learning jQuery definitely gets your work done quickly, but once you know some jQuery (and no JS) you would want to include those files in every page that you create! (And on a lighter note, people would ask these kinds of questions - https://www.quora.com/Will-jQuery-work-if-JavaScript-is-disabled)

5 Likes

(And on a lighter note, people would ask these kinds of questions - https://www.quora.com/Will-jQuery-work-if-JavaScript-is-disabled2)

Oh man. That is brutal.

I definitely disagree with you - learning JQuery once you know JavaScript is trivial - a significant fraction of JQuery questions are asked by people who didn’t learn JavaScript first where the answer to their question is one or two lines of native JavaScript. Learning JavaScript after you know JQuery is not much different from if you didn’t already know JQuery and so you will spend time to learn it as if it were another completely new language.

I created a site with examples of JavaScript and JQuery code - the several hundred JavaScript examples come first followed by 15 examples that cover JQuery completely - simply because most of the JQuery commands refer back to the JavaScript example that does the same thing and so whole groups of JQuery commands that are used the same way can be dealt with in a single example since the JavaScript page already covers everything else about what each JQuery command does.

Of course there are lots of JavaScript pages that the JQuery doersn’t link to because there are lots of things that you can do with JavaScript where JQuery doesn’t help at all (such as being able to send information to the server where you don’t need a response back - which only requires 2 lines of JavaScript and where the shortest JQuery code to do the same is about 10 times longer - not counting the JQuery library).

5 Likes

lol #1 was funny to me. Thats so me. exactly lol

Okay all good points but I want to add a beginners caveat, especially with regards to 2 & 3. Some times it is good to do things the wrong way just to get them done. Nothing stops the enthusiasm of being a beginner more that trying to do things perfect. There is so much to learn in web development that I would advise beginners to take the short cuts, like jQuery, at first so they can get their projects out the door. Once you have a few projects completed you then have the confidence to go back and do them right (i.e. start learning how jQuery works by learning javaScript). Also don’t forget how important being able to make mistakes is in the learning process.

Most importantly don’t forget we all have to ask questions when we are learning. The only stupid questions are the ones not asked.

The best thing about jQuery is not that it’s less code to do something, but that you can expect the code to work just fine on IE6. jQuery takes all quirks and bugs in to account and makes your life more simple. This is only true if you need support för old IE though. I’m not using jQuery for new projects anymore.

1 Like

If you learn JavaScript properly then you will very quickly have your own library of code that fixes all of those quirks and can just use the ones you need. Plus once you know JavaScript a few seconds more and you will know jQuery as well - saving about 3/8 of the learning time to learn both.

The way many people use jQuery it is like placing your house into your hand luggage to go on a short trip rather than just taking what you need.

Also there are now two versions of JQuery - one that is huge and provides patches for every imaginable IE6 browser quirk - and one that provides the same functionality for modern browsers that is a small fraction of the size and becoming smaller all the time now that most JQuery commands are being adopted into JavaScript itself. The main purpose of JQuery wasn’t to fix the quirks, it was to add commands that the author considered should be in JavaScript and so JQuery itself should disappear within the next few years as what JQuery commands are not in ES6 (due for release in March) will be in ES7. Within 5 years JavaScript will still be around and JQuery will be the history of some of the commands (not implemented using the exact same command but doing the exact same thing).

1 Like

I’m totally agree with point 2 and 3. So much people who learn how to use Codeigniter and jQuery rather than how to use PHP and Javascipt

Thanks Shaumik Daityari, great article!
always is good to know tips and best practices from others to improve skills and abilities for coding.

I would suggest to focus in what really matters (project goals) customer does not even care how you do it, they want it, and they wanted for “yesterday” :frowning:

#1: Getting outsourced work that looks clean on the outside, but…

http://www.gifday.com/wp-content/uploads/2012/01/kcmp2f.gif

Another thing I wish I knew was when to say no.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.