So do coding bootcamps and college programs. As a beginner, looking at a long line of code can feel overwhelming, like picking up a book written in another language. But starting small and setting realistic goals helps beginners learn programming languages. The same outlook also helps intermediate coders build advanced skills. Why is coding so hard?
Well, many learners struggle with the transition from following tutorials to creating their own code. The learning curve can feel steep. You need the ability to find troubleshooting resources and choose the right skill for the challenge. Debugging also makes coding challenging. When speaking a foreign language, listeners can often understand you even with a few grammar errors. Computers are less forgiving. Identifying errors and correcting them takes patience and practice.
Many beginners find themselves frustrated with the trial-and-error of testing fixes. Finally, some programming languages rely on unintuitive concepts. Object-oriented programming languages, for example, define objects very differently from our common understanding. Is coding hard to learn? It depends. Every programming language can pose challenges for learners, and some programmers find certain languages more intuitive.
Still, certain factors make it easier or harder to learn a programming language. An obscure language with few resources and complicated syntax can challenge even experienced programmers.
Beginners and experienced programmers might post questions on forums, share strategies, and support each other. Popular languages also come with free online tutorials , YouTube videos, and classes dedicated to learning to code. On the other hand, resources for some programming languages are sparse. Very old or very new programming languages often offer less support.
Extremely specialized languages also tend to lack resources. Programming languages fall into two categories: high-level or low-level.
A low-level language operates closer to the computer hardware and machine code. That can make it harder for programmers to interpret.
In contrast, a high-level language prioritizes clearer language for the user versus the computer. Which is harder? Some programmers find it faster to program in low-level languages. But many beginners find low-level languages more difficult to master. A high-level language, like Python, uses English-language commands that make it easier for people to write or interpret code.
The C languages are often classified as low-level. Programmers use syntax to tell computers how to interpret code. And different programming languages use different syntax. Some prioritize straightforward syntax that uses predictable commands. Others require much more complex syntax. Take Python vs. That's in part because of their syntax. To tell the computer to output the phrase "Hello, world! You're at a war with bugs that makes Starship Troopers look benign. It feels like each victory was gained only by a stroke of lucky Googling and your confidence that you can ever figure this stuff out plummets.
This is a particularly frustrating phase to see as an educator and to all participants in our industry. Programming may not be perfect for everyone, but we want you to make progress because sometimes the unlikeliest of stories become the grandest successes. When the hand-holding ends and students are pushed off the cliff and told to fly, too many potentially awesome people are spiraling onto the rocks of frustration without learning how to flap their wings.
The scary part is that you haven't even gotten to the meaty stuff yet. This second phase, the Cliff of Confusion, is still very early. Once you've finally squashed enough bugs to end the eighth plague of Egypt and actually finished a couple of projects -- thus marking the end of Phase II -- you're still just getting started.
For those who are truly ready to make a career out of this, surviving the Cliff of Confusion is often the point where you decide to go all-in with your new life. But too many are left behind. And, unfortunately, you're just about to enter the "Desert of Despair". So what really marks the difference between one phase and the next? Understanding this will help you realize that it's not your fault at all if your journey looks like what we've just described. Basically, there are two key forces at work in every phase -- Resource Density and Scope of Knowledge.
Let's see what these are before exploring how they define Phase III. As I said above, when you first start out, it feels like there are a million resources out there trying to hold your hand and pull you into coding.
That's because there are! Search for "Learn to Code" and you'll be hit with a wall of helpful and useful tools, texts, videos and tutorials. And, frankly, they're great! Never before have there been so many ways to start learning to code. Unfortunately, in later phases the density of resources drops off fast. Anyone who's made the jump from beginner to intermediate can attest that there is a BIG difference between the amount of resources available when you first start out versus when you're first looking for help building things on your own without too much hand-holding.
This problem exacerbates as the amount of knowledge increases rapidly entering Phase III, and is one reason why we call that phase the "Desert of Despair".
Once you get past this and start to become comfortable with what exactly you need to search for, the resources return and you're able to work with more technical tools like industry blogs and screencasts.
Part of this is just understanding which questions to ask. Here's what the Resource Density looks like in each phase greater line density indicates more resources :. Now let's talk about a related issue -- the Scope of Knowledge. This represents the total breadth of new topics you need to learn in each phase. Here's what it looks like:. When you first start learning, the set of things you need to understand is narrow.
Everyone, regardless of goals or language or background, needs to figure out what a for loop is, how to build conditional logic, and other basic structures of programming syntax.
There ultimately aren't even that many of these fundamental concepts so the Scope of Knowledge during that phase is very narrow. As soon as you get away from the basics, you see a rapid broadening of the Scope of Knowledge as you need to begin picking up things that are more difficult like understanding errors and when to use the code you know know how to use.
This is different because there is no "correct" answer to a clear question When you progress into the third phase, the scope of knowledge balloons wider. You now need to understand what tools to use, what languages to learn, underlying CS fundamentals, how to write modular code, object-orientation, good style, and how to ask for help to name just a few. Every trip to Google or Hacker News takes you down another set of rabbit holes and overwhelms you with more things you don't know but feel like you should.
Only when you've finally found some traction and left the desert does the scope again begin to narrow. By that point, you've found your chosen technology and its place in the ecosystem. You finally pretty much know what you don't know and can plot a path through it. You will continue to increase focus as you push onward and into the beginning of your career. With an understanding of these factors, you can see that the Cliff of Confusion is really just a turning point.
The pain caused by the toxic combination of a rapidly increasing Scope of Knowledge and a falling Resource Density results in what I call the "Desert of Despair".
In essence, this desert is where you know there's an end somewhere but you don't know how to get there:. The desert is long and fraught with dangers. You'll find yourself drawn to "Mirages of Mania" along the way -- dozens of tempting resources which appear to hold the solutions you're looking for but which will deposit you, once again, in a place where lonely sand extends to each horizon line.
Or you find a tutorial which purports to take you all the way. You thought you learned the lessons of the Hand Holding Honeymoon -- that there are no easy answers -- but the temptation to seek salvation is too great and you fall for the promise that this one will get you to the finish where the others did not.
You can't learn this stuff in a week or a month or a single college class no matter what anyone says so stop falling for that! There is a LOT more to learn than you probably expected. The main body also doesn't reassign anything to the added variable.
This means that added retains its initial value, making the final result just 4. There is a strong expectation amongst programmers that you don't include code that won't be used. Elliot Soloway identified this and other maxims or rules of discourse in Like conversational norms, these unwritten rules can have a powerful influence on interpretation. Many modern editors will warn about unused local variables, but this seems to be something more. It may be useful to quantify how programmers differentiate between functions that do things and functions that don't in order to provide better warnings.
The longest program in our study was between. It filtered down two lists, printed the results, and then printed the intersection of the original two lists. We had two versions, "functions" and "inline", where the filtering and intersection operations were either contained in separate functions or inlined in the main body.
There was, however, an interesting common error that more experienced programmers tended to make. Here's the code for the "inline" version:. This would be the right answer if the intersection common operation was performed on the filtered lists instead of the original lists. We hypothesized that this may represent another "rule of discourse" -- later computations should follow from earlier ones.
More experienced programmers may be expecting the intersection, which comes later than the filtering, to make use of the filtered lists. We think that moving the intersection before the filtering operations would eliminate the error, but we're interested to hear what changes others think would help programmers avoid this mistake.
If you'd like to see all of the results, make sure to check out the full paper. For a more comprehensive review of the psychology of programming, I'd recommend the book Software Design: Cognitive Aspects. It has a great overview of the field and its findings up to around Some more recent scientific work includes Raymond Buse's code readability study , Christopher Douce's "Stores" model of code cognition , and Roman Bednarik's eye-tracking experiments.
As was mentioned in the Hacker News thread related to the paper, there's even an entire conference dedicated to studying program comprehension! My work is inspired by these and other great scientists. You're welcome to take a look at the data. It's available on Github in XML format along with some of my plotting and analysis scripts.
0コメント