Progressing from a beginner to intermediate developer
Tags: javascript, css, html, webdev
Published: 2021-09-20 08:14:04

<!-- wp:paragraph -->
<p>So, you're not a complete beginner anymore: You've built a few webpages, learned the basics of HTML, CSS and JS, and perhaps you've landed a job as a junior developer.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>What now?</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>There is a hell of a lot of information online about what you should do as a beginner just starting out, but the roadmap becomes less clear once you've got a handle on the basics. It's not for lack of content: there are plenty of guides out there for all skill levels. Rather, the sheer amount of information, tutorials, opinions and technologies makes it impossible to know which route to go down.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Building a strong foundation</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Your route to improvement will generally depend on what you want to do. With that said, you can't go wrong with simply improving your fundamental skills. Let's say you want to eventually be a React developer: Yes, learning React now would certainly get you into the ecosystem faster, but ignoring what React is built on - plain old JavaScript - can limit you in future. If you want to raise the ceiling of your potential skill level, learning the ins and outs of the base language is the way to go. You will end up with more clean, intentional code that you understand completely, and spend less time figuring out why it's not working straight away. Don't feel like you can't experiment with different technologies: Learning SASS, for example, isn't so far off CSS that it can't teach you the basics while also gaining the benefit of a preprocessor. React is still just JavaScript under the hood. You'll get the best results by pushing yourself out of your comfort zone just enough to make sure you're learning at a steady rate, while also making sure you give yourself enough time to soak in all the information.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":389,"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="https://npmrundev.files.wordpress.com/2021/09/pyramid.jpg?w=480" alt="" class="wp-image-389"/><figcaption>Everything is built on core skills</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>If you want to be a frontend at an agency, master basic CSS and fully understand what each line of your CSS is doing. If you're a backend developer, wrap your head around the key concepts and build as much as possible yourself before reaching for a framework. If you'd rather be making frontend apps in the future, get to grips with vanilla JavaScript - ignore jQuery and any flashy framework for now. Of course, feel free to dip your toes - but remember that learning programming is a life's work, and building upwards with a poor foundation will reflect in the quality of your work.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Bear in mind that I'm a frontend, and this advice is generally geared towards other frontends. I don't think everyone should aim to become a full-stack developer; however, I think it's worth everyone having some awareness of the entire ecosystem, as even a little experience will make it easier to work in teams.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Don't take this list as the be-all and end-all to improving: how you improve depends on what you want to do. However, these are some areas that most developers could learn from in some way.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>1. CSS organisation</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>It's not sexy, but poor CSS organisation is the most prevalent cause of headaches in web development.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>How many times have you gone to change a class only to realise it's affected elements across the whole website? Or changed some HTML very slightly, only for the whole component to break?</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Methodologies exist as an attempt to systematically avoid these types of issues. By following a particular syntax when writing CSS classes and following a set of rules, we can filter out most of the common problems and allow ourselves to just focus on building stuff.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Oddly, most of these methodologies aim to make you use less of certain features in CSS. While it's a decent language, most devs know that CSS can be a chaotic language. Even between different methodologies, each has their own rules and situations where they work best.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Being aware of a variety of these methodologies allows you to easy fit into any team easily, but it also gives inspiration for further refining your CSS development. And above all, you'll have less headaches! No methodology is perfect, so sometimes you'll want to adapt your method for a certain project. CSS organisation is far from a 'solved' problem, as the flexibility of the languages allows plenty of room for new approaches.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Utility-first frameworks have become very popular lately, especially amongst React and Vue developers. I've written quite a bit about <a rel="noreferrer noopener" href="https://charliejoel.dev/blog/6-reasons-to-use-tailwind-over-traditional-css" target="_blank">Tailwind CSS</a>, which is just one flavour of the utility-first ideology, but I wouldn't recommend any beginner to jump into a framework such as Tailwind, Bootstrap or anything that packages CSS classes for you until you deeply understand vanilla CSS and SCSS. If you want to give it a go, try to think about <a href="https://charliejoel.dev/blog/how-to-keep-tailwind-dry">how to keep your CSS DRY</a> using these technologies.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>2. Go CSS-only</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Here's a fun exercise: build a functional navigation, with hamburger button and multi-level sliding mobile menu without a single line of JavaScript. It doesn't really matter how it looks, just that it functions as you'd expect a mobile nav to. It's surprising how much use you can squeeze out of plain old CSS for simple things such as toggling a 'class'. You can use sibling selectors <code>~</code> or <code>+</code> alongside <code>checkbox:checked</code> to create toggles and trigger them using a <code>&lt;label&gt;</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>CSS is much more performant than JavaScript, so while you shouldn't go overboard with these hacks it's good to be aware of performance shortcuts like these. In general, even if JavaScript is unavoidable a good rule is to keep it as minimal as possible without affecting functionality. Usually the simpler something is, the less there is that can go wrong with it. A common example is hover states: You COULD use the <code>mouseover</code> event to add a class that makes a dropdown visible, but in most cases there's no need as you could use a nested hover state which would be easier on the user's hardware.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>How about no images? The <code>background</code> property is surprisingly powerful: it can be used to create complex shapes similar to SVG. <a rel="noreferrer noopener" href="https://dev.to/alvaromontoro" target="_blank">Alvaro Montoro</a> even created <a href="https://dev.to/alvaromontoro/homer-simpson-in-css-with-a-single-html-element-4ood" target="_blank" rel="noreferrer noopener">Homer Simpson using just one element.</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>3. Single source of truth</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>In all your programming, you should aim to have a single source of truth for everything. This is the core idea behind DRY - Don't Repeat Yourself - programming. In order to not repeat yourself, you need to define everything only once. This plays out in different ways depending on the context.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In CSS, you want to store all the values that appear time and time again in variables. Colors, fonts, max-widths, even spacing such as padding or margins are all properties that tend to be consistent across an entire project. You can often define variables for a stylesheet based on the brand guidelines, if you have access. Otherwise it's a good idea to go through the site designs and define your variables before starting.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In JavaScript, every function you write should only appear once. If you need to reuse it in a different place, isolate it from the context you're working in by putting it into it's own file. You'll often see a <code>util</code> folder in JavaScript file structures - generally this is where you'll find more generic functions used across the app.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Variables can also be sources of truth. It's a good idea to put global constants - variables that will never change that are used across the app - into their own file for organisation. Some developers name global constants with <code>CAPITALISED_SNAKE_CASE</code> to differentiate them from regular variables.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In a similar vein, get used to using environment variables. These are global constants that change depending on the environment: Say you have a 'development' API for testing and a 'live' API for production - you can define both in separate files, and when the time comes to build your app you can ask it to build for either a 'development' or a 'production' environment. This means you don't need to change a load of variables when releasing an app - super helpful!</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>3. Go vanilla</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Forget jQuery or any other libraries you might normally reach for. Try building your sites using no external packages, just vanilla JS. Feel free to compile your ES6/7 if you need to, but that's it.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>You'll find this difficult at first, but eschewing 3rd-party code forces you to learn how every piece of your application works. Focus on creating reusable utilities for things such as selecting elements, manipulating the DOM, and handling requests.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Development will be slow, but the goal isn't to build things quickly: Rather, you should spend plenty of time on the research to get these things to understand the building blocks of your craft.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":392,"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="https://npmrundev.files.wordpress.com/2021/09/5ng2dq.jpg?w=513" alt="" class="wp-image-392"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Learn string and array methods, how to work with objects, using Promises and so on. Doing daily exercises with a service such as <a rel="noreferrer noopener" href="https://exercism.org/tracks/javascript/exercises" target="_blank">Exercism</a> is a great way to learn each method, but using them in context is what will take you from beginner to expert level. You'll see that there are many ways to skin a cat, and how you choose to solve a particular problem will depend on the situation as well as (to an extend) your personal style. For example, some people prefer to handle promises using <code>.then().catch()</code>, but I would always use <code>async/await</code> as I find the syntax much tidier. There are people who will argue you should use x over y, but it's a good idea to understand every possible way of doing something since you don't know if you'll be dropped into a project with legacy code or if the previous developer just had a different way of doing things.`</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>How about building your own reactive framework? <a rel="noreferrer noopener" href="https://www.youtube.com/watch?v=f2mMOiCSj5c" target="_blank">Watch Tejas Kumar's fantastic talk</a> about creating a rudimentary React clone. You don't need to build it, just try to understand it. You'll find that the technologies you use every day, while undoubtedly complex, aren't so impossible to understand as they first appear.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>4. Manage your own server</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Although DevOps and servers can be scary to a beginner, having a small server to mess around with will help to introduce you without any pressure. Start small and build up: You don't need to learn everything straight away: exposure to concepts and configurations surrounding your server will gradually engrain the knowledge in your head.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Even if you're solely a frontend or aren't interested in running your own websites, understanding things like htaccess, robots.txt and deployment pipelines will make you much more desirable to employers. You will almost definitely need to deploy to a server at some point, so getting the learning in ahead of time will put you a step ahead of the competition. Having a platform to showcase your ideas opens up limitless possibilities, improves your knowledge, and it's just good fun.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>5. Learn regex</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Learning the regex for your language of choice opens up a <a rel="noreferrer noopener" href="https://blog.katherinempeterson.com/practical-applications-for-regex" target="_blank">whole host of opportunities</a> including web scraping, which allows you to use any web page as your data source. It also allows you to write complicated logic for strings, such as validating form content, with much more brevity than when using string functions. Regex is commonly used for verifying the format of strings, for example ensuring a phone number is the correct length or a postcode/zip code is in the right format.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To get you started, here's a quick rundown of a pattern I use constantly in JavaScript (syntax may change depending on language). </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>// replace 'tag' with your html tag of choice
/&lt;tag(.*?)&gt;|&lt;\/tag&gt;/gi</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>You can use <code>(.*?)</code> to create a capture group that will match any content between the string to the left and right of it.</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>() - creates a capture group
.  - matches any single character
*  - matches the previous character infinitely e.g. 'heel'.match(/e*/) = 'ee'
?  - tells * to match the minimum number of times. You might not need this!
|  - 'or' operator</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>This allows you to find all instances of a particular HTML tag, regardless of the attributes assigned to it. This is really helpful for finding and replacing in your IDE, and can be adapted to fit your specific needs.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>You could include another capture group to match the entire element instead of just the tags:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>'&lt;div class="something"&gt;Some content&lt;/div&gt;'.match(/&lt;div(.*?)&gt;(.*?)&lt;\/div&gt;/gi) // matches</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>From here, you can go further and find all tags containing a certain class or attribute, capture the innerHtml of all tags with a certain class, find and replace all instances of a particular class to change it from a link to a button, you get the idea... You can do a lot with regex.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>I recommend MDN's (javascript) <a rel="noreferrer noopener" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Cheatsheet" target="_blank">cheat sheet</a> and regex101's <a rel="noreferrer noopener" href="https://regex101.com/" target="_blank">Regex Tester</a> to get you started.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>6. Don't get stuck in your ways</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The most important thing to remember to stay competitive as a developer, is that the industry is constantly changing. There are new ideas and technologies appearing every day. Although you shouldn't be distracted by these new things, as they come just as often as they go, it's good to have some awareness of what your industry is using so you don't fall too far behind. </p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":391,"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="https://npmrundev.files.wordpress.com/2021/09/19fq7c002w021.png?w=1017" alt="" class="wp-image-391"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>It's also important to accept that even if you believe in a certain way of doing something, there might be something that comes along to solve your problem even more effectively. It's good to have opinions, but many developers fall into the trap of believing that <em>their</em> way is the best way. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Programming is far from cut-and-dry: Everything has it's upsides and downsides. Every project has it's own needs, and the same technology or approach isn't always best for all of them.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>7. Be business-aware</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>We all love to code, but at the end of the day most of us do this to pay the bills. We're (aside from freelancers and hobbyists) employed by businesses with clients, deadlines and budgets, and our performance in delivering projects is what reflects us more than the quality of our code - although high-quality code will generally make delivery go much smoother. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Becoming a mid-level or even senior developer is as much about what you know as it is about the responsibility you can take on and your commitment to delivering the best you reasonably can in the time you're given. If you create the best damn website the world has ever seen, but it's a month late, it won't reflect on you well. Sometimes you will need to find shortcuts or outright cut things out of a project: At the end of the day, your company only has a limited budget they can spend before they start to make a loss.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Senior developers are paid what they're paid because they're reliable. Yes, they can solve problems faster and know a hell of a lot, but they will also do what it takes to deliver a project on time. They understand which technologies and approaches will fit the needs of a project without being overkill, taking too much time or requiring too much custom code.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This isn't the most exciting or inspiring part of being a developer, but it's what the people who pay you will notice more than how efficient a function you wrote is.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>8. Be patient, and practise often</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>I'm a big fan of the phrase, "you don't know what you don't know". Progamming is a long game: it takes years to become a truly competent developer, and the more you know the more you realise you <em>don't</em> know very much at all. Have humility, and just keep on building things. Push yourself further each time, try new things and refine your techniques. Forget about the destination and focus on the journey.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Eventually you will have some idea, or you'll start a project, and notice how much better you code is without even needing to think about it. You'll have the knowledge engrained into your head enough that problem solving becomes trivial, and you can use the freed-up brain power to tackle even greater problems. Be persistent but patient, and you will become a great developer right under your own nose.</p>
<!-- /wp:paragraph -->