Home Software And Technology 6 Things You’ll Need When Learning To Code

6 Things You’ll Need When Learning To Code

by wforbes
6 Things You'll Need When Learning To Code - title image

Here’s a list of concepts that can be helpful when you’re getting started with code. Some of these are ‘no-brainers’ that many of you will scroll right past. Others may be things you may not have considered initially. In all the time I’ve been a programmer, I haven’t seen a lot of this information explained elsewhere. I really hope it helps. Give this article a glance and if you find it interesting, please give it a ‘Like’ with the heart button or leave a comment at the bottom! Let’s get started.



1. You’ll want a computer with a keyboard

I know, I know… it might feel too obvious for some, but so many younger whipper-snappers nowadays exclusively rely on their smart-phones. They may not even have reliable access to a full computer system anymore. No offense if you’re a teenager or in your 20’s! Your age is perfect to get started with coding. I’ve just seen first-hand that “Generation Z” people prefer using their phones over computers 9 times out of 10. Even though writing code with a smartphone is very possible with the right apps, it’s definitely NOT ideal. I highly recommend that you start programming on a desktop, or laptop computer.

Why? Full physical keyboards are really important when programming! Building an accurate and fast typing speed is a huge plus when you code. Typing on a touchscreen with your thumbs, or on a tablet’s screen with your fingers, is much more difficult than using a regular traditional keyboard with keys on it. Even the keyboards you can attach to a tablet can have a poor response and accuracy; this can mean it might miss characters that you intended to type … leading to bugs and problems in your code!

With time you’ll start to find little tricks that can help you move around a source code file that are only possible on a keyboard. Doing this will save time by avoiding using the mouse or track pad. Here are some that I use every single day:

  • Holding CTRL and pressing the left/right arrow keys will move the cursor skipping words instead of spaces.
  • Holding CTRL+Shift with the arrow keys will more quickly select entire words or phrases.
  • Pressing the Home or End key will jump the cursor to the beginning or end of a line, holding Shift with them will select the entire line.
  • The Page Up and Page Down keys will jump the cursor up or down an entire screen height, holding Shift with them will select all the code within the screen height.
  • Holding CTRL with Home, End, Page Up, or Page Down can bring you to the first or last line of the entire file

There are many keyboard shortcuts like this, see if you can discover more of them with some research!

