!Learning to Code: Pitfalls & Stumbling Blocks for Novices
You’ve decided you want to learn to code. Maybe you’re a software tester who wants to move into automated testing. Maybe you’re an office manager who wants to join the lucrative and seemingly glamourous world of software development. Maybe you’ve been laid off from another job and want to spend your time better than refreshing the job boards every twenty minutes. Regardless, you’ve decided to take that first step in learning to code. Congratulations! But it’s not as easy as it looks in the brochure. The path forward includes some stumbling blocks that can lead to discouragement and even giving up. Hopefully, knowing what you might face will bolster your efforts to learn.
If you talk to developers, you’ll often find that they learned how to write code gradually, over a long period of time, often when they were young and had lots of time to spend. Maybe they started tinkering with computers when they were kids, writing little mods for MUDs (Multiple User Domains) or games or playing in BASIC. Maybe they went to school for a degree in computer science and had four years of classes and professorial expertise to guide them. Either way, they likely spent a lot of nights and consumed a lot of soda and energy drinks on their education, but it looks like they just emerged at 23 with 733t skills.
When you’re on your own, though, trying the autodidactic, self-taught, route to learning on evenings after you’ve spent a full day on your full-time job or chasing your kids around (also a full-time job), you’ve got less time to dedicate to the pursuit, and any questions or issues that arise can stall you to the point of giving up. So as you pursue your desire to learn software development, keep the following in mind.
Picking a Language
When you decide to learn to code, you’ve got to pick your first language to learn. If you scan the job boards, you’ll see postings for a variety of languages such as Java, JavaScript, Go, C, C++, C#, Rust, Python, Ruby, and sometimes esoteric languages like ASP, ColdFusion, COBOL, and MUMPS.
You’ll also see a scattering of frameworks, which are basically extensions of existing languages, but recruiters often lump them in with languages. When you see Node or React mentioned, know that these are frameworks that extend JavaScript for certain types of programming, so developing in Node is developing in JavaScript for Web server applications or APIs or developing with React means developing user interfaces, usually Web (that is, browser-based) pages.
What you want to learn to code will determine the best languages for you to learn.
- Web pages? Learn a lot of JavaScript and its frameworks.
- Server-side applications? Use Go or Rust.
- Desktop applications? Try Visual C#.
The Internet is rife with tutorials, both text-based and videos, to teach you how to start in the language you choose. Many will walk you through the steps for installing and running the necessary components to get started (if the tutorials are current—see “Out-of-Date Resources” below).
Installing the Language and Framework
Once you’ve chosen a language, you’ll probably have to download the language and its compiler or interpreter to begin. In many cases, you can find these items with a quick Internet search, and many of them come with a Microsoft Windows installer. However, some do require you to type commands at the command line. If you’re accustomed to Unix, Linux, or other command-line interfaces, this won’t be very difficult, but if you’re not used to it, it can be daunting working without CTRL+Z to undo or a Cancel button.
If you also want to download and install a framework, you might find that this is a trickier proposition, as this will probably require using what’s called a package manager, which is how you keep versions of different dependencies—the other thousands of files your framework uses—in sync in your projects. Having to work with another piece of software—the package manager—and those thousands of files can be overwhelming, especially when the package manager starts spitting out error messages and security vulnerabilities in esoteric places.
However, at the minimum, after these awkward early steps, you’ve gotten something running and can begin delving into your tutorials. However, it’s not uncommon during the installation to encounter some error messages, especially when using the command line, that only the initiated can sometimes decipher. We’ll talk about that a bit below.
Scaffolding and All Those Files—What Do They Do?
Some languages allow you to simply create a file with the code in it and then run it through a compiler or an interpreter to make the computer do what you’ve coded it to do—such as print “Hello, World!” to the screen or Web page at the start.
However, when you’re using a framework or some development platforms such as Visual Studio, creating a new “project” or “solution” builds a whole folder, complete with subfolders, full of files and things that your tutorials don’t mention.
For example, a Microsoft Visual C# project comes with a lot of extras, too, and when creating a new project, you're asked to choose from numerous types of applications and projects. If you're just starting out, you probably don't know the difference between a ASP .NET Web Application (.NET Framework) and an ASP. NET Core Application. Hopefully, your tutorial will walk you through the wizard, but the wizards change between IDE versions.
Regardless, even the simplest project will come with numerous other files packaged with it.
A WebStorm Angular project comes with numerous folders, packages, and dependencies as well.
You might get lost amongst these folders, packages, and configuration files as you try to learn a language by editing one or more files according to your tutorial. At the very least, you might worry about making one typo in one file that leads to problems building/running/testing your lessons which can also lead to new-to-you different but still esoteric error messages. As open source software developers update their packages that your project uses, the IDE might prompt you to update those packages--and the changes can lead to more of those esoteric error messages similar to when you installed the language or framework in the first place.
Interpreting Esoteric Error Messages
You can encounter errors either when installing a language, framework, or the various dependencies and packages either needs. You can also encounter errors when you’re compiling or building a solution or running your sample code.
Unfortunately, a lot of those error messages are not very helpful to the layman.
Quite likely, the detailed error message will describe the problem in technospeak and might very well refer to one file or another that you didn’t even change or code yourself.
You can search the Internet search for the error message, but the results you get might be out-of-date or otherwise not helpful (see also “Conducting the Right Internet Searches” below).
You can start the tutorial or project again from scratch, trying to follow step-by-step again to see what mistake you might have made. Or you might encounter the error messages when you’re playing around or when you’ve left the tutorial behind. These inscrutable error messages can derail a lot of learning projects and frustrate one or you to give up. Or perhaps when I say “you” or “one,” I just mean me.
Conducting the Right Internet Searches
As you encounter esoteric error messages or try to do something not in your tutorials, you’ll probably want to conduct Internet searches. Even though I’m still the sort of old timer that likes to have a book on my shelf describing how to program in various languages or language reference guides, I still end up running a quick Web search whenever I need information, such as looking for the fix for an esoteric error message or reviewing commands or syntax.
Sometimes, though, I want to do something, but I don’t know exactly what or how, and I don’t know what questions to ask to conduct a targeted search that will give relevant results. I have to cast about a bit until something I see cues me to better questions to ask until I get the answer to the question I needed.
Out-of-Date Resources
Sometimes, you know the right question to ask and your Google-fu works, sort of. But if you’re learning a mature language or framework that is several years old and maybe features two or more major releases per year, you will find highly rated answers to your question that someone answered comprehensively and clearly—four years ago. But that answer no longer applies to new structures in the language or practices in the framework.
If you’re not careful in identifying a version number and a date in the answers to your questions, you risk trying wrong answer after wrong answer—even though they look correct—as you develop your understanding of the development language. Or, just as likely, as you grow your frustration with this already challenging endeavor.
Unfriendly Development Communities
The Internet offers many developer communities and forums where developers can ask questions for problems that vex them; as a matter of fact, a lot of Internet searches lead to just these sorts of message boards whose messages go back years (and, hence, some of the answers will be out of date). If you poke around on the message boards but cannot find the answer to your question, you can ask the other developers to help out.
Unfortunately, some of the larger communities have gotten the reputation as being unfriendly to novices. Ancient developers who have been around for three or four years brusquely mark questions as duplicate. If you’ve had your hand slapped once or twice, you might become reluctant to ask your questions and instead to look to other resources whose answers might only be adjacent to your problem or to your greater understanding.
Using an Integrated Development Environment
With a simple language and interpreter, you can create the code files in a simple text editor like Microsoft Notepad (or via command line tools if you’re adventurous). However, at some point you might decide to use an Integrated Development Environment (IDE) such as WebStorm, RubyMine, Visual Studio, or Eclipse or even a simpler text editor like UltraEdit or Sublime Text. Suddenly, instead of you and the language you’re trying to learn, you’re facing a very busy screen with tools you don’t even know you might need yet.
The window has lots of panels, tabs, palettes, floating dialog boxes, menus, and somewhere, presumably, the code you’re trying to write. Worse, each will have a set of keyboard shortcuts along with the Intellisense (where the IDE tries to complete your code-sentences for you), and you’ll press CTRL+D and suddenly something is missing or changed, and you have no idea how to get it back.
How To Actually Learn Anything
Keep in mind the above list might not reflect all the possible challenges to learning to code, but if you decide to take up one of the dialects of Computerese, you might run into some of them. You’re not alone. Fortunately, you can also plan your journey of discovery to try to avoid as many of these pitfalls as possible.
If you’re going to learn to code, you should probably have an idea what you want to create. If you’re a software tester who wants to move into automation, if you want to get into Web development, you probably don’t want to learn a system kernel-level language.
Start as simply as you can. If you can, work with just a text editor and an interpreter/compiler so that you can understand the language, its techniques, and its syntax before you start working with frameworks, IDEs, and other complexities.
Choose a good tutorial, video, or online course—and recognize that the first one you review might not be the best one for you. If you find yourself spending a lot of time trying to figure out what the tutorial says rather than the language, abandon it and try a different guide. When you’re starting out, the tutorials that offer the best step-by-step instruction, which generally means lots of steps and lots of screen shots, work the best. If the screen shots in the tutorial don’t match the screens you see after installing the latest versions of the language and tools, look for a more recent tutorial.
Explore the forums and communities on the Internet to find places you can go to ask questions. Perhaps you can pepper friends or associates with infrequent questions when you get really stuck. Having a personal place to turn for answers will help keep you moving forward and provide some companionship on the way.
Understand you will reach a gap after you complete the basic tutorials. Once you’ve printed text on the Web page, populated an array, and maybe even have written data to a database, you might want or need to do complex things as data transformations, API calls, or importing a reputable library to extend your application’s functionality. So you’ll have to become comfortable enough with the language to know how to ask those questions of the Internet and get results you can understand.
So if you really want to learn to code, be patient and be persistent, and you can. But just because you see a lot of very young people (with a lot of time on their hands) build valuable applications and large companies seemingly overnight, don’t expect it will be easy for you. It probably wasn’t for them, either.
Not included: Asynchronous programming with JavaScript promises.