Learning Programming

Learning to program is about understanding how to translate thoughts into source code that can be executed on computers to achieve one or more goals.

There are many steps in learning how to program, including

  1. setting up a development environment
  2. selecting a programming language, such as Python
  3. understanding the syntax and commands for the language
  4. writing code in the language, often using pre-existing code libraries and frameworks
  5. executing the program
  6. debugging errors and unexpected results
  7. deploying an application so it can run for intended users

How should I learn programming?

There are several schools of thought on how a person should start learning to program. One school of thought is that a lower-level programming language such as Assembly or C are the most appropriate languages to start with because they force new developers to write their own data structures, learn about pointers and generally work their way through the hard problems in computer science.

There's certainly wisdom in this "low-level first" philosophy because it forces a beginner to gain a strong foundation before moving on to higher level topics such as web and mobile application development. This philosophy is the one most commonly used in university computer science programs.

The atomic units of progress in the "low-level first" method of learning are

  1. aspects of programming language understood (type systems, syntax)
  2. number of data structures coded and able to be used (stacks, queues)
  3. algorithms in a developer's toolbelt (quicksort, binary search)

Another school of thought is that new developers should bootstrap themselves through working on projects in whatever programming language interests them enough to keep working through the frustrations that will undoubtably occur.

In this "project-based" line of thinking, the number of projects completed that expand a programmer's abilities are the units of progress. Extra value is placed on making the projects open source and working with experienced mentors to learn what he or she can improve on in their programs.

Should I learn Python first?

Python is good choice in the project-based approach because of the extensive availability of free and low cost introductory resources, many of which provide example projects to build upon.

Note that this question of whether or not Python is a good first language for an aspiring programmer is highly subjective and these approaches are not mutually exclusive. Python is also widely taught in universities to explain the fundamental concepts in computer science, which is in line with the "low-level first" philosophy than the projects-first method.

In a nutshell, whether Python is the right first programming language to learn is up to your own learning style and what feels right. If Ruby or Java seem like they are easier to learn than Python, go for those languages. Programming languages, and the ecosystems around them, are human-made constructs. Find one that appears to match your personal style and give it a try, knowing that whatever you choose you'll need to put in many long days and nights to really get comfortable as a software developer.

Practice problems

Working on practice programming challenges and studying their solutions in Python or another language is a great way to learn whether you are just starting or an experienced developer. Here are numerous open source repositories and sites with practice problems and solutions:

  • Pytudes are an awesome collection of Python programs to practice and demonstrate skills. These problems go above and beyond the common data structures and algorithm questions often found in other practice problem sets.

  • Interactive Python coding interview challenges is an awesome Jupyter Notebook to learn and test your data structures and algorithms knowledge in Python.

  • Python Programming Exercises is a free short PDF book with exercises across many standard Python language features such as dictionaries, classes and functions.

  • Code problems provides common algorithm and data structures challenges with solutions in several programming languages including Python.

  • Python basics contains materials and exercises to learn basic Python 3 syntax such as variables, functions and lists.

  • TeachCraft combines Minecraft with Python to learn coding.

  • 500 Data Structures and Algorithms practice problems and their solutions covers a large swath of the computer science space. It is not important to know all of these algorithms and data structures but experience with many of them will be greatly beneficial in becoming a better developer.

First-hand advice

These articles are written by programmers who explain how they learned to code. They should not be taken as "this is how you must learn" but instead give example paths you can think about taking as a beginner:

  • Learning to program is a long read but goes through Dan's experience in math and engineering before fully committing to software development.

  • Developing as a developer gives general advice on qualities necessary to become a programmer, including persistence, respecting others and considering ideas that are outside your comfort zone.

  • Mastering programming by Kent Beck contains patterns and observations for how experienced programmers he has worked with in the past became great software developers.

Teaching perspectives

Are you an experienced programmer working with new and junior programmers? These articles give some insight into how you may want to structure your teaching experience:

What do you want to learn about programming?

What editor should I use to code my Python app?

Why is Python a good programming language to use?

Show me a list of the best Python learning resources.

Sign up for two emails per month with Python tutorials and Full Stack Python updates.

Sponsored By

Mapbox logo.

Easily build maps, search and navigation into your Python applications with Mapbox.

Real Python logo

Upgrade your Python skills by reading Real Python's awesome programming email newsletter.

Full Stack Python

Full Stack Python is an open book that explains concepts in plain language and provides helpful resources for those topics.
Updates via newsletter, Twitter & Facebook.
1. IntroductionLearning ProgrammingCore LanguageWhy Use Python?Python 2 or 3?Enterprise PythonPython CommunityCompanies using PythonBest Python ResourcesBest Python VideosBest Python Podcasts2. Development EnvironmentsText Editors & IDEsVimEmacsSublime TextPyCharmJupyter NotebookShellsBash shellZshPowerShellTerminal MultiplexerstmuxScreenPymuxEnvironment configurationApplication DependenciesVirtualenvsEnvironment variablesLocalhost tunnelsSource ControlGitMercurialApache SubversionHosted Source ControlGitHubBitBucketGitLab3. DataRelational DatabasesPostgreSQLMySQLSQLiteObject-relational MappersSQLAlchemyPeeweeDjango ORMSQLObjectPony ORMNoSQL Data StoresRedisMongoDBApache CassandraNeo4jData analysispandasNumPySciPyBokehd3.jsMatplotlibMarkdown4. Web DevelopmentWeb FrameworksDjangoFlaskBottlePyramidFalconMorepathSanicOther Web FrameworksTemplate EnginesJinja2MakoDjango TemplatesWeb DesignHTMLCascading Style Sheets (CSS)Responsive DesignMinificationCSS FrameworksBootstrapFoundationJavaScriptTask QueuesCeleryRedis Queue (RQ)DramatiqStatic Site GeneratorsPelicanLektorMkDocsTestingUnit TestingIntegration TestingCode MetricsDebuggingWebSocketsuvloopWeb APIsMicroservicesBotsAPI CreationAPI IntegrationTwilioSecurity5. DeploymentServersStatic ContentVirtual Private ServersPlatform-as-a-ServiceOperating SystemsUbuntuWeb ServersApache HTTP ServerNginxCaddyWSGI ServersGreen Unicorn (Gunicorn)Continuous IntegrationJenkinsConfiguration ManagementAnsibleDockerServerlessAWS LambdaGoogle Cloud Functions6. DevOpsMonitoringRollbarCachingLoggingWeb AnalyticsChange LogWhat Full Stack MeansAbout the AuthorFuture DirectionsPage Statuses ...or view all topics.

Matt Makai 2012-2018