When you’re starting to learn programming, you’re usually flooded with new information. Regardless on which are you’re trying to get into. In this post, I won’t give you yet another todo-list on which topics you should cover on your journey to become a software developer — instead, I’m going to pick a few of the most common mistakes people make, and explain how you won’t make them yourself. Of course, this list is nowhere near complete, but in my opinion, it will offer you some resources for an easier introduction in several topics. You’re trying to become a programmer, but not a web dev? Keep on reading — I’m sure you can benefit from some of the topics as well!
No Mobile-First Approach
When you’re starting to build website, you might be tempted to focus your design to the device you’re developing on — your PC or Notebook. But keep in mind — a huge amount of users are browsing the web on mobile devices. Don’t force them to view your website in a scaled down layout that is meant for your personal 24" screen. Incorporate an approach to support multiple screen sizes from the get go. If you’re new to the topic, try a CSS-Framework like bootstrap and find out, how their implementation is done (Hint: Google for media queries and css breakpoints). Understanding these will help you a lot to understand how responsive webdesign is done, and it will save you a lot of work compared to implementing it later.
Choose a design and a structure that you can stick to. For example, build a basic layout that you can reuse on all of your sited. This could contain a header and a footer, as well as a sidebar or hamburger menu for mobile devices. The space in between can then be filled with page-specific content. This will help your users to focus on the main content of the site and not get confused by irrelevant stuff like navigation. The same goes for the style itself — choose a few colors and fonts that you reuse over the site. Oh, and don’t use Comic Sans.
Every HTML-Tag has its purpose. Make use of it! Don’t style buttons as links just because you can, they’re meant to perform actions on the current page. The same goes the other way around. Also, don’t use divs for everything — Of course, they”re handy and useful, but the semantic elements really help any users using screen readers or things like search engines to understand the structure of your website.
Ignore Naming Conventions & Web Standards
Always using the latest Tech
Only using “old” Tech
Relying on Frameworks
A lot of tutorials on several topics start like this: “Install Bootstrap and jQuery, and also these 517 node modules” just to build a Hello-World-App. While these are generally useful when you’re trying to learn a specific framework, try to keep it simple when learning the basics. Stick to vanilla JS and CSS. As soon as you got the basics of these, you can step up to integrating stuff like JS-frameworks or preprocessors. In the end, they’re built to help you on implementing features, not to confuse you and overload your learning-stack.
Writing Code that should work
“I’ve tested that, it works on my machine.” — You probably heard that before, even if you’re not in the industry for too long. Always test your code on multiple browsers — make sure you know what kind of clients you’ll need to support and try to think of edge cases your app should handle. Errorhandling is a complex topic and you will get better at it, but at least trying to think of how you could break your own app is a great first step on preventing other people from actually doing it.
Not thinking about performance
Application performance is a big deal, especially when writing web applications. Your website is loading fast on your computer? That’s great! But probably, all the resources are on your machine too, right? I wonder if it will be the same speed on some guys smartphone in the middle of nowhere. There are a lot of small things you can work on, that in total will have a big impact. The biggest ones might be choosing the scale and format of assets (images, fonts, …), and minifiers for live-pages (ok, I said you shouldn’t overcomplicate your learning with frameworks, but keep this in mind for later!).
As you’re learning to code, you probably get told to comment your code. That’s alright — but use it thoughtfully. You don’t need to comment every line of your app. Instead, try to write your code in a way that you’ll be able to understand if you read it a week later. Of course, sometimes you’ll have some places commenting makes perfect sense, and there’s nothing wrong in doing so. But, as I said, don’t comment too much. The best way to find a good balance is to comment as little as possible, but as much as required.
Originally published at https://coding.mjurtz.com on February 25, 2021.