Bottom line: You’re going to want a system with a full physical QWERTY keyboard that has a layout with the Home, End, Insert, Delete, Page Up, and Page Down keys. The 10-key number keys come in handy too! ( This is my personal favorite for a cheap solid keyboard: Corsair K55!

Why else? Smartphones, tablets, and Chromebooks don’t always support the best apps for editing code. The computer you use to write code should be running a fully-featured operating system like Windows, Mac OS, or Linux. This may change over time while companies get more hip to offering versions of their code editor apps for portable devices, and offering solutions that run in the cloud. For instance, this article “So you want to develop on a Chromebook” details your options there.

Bottom line: The safest bet to ensure your set-up matches all the resources and examples you’ll see on your path, is to go with a fully-featured Desktop or Laptop computer.

Don’t worry, though! It doesn’t necessarily have to be an extremely fast computer, and it doesn’t have to be a brand new computer either! I’m not asking you to break the bank with some expensive gear. You’ll be safe using a minimal computer to start with that was manufactured in the last 5-7 years. So what do I mean exactly? Let’s take a look at a simple example.

As of today (March 2021), computers like this one are sold as refurbished on Amazon for under $300. This has everything you need to get started with some added benefits:

A modestly priced computer with the right specs is all you to get started. A system like this should last you years!

Main specs to look for:

  • i5 (or better), Quad-Core Processor: During your shopping, you may see PCs with i3 processors, dual-core processors, or processors with less than 2ghz speed. These systems aren’t always ideal because some of the tasks you do while programming may load a lot slower.
  • 8GB RAM or more: While computers are still often sold with 4GB RAM, make sure that you find one with at least 8GB. This will allow you to have quite a few apps open and not have to deal with lag or unresponsive window issues.

This is what I recommend as a minimum for anyone – even non-programmers. Depending on the type of programming you do, like for video games or large data sets.. you may want to look for something more powerful. Creating 3D models for video games will benefit from a higher-end graphics card, for instance. To give you an idea, my two personal computers have an i7 and Ryzen 3600 processor; as well as 16GB and 32GB of RAM respectively. With those specs, I know that my computers can handle anything I need reliably and handle it quickly! Time is money!

The main things to remember: a full traditional keyboard is important; a full operating system like Windows, MacOs, or Linux is important; and using a system with at least an i5 and 8GB of RAM is really helpful.



2. You’ll want to know the basics of computers

Can you describe how the internet works at a basic level? What’s HTTPS stand for and what does it do? Do you know how to change the settings in your operating system? What’s the system registry in Windows and what does it do? What are all the major parts of a computer? What’s the CPU’s register and how is it different than the cache?

Wait a second, I thought this article was talking about coding… so why should those things matter? Well they might not matter a whole lot depending on who you talk to, what your goals are, and what type of programming you’d like to get in to. However, you won’t be doing yourself or anyone else any favors later on if you don’t have some basic computer knowledge to start off with. Let me explain with the best-case scenario of starting to code without knowing the basics of computing.

At first, you could try to dive right in to coding without knowing any of those things and you won’t have any immediate problems if you stick with it. Learning as you go you may spend a couple extra hours here or there trying to figure out something you don’t understand. It won’t be a big deal at first because you’re making progress toward learning to code and you probably won’t hit any huge roadblocks on your way.

You’ll make your first few rudimentary programs and, with enough effort, you’ll start moving into more difficult concepts or start using a code editor with more features to get the job done. As you move through tutorials and videos on your learning path you’ll start seeing more terms and being instructed to do more things that you’ve never heard of and you may not have any clue about. You’ll get the jist of what’s going on but only enough to accomplish the main goal – Get the code to work!

Soon you may need to spend a whole day worth of time, now and then, to figure out what the heck is going on, and since you didn’t fully understand the more simple concepts on a given topic.. you may end up getting the wrong idea or never really understand what you’re doing. But it may not happen all the time, and after a while you’ll make progress with the types of apps and programs you can code, so what’s the big deal? Well, you can definitely learn most of the basics by inference and good ol’ fashioned “figuring it out”… but a year down the line – what’s the result?

Let’s consider a few different compounding problems you might end up with.

You may not know as much as you think you do. Don’t worry – That’s the case for most people, to an extent. But as a programmer every large gap in your knowledge may come back to bite you hard. You’ll look at the fact that you can create a website or nifty app, you’ll realize that you’ve finished most of the tutorials you could find, and you’ll see the tons of hours you spent learning and practicing.. so you’ll go start to look for a job – Great! More power to you. You may even get hired. But on your first day when you’re asked to do anything outside of what your programming tutorials showed you or what you’ve been able to figure out… you’ll start realizing there’s a problem.

You may not be able to keep on just figuring things out on the fly. Although it wasn’t an issue to take a few hours to figure something out when you were on your own, now it can really be a pain when you’re eating into company time in your first programming job. Where your tutorials guided you through making simple sites and apps, now you’re working on a huge enterprise-sized projects with other people. So not only do you have to figure out their tools and workflow, you’ve also got to figure out using totally new things you’ve never heard of like code repositories, issue tracking software, and maybe some unit-testing library that’s run from the command line. That’s not to mention that you’ll rarely be working on something from the ground up, so you have to learn how to fix and add small portions of code in a large, messy, older program or site effectively. That’s A LOT to learn.

You might not be as good as you could have been if you learned the basics first. Closing the large gaps in your knowledge early on will save you tons of time as you learn to code. The more difficult and complex things get as you get further on your coding journey, the more time will be saved by starting with a good foundation. Learning a new tool or workflow won’t be as big of a problem because you’ll see the basics of what the tool does or why the workflow is set up the way it is. Learning to use a code repository or a software you’ve never heard of won’t be so bad because you’ll have more insight into the core of what those things are meant to solve. I would say one year of learning to code with a solid foundation is worth three years without one. If it only takes a few months to get that foundation and learn some basics first, it sounds like a good use of time in the long run.

With all that being said, there’s no one single way to fill those gaps in your knowledge without some review of what you probably already know. If you’re using the internet to read this website and if you’ve been using a computer or a smartphone to do various things for any amount of time, you already know a thing or two.

Most community colleges offer an Introduction to Technology (or Computers) course, and I’d recommend going for one of those. If you’re learning from home and can’t take a college class, you’ll find videos on YouTube that can help. For instance, you can watch ‘Introduction to Computer Science I’ lectures from Harvard – here’s a link I found to a list of those videos. If that link doesn’t work by the time you read this, try searching for it!

Along with reading through a used textbook like this one (only ~$25), you’ll be able to cover most of the basic concepts you’ll need to get your foundational knowledge handled.

It may seem like a waste of time and it may feel like reviewing things you already know, but wedged in there … somewhere in the details, I promise there’s something new. It may not be super exciting or interesting, and you may not be sure if learning to code is right for you anyway … but with how much computers are used everywhere in any industry – it will be incredibly useful regardless of your career or vocation. So invest some time and explore the basics if you don’t consider yourself a ‘computer wiz’.



3. You’ll need to be ready for failure

Did I say ‘ready’ for failure? No, I meant you need to be happy about failing. Wait hold on… maybe I meant that you need to be ready to eagerly seek out failure!

To most people, failing is an awful experience. They try doing something and after the first or second attempt, they give up. The DVD player they tried plugging in didn’t display the movie on the screen after trying a few solutions so it must either be broken or they must just not be cut-out for the job. It can make a person feel downright stupid to keep on trying to do something, over and over, only to fail…. and keep on failing.

I know what you may be thinking. You’ve probably heard somewhere that Albert Einstein was quoted with saying “Insanity is doing the same thing over and over and expecting different results”. The key thing to realize is that I don’t mean it this way. Trying the same thing repeatedly and enjoying failure from it is rather masochistic. I wouldn’t recommend it. Instead, the type of failure I mean to bring up here is one that comes from trying many different things to solve a problem until you find a solution and refusing to stop until you do.

(Another key thing to realize is that Einstein never said that quote. No really, he didn’t.)

I don’t mean to scare anyone away from learning to code by bringing this up. Far from it. I want to prepare you for what you’ll experience at first as a new programmer and help you realize that this topic will teach an important attribute that some people may go through their whole life without learning: Problem-Solving Resilience.

Here’s the thing. Every line of code you write needs to fit a set of rules and it all needs to be arranged just right for it to do what you intend. Otherwise, either the entire program won’t work – or worse – there will be a problem in the app you don’t realize right away, a bug. This can mean that a button won’t do what it’s suppose to do. Or maybe text on the screen won’t show up the way it should. Or at the extreme end of things the program, or the whole computer, will crash if you use the program in a certain way that your code can’t handle.

As you create your programs and websites, you will work through these issues. Seeing a possible cause of the problem, and trying to fix that problem the best way you can. If that fix didn’t solve it, you try something else. Each time paying close attention to what you tried and what the result was. You’ll arrange the code one way, then another, add a missing semi-colon, remove an extra parenthesis, and so on. It may take 5, 10, 20 different attempts just to get a small portion of your project working correctly. To any average person that may sound exhausting, but it’s really simple if you remember one thing – just don’t give up. Trial and error is just a part of the job, and when you’re just starting out it’s the biggest part of the job.

It ends up being a major source of learning new things about code. You see the deeper details of the programming language you’re learning by paying close attention to how you can break it, then researching or reading about why it happened that way if you don’t understand it. Google search, Stack Overflow, and other resources get to be your best friend. When you get an error message, you copy and paste it right into a search engine to see if someone out there has an explanation for it. Eventually you come to value the times you’re stumped on a problem with your code, you may be minutes away from learning something new that will make you better!

I’m proud to say that I’ve been writing code nearly every day since 2012 and in nearly 10 years of programming, I’ve never given up on a coding task. It may have taken days, or even weeks for the really hard stuff, but eventually I was able to solve everything that I attempted to code. So I can tell you confidently right now that regardless of any problems you encounter as you learn to code – there’s a solution, and you can find it. Just don’t be afraid to fail.



4. You’ll need to practice

It may not be obvious, but programming is a skill that you need to keep active in your mind. Just like playing a musical instrument or painting a beautiful still-life portrait of a fruit bowl. The more often you practice, the better you’ll be at it. The longer you go without practicing, the more you’ll wind up forgetting.

You can read all the articles, study all the textbooks, and watch all the programming tutorials on YouTube… but that will only get you 20% of what you need. The other 80% of learning how to code is actually coding. The more often you spend time at the keyboard with your code editor open, actively creating code, the more familiar you’re going to be with the process. Adopting a consistent habit of working on at least a little bit of code every day will make a huge difference.

There are countless little nuances, hiccups, and unique insights that you’ll pick up while in the act of coding that you can’t get from instruction and demonstration, or anywhere else. The videos you see on YouTube are scripted, rehearsed, and edited. When you, yourself, actually sit down to code things won’t always go as smoothly. You may need to re-configure your code editor, do a Google search on how something works … “how did that “array.map()” function work again?”, you might even have a better idea of how to do things and you’ll try to experiment with that idea.

The code examples you see in textbooks and articles have been specifically laid out in order to teach a specific concept. If you only follow along with code from the book, you’ll be missing out on a ton of learning opportunities. The textbooks usually only provide a small demonstration of a much larger picture. It’s up to you to take that small demonstration and incorporate it into a little project for yourself.

The idea is that you should take each new thing you’re learning, and practice by blending it in with all the other concepts you’ve learned.

Let’s suppose you’re a student just starting to learn about Objects in your programming language. The textbook describes them one way, and following along with it’s exercises you get the basic idea of what’s going on. You instantiate a new object, you set it’s data member values, and you call functions on it. Cool. How can you use that? Well, in your console applications you’ve probably been learning some input and output with Java’s Scanner/println, C’s printf/scanf, or C++’s cout/cin …. why not make an object that takes user input and outputs a result? Don’t know what to make? Look at your daily life and pull inspiration from it. How about something that you can use to make a schedule for yourself that gives you the percentage of the day you’re doing each activity on your schedule? If that’s too complex, how about creating a calculator that computes a running value? Even more simple would be an object that calculates your age in dog years – that’s a popular one I’ve seen before. There are many lists of project ideas out there for all levels of programming, go find an idea you like and make it happen using the concepts you’re learning!

You can even go a step beyond, treading into deeper waters. If you spent some time looking at other resources online about Objects, you may see a different way to go about it – they talk about something called a Factory? Huh, ok so you can make an object that creates objects. So, you may try working out a couple examples of that. Soon you’re starting to catch on to what Design Patterns are… Singleton, Prototype, Builder… whoa. There’s quite a few ways to go about instantiating an object. You may see some mention of Inheritance or Polymorphism too, so you mess around with some objects that utilize those ideas. It may be challenging, but looking ahead at more difficult topics can really help speed up your learning process.

I understand that it can be really difficult to come up with project or exercise ideas to practice with. “I have no idea what to make!”, you may be thinking. Well, really you don’t have to make anything. In fact it can be really fun and interesting to just experiment. Start simple. Look at a basic coding concept like arithmetic operators and ask yourself a silly question….

What happens when I try to add the integer 5 to the string “potato”?

I know you’ve always wondered what 5 + “potato” is, now’s your chance to see what happens! Well the result will depend on how you did it. Using Java, in this case, you’ll get ‘5potato’ as your output…

System.out.println(5 + "potato");

This clues you in to the fact that 5 is being converted to a string value and concatenated to the “potato” string value. If you put it into a variable first, you may get an error…. you may not. What type of variable would you use? The above example is the same as…

String silly = 5 + "potato";
System.out.println(silly);

So… What happens if we use an integer variable instead of a string?

int silly = 5 + "potato";
System.out.println(silly);

WELL we’ll get some angry red text that says something like ‘error: incompatible types: String cannot be converted to int‘ … so let’s keep going with this. First, you’ll wrap your head around why that happened… then you could look up a way to convert a string (“potato”) into an int. To the Java docs!

A few short Google searches later may show some suggestions for the function ‘Integer.parseInt()’. Ok, we’re working with the Integer class here, so let’s see the Java doc for Integer! Type Ctrl+F in your browser and find the ‘parseInt’ function. Oh interesting, there’s two versions of it.

The first version takes one String parameter… but the other…. What the heck is a “radix”? Well back to the Google searching may land you here, where an informative person name Peter explains a few things:

Alright, so the radix is the number base used when parsing our string. 0-9 use base 10, hexidecimals include A-F so that’s base 16… and what else? In that description he points out that base 36 includes Numbers and all the Letters. Huh.. ok so… What happens when we parse “potato” using base 36?

int silly = 5 + Integer.parseInt("potato", 36);
System.out.println(silly);

Ah yes, of course. As it turns out 5 + “potato” is actually equal to 1553332241! Which must mean that 1553332236 – 5 = “potato”. Some more experimentation may lead you to using Integer.toString() to convert back to a String value….

int silly = Integer.parseInt("potato", 36);
System.out.println(silly);
		
String zilly = Integer.toString(silly, 36);
System.out.println(zilly);

And…. voila! You’ve got a way to convert a string of letters into a base10 number, then take that number and convert it back to a base36 string of letters.

Why is experimenting like this useful? Well, you’ll get valuable practice with researching topics for your project ideas and experiments. You’ll get used to reading documentation… then turning right around and researching what the heck the documentation means. You’ll see error messages and begin to understand more about what they’re trying to tell you. You’ll get used to solving odd problems or finding solutions to things you may have never considered.

Will adding numbers to potatoes land you a job at Google? Probably not. The key here is just relaxing and getting to enjoy the process of experimenting with code. Go off the beaten path and think differently. If you only ever write code from the simple cookie-cutter examples that are provided to you, you’ll be missing out on a ton of random learning opportunities. Who knows, one day in your career you’ll have to convert letters into numbers and back … you may have to encode them and decode them… between different base number systems… hint hint…

There’s this notion I get from beginner programmers that everything in coding is straight-forward, dry and rather boring. You’re tasked with making a thing, you learn the best way to make the thing, then you make the thing. You have to do everything exactly like it’s explained to you, exactly what’s in the book. That’s it. Yet, I’ve had so much fun over the last decade with just playing with code in my spare time. It can be so much more interesting to ask yourself “What happens when…. ?



5. You’ll never need to know everything

Alright let’s talk about something you won’t need for a second.

As much as software developers would like to have you think that they’ve memorized every code library and function they work with, I’ll let you in on a secret – they haven’t. I’m sure it’s technically possible for the rare savant to recite every detail of the programming language and framework they work with, in binary…. but the wide majority of all programmers can’t. They wouldn’t want to. That goes for all levels of experience. You just can’t carry entire textbooks in your head. It’s just not feasible. So when you’re starting out it’s extremely important to remember that it’s impossible to absorb everything you learn. This isn’t a trivia quiz show and you won’t win fabulous prizes by committing everything to memory.

Instead, what you should try to practice and remember are the basic rules of your programming language. The syntax. The core features like: variables and arrays; if/else structures; the few different forms of a loop – while, do/while, for and an advanced for loop (if your language has it); Class and Function definitions; and how to use pointers (if your language has them). Only keep the basic details in your mind, and don’t kick yourself if you forget the nitty-gritty parts.

Remember how your code should be arranged so it’ll run, rather than each and every single possible function you can use in it.

What’s much, much, more important to remember is where you can quickly find the detailed information when you need it and how to get to it. All you need to do is hit your Windows key, type ‘Chrome’ or ‘Firefox’ and hit enter to open your internet browser, then type out a search term or a well formed question into a search engine, recognize the useful sites you’re familiar with in the search results, and click in to skim for your answer.

So first, having a good modern internet browser is a must, and having it’s default search engine set to Google or something you’re familiar with is key. In Google search, the first few results are always Ads, so skipping down to the real results can be important. Installing an Ad Blocker extension can help remove those Ads.

Next, being aware of which programming sites are useful and which ones aren’t can be crucial. I don’t mean to call anyone out here, but some sites just provide more clear information than other ones. Above all, StackOverflow can usually always point you in the right direction for very specific or unique questions. It’s a Question/Answer site that’s been indexed extremely well, so if you Google search for something like “how to get first element of associative array php” your first result may be from StackOverflow answering exactly what you asked: https://stackoverflow.com/questions/1028668/get-first-key-in-a-possibly-associative-array . An added benefit is that people will often update their answers as things change.

Now going with the first useful result you find may be perfectly fine, but it may not be your best solution. For instance, regarding my question about associative arrays in PHP, we used to use the reset() function, however now we can use array_key_first() without any side-effects. This other website showed up in my results, but their method shows using array_values($array)[0] … and this one describes other ways like using array_reverse() with array_pop() or simply array_slice() to get the first index. Of all these examples, maybe another solution may work with my code better than others.

It’s important to examine a few different possibilities. It’s even more important to be sure you know how they work before adding them to your code. Maybe what I’ve found won’t actually do what I’m expecting!

For our example, calling the reset() function on an array will return the value of the array’s first index. However, array_key_first() will return the key of the array’s first index. So in order to use array_key_first to get the same output as reset then you would need to pass its result into the array’s access brackets like this: $array[array_key_first($array)];. So, it’s important to be clear about what the code you find online actually does and how to use it.

With time you’ll find your favorite sites and resources, you’ll work out the best workflow to finding them, and you’ll realize that you really don’t need to force yourself to memorize everything. After quite a few years of practice and experience it’s likely that you will remember most of the things that you use in your code often, and you’ll become good enough that you can create your own solutions … but it’s still always good to double check your work if you aren’t sure. Chances are someone out there has a much better way to do it, and it’s just a Google search away.

One last thing I should mention here is that some programming job interviews may require you to remember the basics and demonstrate them, without a search engine. Often, there will be a first interview that follows what you’d expect from a traditional job interview… then there’s a second ‘technical’ interview where you’re assigned a programming task to complete. Like setting up a basic program or website using their specified tools or language. They may also specify that you can’t use a search engine. Though this is becoming less common nowadays. That’s fine, this is where your practice and experience is really tested. In truth, if you aren’t able to remember the basics enough to do what they ask – you probably aren’t a good fit for the job and you don’t have as much experience as they’d expect from you in your day-to-day work. With this in mind, yes – after a few years, you should probably start to memorize a few important details… but in your first year of coding, I’d really advise against it.



6. Your need to perfect your coding style

After just a little while you’ll probably start to realize that the compiler doesn’t care about whitespace, but you should. Whitespace is what we call things like spaces, tabs, and line returns. The way your code is formatted can make a huge difference even though many beginners overlook it. Let’s look at an example:

public class TestApp{public static void main(String[] args){System.out.println("Hello World");}}

Above we see your standard ‘Hello World’ java program with all the whitespace removed. Even though if you copy and paste this code into your IDE, it’ll work just fine … it’s a nightmare to read. Everything is on one line, the spaces you should expect to see before the curly braces aren’t there, there aren’t any indenting tabs or spaces… it’s just a blob of code.

We can also go the other way…

            public
            class 
            Main
              {
                public 
            static
        void
    main
    (
        String[]
                args
                    )
                    {
              System.
           out.
    println(
"Hello World"
            );
              }
               }

Now we have an unnecessary amount of whitespace! In this example, newline returns have been added at nearly every possible opportunity. Tabs and spaces have been added to nearly ever line, and we’ve created some interesting art here. Again, although it will compile and run… you have to ask yourself: does this look like any other style of code you see in any article or textbook out there?

When your code is styled in ways that differ from the norm, it can be much harder to work on. You won’t always be able to see when you’ve coded something incorrectly, and you’ll have to continually adjust/readjust the way you read code as you move between your own oddly-styled code and the code written by others.

Ok that last example was a bit much. I’ll give a very real-world example of source code I saw recently posted in an online group…

NOTE: If this your code and you somehow found my website – SORRY! I MEAN NO OFFENSE!!

I picked the example above because overall, it’s fine. It’s not a total mess with red error lines everywhere. You can read it and deduce generally what’s going on… BUT! The indentation is really off in the ‘createHashMap’ function. This is the sort of casual overlooking of style I’ve seen all the time from beginners. Losing track of where your indentations should be and disregarding how your curly braces line up can easily lead you to make mistakes – adding a brace where there shouldn’t be one or removing one where there should be. Avoidable headaches. You might be tempted to think it doesn’t matter, what you’re really concentrated on is the error on line 23, right? You might have tunnel vision and focus exclusively on that issue. The rest can be sorted out later, right?

It’s a slippery slope. First, you’ll put off correcting your indents while you solve the error you’re focusing on. Soon you may wait to correct your style until you’ve finished with your task. Eventually, it may not seem like that big of a deal. That’s the problem, this can numb your eyes to what your code should look like. The brackets at each indentation level should line up – that’s an easy indicator that tells what’s going within them.

Is line 35 an end to the for loop or the end to the function? Is line 31 inside the for loop or was the for loop some little one-liner and line 31 is outside of it? And wait, everything below line 28 is lined up differently than the contents of the loadData function. If someone asked me to help them with this error in a classroom setting, I’d want to first correct the indentation and make sure the style is lined up correctly. It’ll help me see what the issue is much more easily.

There! I’ve added green lines to show the two levels of indentation along with green arrows that mark where the indentation should be pulled back.

Yes, yes … I know. It seems like such a minor non-issue and I’m coming off like a stickler that’s just too picky. I get it. Hear me out. There have been SO MANY times that some minor issue with the style of my code made me totally miss an ending brace, missing parenthesis, or missing semi-colon. Some improper whitespace or abnormal formatting can wind up just adding to the headache of a difficult coding session, I’m here to try to save you from that pain!

After you’ve been coding for a few years, working in the same programming language for months and months on end, going through the headaches and frustrations of trying to hunt down bugs … you’ll start to develop a sixth sense. This extra sense will end up extending to everything you read. You’ll be able to spot all the typos and improper grammar that others totally overlook in written materials. When you glance at some source code in a programming language you’re familiar with… it may only take you a few moments for your eyes to fixate on what’s wrong. It just sticks out like a sore thumb. Something won’t look quite right and it will be as clear as day to you.

This sixth sense will help you so much when you’re working on code. Solving bugs will take far less time. It takes time, practice and experience for this ability to grow – but you may never pick it up if you don’t start formatting your code right away with a specific style. This style and formatting will serve as your baseline of what’s normal. Code will look almost balanced to you. Then when something isn’t lined up quite right, you’ll know it right away. You’ll be able to see that missing parenthesis or semi-colon immediately. You’ll get so accustomed to seeing correctly formatted code … anything else will just feel … wrong.

I told you all of this just to try to drive home the main point: Take extra special care of how your code is formatted. Most modern code editors and IDE’s will automatically format your code for you – TAKE ADVANTAGE OF THIS! Find the keybind to format your code (often this is Shift+Alt+F), and try to always keep your code formatted.

That’s it! Thanks for reading!

Thank you so much for reading this article. There are plenty more things you’ll need when starting to learn to code, but I hope this list gave you some information you couldn’t find elsewhere.

I’m looking forward to writing more articles and creating coding tutorials here on my site. I figured I should start with something aimed at beginners that might provide some unique insight. We all had to start somewhere and I’m really happy that you’re considering learning how to code! If this article helped you, please feel free to leave a comment or shoot me an email at will@wforbes.net!

Be well, friends

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.