GCFGlobal Logo

  • Get started with computers
  • Learn Microsoft Office
  • Apply for a job
  • Improve my work skills
  • Design nice-looking docs
  • Getting Started
  • Smartphones & Tablets
  • Typing Tutorial
  • Online Learning
  • Basic Internet Skills
  • Online Safety
  • Social Media
  • Zoom Basics
  • Google Docs
  • Google Sheets
  • Career Planning
  • Resume Writing
  • Cover Letters
  • Job Search and Networking
  • Business Communication
  • Entrepreneurship 101
  • Careers without College
  • Job Hunt for Today
  • 3D Printing
  • Freelancing 101
  • Personal Finance
  • Sharing Economy
  • Decision-Making
  • Graphic Design
  • Photography
  • Image Editing
  • Learning WordPress
  • Language Learning
  • Critical Thinking
  • For Educators
  • Translations
  • Staff Picks
  • English expand_more expand_less

Computer Programming Basics  - Introduction to Computer Programming

Computer programming basics  -, introduction to computer programming, computer programming basics introduction to computer programming.

GCFLearnFree Logo

Computer Programming Basics: Introduction to Computer Programming

Lesson 1: introduction to computer programming, introduction to programming.

Computer programming is the process of designing and writing computer programs . As a skill set, it includes a wide variety of different tasks and techniques, but our tutorials are not intended to teach you everything. Instead, they are meant to provide  basic, practical skills  to help you understand and write computer code that reflects things you see and use in the real world. 

A computer

What you need to know

Our computer programming tutorials assume that you have no programming experience whatsoever. They do, however, require basic familiarity with the use of computers and web browsers. For example, you should be comfortable downloading and opening files, and using text editing software. If you don't feel confident in those skills, consider spending some time with these tutorials first:

  • Computer Basics
  • Internet Basics

As long as you are comfortable with those basics, you should be prepared to begin learning programming. 

What these tutorials will cover

These tutorials focus on one particular type of programming:  web development . When you visit websites , whether you use a laptop, a smartphone, or anything else, you're actually looking at computer  code , which a web developer likely wrote, and which your web browser is interpreting to show you what you see on the screen. 

These tutorials will show you how to begin writing three common types of code used in web development, which combined make up the average website that you see every day: HTML , CSS , and JavaScript .

Parts of a website

Imagine that every website you visit is a person. Every person is different in how they look, act, and speak, but they're generally made up of  the same basic pieces.

If you imagine a website as a person, you can think of HTML as being the skeleton. 

A skeleton

HTML is at the center of almost everything you see on the Internet. While it doesn't look like much on its own, it forms the building blocks on top of which all the other pieces rest. The HTML for an extremely simple website might look something like this:

And if you loaded that in your browser, you'd see this:

Screenshot of a simple website

Try it yourself!

You can test some HTML yourself. Use this as a starting example:

Try entering that HTML in the input box below, then press the "View HTML" button. Make sure to  type it in exactly  as you see it.

You should see a button with the text you entered appear in the box above. It looks fairly plain, and it doesn't do anything yet, but you will learn about that later! 

Congratulations, you just wrote HTML!

If HTML is the skeleton, you can think of CSS as making up all the muscle, skin, and so on that make a person actually look like a person. 

A person

CSS doesn't do anything on its own. Instead, it takes plain HTML and styles it to look different . It can make what you see in the browser bigger or smaller, reorganize the pieces on the page, add colors, and more. Some CSS for an extremely simple website might look something like this:

If you were to apply the above CSS to the same extremely simple website you saw before, it would look like this:

Screenshot of a simple website with styling

You can test that CSS yourself. Use this as a starting example:

Try entering that snippet of CSS in the input box below, then press the "Update CSS" button. Make sure to  type it in exactly  as you see it.

You should see words in the box to the right become italicized. If you do, then congratulations! You just wrote CSS!

If HTML and CSS have combined to make a person that looks like a person, you can think of JavaScript as being the brain. Without it, a person just sits there, but with it, they are active and alive.

A person being active

JavaScript can change the HTML and CSS of a website in real time after it has loaded. It can hide things, add new things, change what things look like, and more. Any time something on a website changes while you are looking at it, there is a good chance that JavaScript is being used to do it. 

For example, imagine that you wanted the browser to create a pop-up greeting whenever somebody loaded the extremely simple website from before. One way would be to write some code that looks like this:

And when you loaded the website, you would see something like this:

Screenshot of a pop-up greeting on a simple website

You can test that JavaScript yourself. Use this code as an example:

Try entering that snippet of code in the input box below, then press the "Run Code" button. Make sure to type it in exactly as you see it.

You should see a pop-up just like in the example above, only with a different message. Congratulations, y ou just wrote JavaScript!

previous

/en/computer-programming-basics/tools-to-start-programming/content/

  • Trending Now
  • Foundational Courses
  • Data Science
  • Practice Problem
  • Machine Learning
  • System Design
  • DevOps Tutorial

Basic Programming Problems

  • Learn Programming For Free
  • Programming Tutorial | Introduction, Basic Concepts, Getting started, Problems
  • Types of Issues and Errors in Programming/Coding
  • What is Programming? A Handbook for Beginners
  • Top 10 Programming Tips For Beginners
  • C++ Programming Examples
  • Best Courses on Competitive Programming
  • CBSE Class 11 | Concepts of Programming Methodology
  • How to begin with Competitive Programming?
  • Programming | Question 1
  • CBSE Class 11 | Problem Solving Methodologies
  • C Program to Add Two Integers
  • Top | MCQs on Dynamic Programming with Answers | Question 19
  • C++ program for Solving Cryptarithmetic Puzzles
  • Basic Coding Problems in DSA for Beginners
  • Output of C programs | Set 49 (Operators)
  • C Program to Make a Simple Calculator
  • C | Pointer Basics | Question 13
  • Program to print ASCII Value of a character
  • Introduction of Programming Paradigms
  • Program for Hexadecimal to Decimal
  • Program for Decimal to Octal Conversion
  • A Freshers Guide To Programming
  • ASCII Vs UNICODE
  • How to learn Pattern printing easily?
  • Loop Unrolling
  • How to Learn Programming?
  • Program to Print the Trapezium Pattern

Learn Programming – How To Code

In the world of programming , mastering the fundamentals is key to becoming a proficient developer. In this article, we will explore a variety of basic programming problems that are essential for every aspiring coder to understand. By delving into these foundational challenges, you will gain valuable insights into problem-solving techniques and build a strong foundation for your programming journey. Whether you’re a novice programmer or looking to refresh your skills, this guide will provide you with a solid introduction to essential programming problems

Why to Start with Basics Programming Problems?

Starting with basics is important because it helps you build a strong foundation. When you understand the basics well, it becomes easier to learn more advanced things later on. It’s like building a solid base for a tall building – if the base is strong, the building will be strong too. Mastering the basics also helps you become better at solving problems, which is really important in programming and other technical areas.

Benefits of Starting with Basic Programming Problems:

Foundation Building: Establishes a strong foundation in coding by introducing fundamental concepts.

  • Improve Problem-Solving: Enhances problem-solving skills, preparing for more complex challenges.
  • Language Proficiency: Fosters proficiency in a programming language, facilitating expression of thoughts and implementation of solutions.
  • Debugging Skills: Provides practice in debugging techniques and understanding common errors.
  • Algorithmic Thinking: Encourages efficient and optimized thinking, laying the groundwork for advanced problem-solving.
  • Confidence Building: Boosts confidence in coding and problem-solving abilities through successful progression.
  • Get Ready for Interviews: Prepares for coding job interviews by mastering fundamental concepts commonly assessed.

Basic Programming Problems:

Related Article:

  • What is a Code in Programming?
  • What Is Coding and What Is It Used For?

Please Login to comment...

Similar reads.

  • Programming

advertisewithusBannerImg

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

Python Practice for Beginners: 15 Hands-On Problems

Author's photo

  • online practice

Want to put your Python skills to the test? Challenge yourself with these 15 Python practice exercises taken directly from our Python courses!

There’s no denying that solving Python exercises is one of the best ways to practice and improve your Python skills . Hands-on engagement with the language is essential for effective learning. This is exactly what this article will help you with: we've curated a diverse set of Python practice exercises tailored specifically for beginners seeking to test their programming skills.

These Python practice exercises cover a spectrum of fundamental concepts, all of which are covered in our Python Data Structures in Practice and Built-in Algorithms in Python courses. Together, both courses add up to 39 hours of content. They contain over 180 exercises for you to hone your Python skills. In fact, the exercises in this article were taken directly from these courses!

In these Python practice exercises, we will use a variety of data structures, including lists, dictionaries, and sets. We’ll also practice basic programming features like functions, loops, and conditionals. Every exercise is followed by a solution and explanation. The proposed solution is not necessarily the only possible answer, so try to find your own alternative solutions. Let’s get right into it!

Python Practice Problem 1: Average Expenses for Each Semester

John has a list of his monthly expenses from last year:

He wants to know his average expenses for each semester. Using a for loop, calculate John’s average expenses for the first semester (January to June) and the second semester (July to December).

Explanation

We initialize two variables, first_semester_total and second_semester_total , to store the total expenses for each semester. Then, we iterate through the monthly_spending list using enumerate() , which provides both the index and the corresponding value in each iteration. If you have never heard of enumerate() before – or if you are unsure about how for loops in Python work – take a look at our article How to Write a for Loop in Python .

Within the loop, we check if the index is less than 6 (January to June); if so, we add the expense to first_semester_total . If the index is greater than 6, we add the expense to second_semester_total .

After iterating through all the months, we calculate the average expenses for each semester by dividing the total expenses by 6 (the number of months in each semester). Finally, we print out the average expenses for each semester.

Python Practice Problem 2: Who Spent More?

John has a friend, Sam, who also kept a list of his expenses from last year:

They want to find out how many months John spent more money than Sam. Use a for loop to compare their expenses for each month. Keep track of the number of months where John spent more money.

We initialize the variable months_john_spent_more with the value zero. Then we use a for loop with range(len()) to iterate over the indices of the john_monthly_spending list.

Within the loop, we compare John's expenses with Sam's expenses for the corresponding month using the index i . If John's expenses are greater than Sam's for a particular month, we increment the months_john_spent_more variable. Finally, we print out the total number of months where John spent more money than Sam.

Python Practice Problem 3: All of Our Friends

Paul and Tina each have a list of their respective friends:

Combine both lists into a single list that contains all of their friends. Don’t include duplicate entries in the resulting list.

There are a few different ways to solve this problem. One option is to use the + operator to concatenate Paul and Tina's friend lists ( paul_friends and tina_friends ). Afterwards, we convert the combined list to a set using set() , and then convert it back to a list using list() . Since sets cannot have duplicate entries, this process guarantees that the resulting list does not hold any duplicates. Finally, we print the resulting combined list of friends.

If you need a refresher on Python sets, check out our in-depth guide to working with sets in Python or find out the difference between Python sets, lists, and tuples .

Python Practice Problem 4: Find the Common Friends

Now, let’s try a different operation. We will start from the same lists of Paul’s and Tina’s friends:

In this exercise, we’ll use a for loop to get a list of their common friends.

For this problem, we use a for loop to iterate through each friend in Paul's list ( paul_friends ). Inside the loop, we check if the current friend is also present in Tina's list ( tina_friends ). If it is, it is added to the common_friends list. This approach guarantees that we test each one of Paul’s friends against each one of Tina’s friends. Finally, we print the resulting list of friends that are common to both Paul and Tina.

Python Practice Problem 5: Find the Basketball Players

You work at a sports club. The following sets contain the names of players registered to play different sports:

How can you obtain a set that includes the players that are only registered to play basketball (i.e. not registered for football or volleyball)?

This type of scenario is exactly where set operations shine. Don’t worry if you never heard about them: we have an article on Python set operations with examples to help get you up to speed.

First, we use the | (union) operator to combine the sets of football and volleyball players into a single set. In the same line, we use the - (difference) operator to subtract this combined set from the set of basketball players. The result is a set containing only the players registered for basketball and not for football or volleyball.

If you prefer, you can also reach the same answer using set methods instead of the operators:

It’s essentially the same operation, so use whichever you think is more readable.

Python Practice Problem 6: Count the Votes

Let’s try counting the number of occurrences in a list. The list below represent the results of a poll where students were asked for their favorite programming language:

Use a dictionary to tally up the votes in the poll.

In this exercise, we utilize a dictionary ( vote_tally ) to count the occurrences of each programming language in the poll results. We iterate through the poll_results list using a for loop; for each language, we check if it already is in the dictionary. If it is, we increment the count; otherwise, we add the language to the dictionary with a starting count of 1. This approach effectively tallies up the votes for each programming language.

If you want to learn more about other ways to work with dictionaries in Python, check out our article on 13 dictionary examples for beginners .

Python Practice Problem 7: Sum the Scores

Three friends are playing a game, where each player has three rounds to score. At the end, the player whose total score (i.e. the sum of each round) is the highest wins. Consider the scores below (formatted as a list of tuples):

Create a dictionary where each player is represented by the dictionary key and the corresponding total score is the dictionary value.

This solution is similar to the previous one. We use a dictionary ( total_scores ) to store the total scores for each player in the game. We iterate through the list of scores using a for loop, extracting the player's name and score from each tuple. For each player, we check if they already exist as a key in the dictionary. If they do, we add the current score to the existing total; otherwise, we create a new key in the dictionary with the initial score. At the end of the for loop, the total score of each player will be stored in the total_scores dictionary, which we at last print.

Python Practice Problem 8: Calculate the Statistics

Given any list of numbers in Python, such as …

 … write a function that returns a tuple containing the list’s maximum value, sum of values, and mean value.

We create a function called calculate_statistics to calculate the required statistics from a list of numbers. This function utilizes a combination of max() , sum() , and len() to obtain these statistics. The results are then returned as a tuple containing the maximum value, the sum of values, and the mean value.

The function is called with the provided list and the results are printed individually.

Python Practice Problem 9: Longest and Shortest Words

Given the list of words below ..

… find the longest and the shortest word in the list.

To find the longest and shortest word in the list, we initialize the variables longest_word and shortest_word as the first word in the list. Then we use a for loop to iterate through the word list. Within the loop, we compare the length of each word with the length of the current longest and shortest words. If a word is longer than the current longest word, it becomes the new longest word; on the other hand, if it's shorter than the current shortest word, it becomes the new shortest word. After iterating through the entire list, the variables longest_word and shortest_word will hold the corresponding words.

There’s a catch, though: what happens if two or more words are the shortest? In that case, since the logic used is to overwrite the shortest_word only if the current word is shorter – but not of equal length – then shortest_word is set to whichever shortest word appears first. The same logic applies to longest_word , too. If you want to set these variables to the shortest/longest word that appears last in the list, you only need to change the comparisons to <= (less or equal than) and >= (greater or equal than), respectively.

If you want to learn more about Python strings and what you can do with them, be sure to check out this overview on Python string methods .

Python Practice Problem 10: Filter a List by Frequency

Given a list of numbers …

… create a new list containing only the numbers that occur at least three times in the list.

Here, we use a for loop to iterate through the number_list . In the loop, we use the count() method to check if the current number occurs at least three times in the number_list . If the condition is met, the number is appended to the filtered_list .

After the loop, the filtered_list contains only numbers that appear three or more times in the original list.

Python Practice Problem 11: The Second-Best Score

You’re given a list of students’ scores in no particular order:

Find the second-highest score in the list.

This one is a breeze if we know about the sort() method for Python lists – we use it here to sort the list of exam results in ascending order. This way, the highest scores come last. Then we only need to access the second to last element in the list (using the index -2 ) to get the second-highest score.

Python Practice Problem 12: Check If a List Is Symmetrical

Given the lists of numbers below …

… create a function that returns whether a list is symmetrical. In this case, a symmetrical list is a list that remains the same after it is reversed – i.e. it’s the same backwards and forwards.

Reversing a list can be achieved by using the reverse() method. In this solution, this is done inside the is_symmetrical function.

To avoid modifying the original list, a copy is created using the copy() method before using reverse() . The reversed list is then compared with the original list to determine if it’s symmetrical.

The remaining code is responsible for passing each list to the is_symmetrical function and printing out the result.

Python Practice Problem 13: Sort By Number of Vowels

Given this list of strings …

… sort the list by the number of vowels in each word. Words with fewer vowels should come first.

Whenever we need to sort values in a custom order, the easiest approach is to create a helper function. In this approach, we pass the helper function to Python’s sorted() function using the key parameter. The sorting logic is defined in the helper function.

In the solution above, the custom function count_vowels uses a for loop to iterate through each character in the word, checking if it is a vowel in a case-insensitive manner. The loop increments the count variable for each vowel found and then returns it. We then simply pass the list of fruits to sorted() , along with the key=count_vowels argument.

Python Practice Problem 14: Sorting a Mixed List

Imagine you have a list with mixed data types: strings, integers, and floats:

Typically, you wouldn’t be able to sort this list, since Python cannot compare strings to numbers. However, writing a custom sorting function can help you sort this list.

Create a function that sorts the mixed list above using the following logic:

  • If the element is a string, the length of the string is used for sorting.
  • If the element is a number, the number itself is used.

As proposed in the exercise, a custom sorting function named custom_sort is defined to handle the sorting logic. The function checks whether each element is a string or a number using the isinstance() function. If the element is a string, it returns the length of the string for sorting; if it's a number (integer or float), it returns the number itself.

The sorted() function is then used to sort the mixed_list using the logic defined in the custom sorting function.

If you’re having a hard time wrapping your head around custom sort functions, check out this article that details how to write a custom sort function in Python .

Python Practice Problem 15: Filter and Reorder

Given another list of strings, such as the one below ..

.. create a function that does two things: filters out any words with three or fewer characters and sorts the resulting list alphabetically.

Here, we define filter_and_sort , a function that does both proposed tasks.

First, it uses a for loop to filter out words with three or fewer characters, creating a filtered_list . Then, it sorts the filtered list alphabetically using the sorted() function, producing the final sorted_list .

The function returns this sorted list, which we print out.

Want Even More Python Practice Problems?

We hope these exercises have given you a bit of a coding workout. If you’re after more Python practice content, head straight for our courses on Python Data Structures in Practice and Built-in Algorithms in Python , where you can work on exciting practice exercises similar to the ones in this article.

Additionally, you can check out our articles on Python loop practice exercises , Python list exercises , and Python dictionary exercises . Much like this article, they are all targeted towards beginners, so you should feel right at home!

You may also like

basic programming homework

How Do You Write a SELECT Statement in SQL?

basic programming homework

What Is a Foreign Key in SQL?

basic programming homework

Enumerate and Explain All the Basic Elements of an SQL Query

Browse Course Material

Course info.

  • Sarina Canelake

Departments

  • Electrical Engineering and Computer Science

As Taught In

  • Programming Languages
  • Software Design and Engineering

Learning Resource Types

A gentle introduction to programming using python, assignments.

If you are working on your own machine, you will probably need to install Python. We will be using the standard Python software, available here . You should download and install version 2.6.x, not 2.7.x or 3.x. All MIT Course 6 classes currently use a version of Python 2.6.

facebook

You are leaving MIT OpenCourseWare

If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

To log in and use all the features of Khan Academy, please enable JavaScript in your browser.

Computer programming - JavaScript and the web

Unit 1: intro to js: drawing & animation, unit 2: intro to html/css: making webpages, unit 3: intro to sql: querying and managing data, unit 4: advanced js: games & visualizations, unit 5: advanced js: natural simulations, unit 6: html/js: making webpages interactive, unit 7: html/js: making webpages interactive with jquery, unit 8: meet the professional, browse projects.

  • Online Degree Explore Bachelor’s & Master’s degrees
  • MasterTrack™ Earn credit towards a Master’s degree
  • University Certificates Advance your career with graduate-level learning
  • Top Courses
  • Join for Free

University of Washington

Programming Languages, Part A

Taught in English

Some content may not be translated

Financial aid available

188,513 already enrolled

Gain insight into a topic and learn the fundamentals

Dan  Grossman

Instructor: Dan Grossman

Top Instructor

Coursera Plus

Included with Coursera Plus

(1,817 reviews)

Skills you'll gain

  • Higher-Order Function
  • Pattern Matching
  • Functional Programming

Details to know

basic programming homework

Add to your LinkedIn profile

See how employees at top companies are mastering in-demand skills

Placeholder

Earn a career certificate

Add this credential to your LinkedIn profile, resume, or CV

Share it on social media and in your performance review

Placeholder

There are 6 modules in this course

This course is an introduction to the basic concepts of programming languages, with a strong emphasis on functional programming. The course uses the languages ML, Racket, and Ruby as vehicles for teaching the concepts, but the real intent is to teach enough about how any language “fits together” to make you more effective programming in any language -- and in learning new ones.

This course is neither particularly theoretical nor just about programming specifics -- it will give you a framework for understanding how to use language constructs effectively and how to design correct and elegant programs. By using different languages, you will learn to think more deeply than in terms of the particular syntax of one language. The emphasis on functional programming is essential for learning how to write robust, reusable, composable, and elegant programs. Indeed, many of the most important ideas in modern languages have their roots in functional programming. Get ready to learn a fresh and beautiful way to look at software and how to have fun building it. The course assumes some prior experience with programming, as described in more detail in the first module. The course is divided into three Coursera courses: Part A, Part B, and Part C. As explained in more detail in the first module of Part A, the overall course is a substantial amount of challenging material, so the three-part format provides two intermediate milestones and opportunities for a pause before continuing. The three parts are designed to be completed in order and set up to motivate you to continue through to the end of Part C. The three parts are not quite equal in length: Part A is almost as substantial as Part B and Part C combined. Week 1 of Part A has a more detailed list of topics for all three parts of the course, but it is expected that most course participants will not (yet!) know what all these topics mean.

Introduction and Course-Wide Information (Start Here)

Welcome! Start here! Learn about this course and how it's organized.

What's included

7 videos 5 readings 1 discussion prompt

7 videos • Total 56 minutes

  • Welcome! (And Some Course Mechanics) • 9 minutes • Preview module
  • Optional: Who I Am / Acknowledgments • 6 minutes
  • What the Course is About / Initial Motivation • 8 minutes
  • Recommended Background • 9 minutes
  • Why Part A, Part B, Part C • 5 minutes
  • Grading Policy • 9 minutes
  • Optional: Very High-Level Outline • 7 minutes

5 readings • Total 37 minutes

  • Start here! • 5 minutes
  • About the Course • 10 minutes
  • Some More Perspective on Recommended Background • 7 minutes
  • Why are there 3 courses (Part A, Part B, Part C)? • 5 minutes
  • Grading Policy Details • 10 minutes

1 discussion prompt • Total 5 minutes

  • Discussion Forums: Why Are You Participating? • 5 minutes

Software Installation and Homework 0

This module contains two things: (1) The information for the [unusual] software you need to install for Programming Languages Part A. (2) An optional "fake" homework that you can turn in for auto-grading and peer assessment to get used to the mechanics of assignment turn-in that we will use throughout the course. You can do this module either before or after watching the first few "actual course content" videos in the next module, but you will want to get the software installed soon so you can learn by actively trying out variations on the code in the videos. You will need to install the software to do the homework.

4 videos 3 readings 1 programming assignment 1 peer review

4 videos • Total 9 minutes

  • Software Installation Introduction • 1 minute • Preview module
  • Emacs installation • 2 minutes
  • SML installation • 1 minute
  • SML Mode installation • 3 minutes

3 readings • Total 65 minutes

  • Part A Software Installation and Use: SML and Emacs • 60 minutes
  • Why Emacs? (Optional) • 5 minutes
  • Homework 0 Detailed Peer-Assessment Instructions • 0 minutes

1 programming assignment • Total 20 minutes

  • Homework 0 (Auto-Grader) • 20 minutes

1 peer review • Total 20 minutes

  • Homework 0 (Peer Assessment) • 20 minutes

Section 1 and Homework 1

It's time to dive in! Start with a careful reading of the "Section 1 Welcome Message" and go from there.

17 videos 6 readings 1 programming assignment 1 peer review

17 videos • Total 150 minutes

  • ML Variable Bindings and Expressions • 14 minutes • Preview module
  • Rules for Expressions • 9 minutes
  • The REPL and Errors • 12 minutes
  • Shadowing • 6 minutes
  • Functions Informally • 7 minutes
  • Functions Formally • 8 minutes
  • Pairs and Other Tuples • 9 minutes
  • Introducing Lists • 10 minutes
  • List Functions • 11 minutes
  • Let Expressions • 7 minutes
  • Nested Functions • 7 minutes
  • Let and Efficiency • 10 minutes
  • Options • 9 minutes
  • Booleans and Comparison Operations • 7 minutes
  • Benefits of No Mutation • 7 minutes
  • Optional: Java Mutation • 4 minutes
  • Pieces of a Language • 6 minutes

6 readings • Total 12 minutes

  • Section 1 Welcome Message • 7 minutes
  • Section 1 Reading Notes • 0 minutes
  • Code Files for All Section 1 Videos • 0 minutes
  • Homework 1 Detailed Guidelines for Peer Assessment • 0 minutes
  • Hints and Gotchas for Homework 1 • 5 minutes
  • Extra Practice Problems • 0 minutes

1 programming assignment • Total 180 minutes

  • Homework 1 (Auto-Grader) • 180 minutes

1 peer review • Total 45 minutes

  • Homework 1 • 45 minutes

Section 2 and Homework 2

This section is a particularly rewarding one where a lot of ideas come together to reveal a surprisingly elegant underlying structure in ML. As usual, start with the welcome reading, dive into the material, and leave plenty of time to approach the programming assignment methodically.

22 videos 6 readings 1 programming assignment 1 peer review

22 videos • Total 178 minutes

  • Building Compound Types • 5 minutes • Preview module
  • Records • 8 minutes
  • Tuples as Syntactic Sugar • 6 minutes
  • Datatype Bindings • 8 minutes
  • Case Expressions • 10 minutes
  • Useful Datatypes • 11 minutes
  • Pattern Matching So Far • 4 minutes
  • Another Expression Example • 8 minutes
  • Type Synonyms • 6 minutes
  • Lists and Options are Datatypes • 9 minutes
  • Polymorphic Datatypes • 8 minutes
  • Each of Pattern Matching / Truth About Functions • 14 minutes
  • A Little Type Inference • 6 minutes
  • Polymorphic and Equality Types • 8 minutes
  • Nested Patterns • 10 minutes
  • More Nested Patterns • 10 minutes
  • Nested Patterns Precisely • 6 minutes
  • Optional: Function Patterns • 3 minutes
  • Exceptions • 7 minutes
  • Tail Recursion • 9 minutes
  • Accumulators for Tail Recursion • 7 minutes
  • Perspective on Tail Recursion • 5 minutes
  • Section 2 Welcome Message • 5 minutes
  • Section 2 Reading Notes • 0 minutes
  • Code Files for All Section 2 Videos • 0 minutes
  • Homework 2 Detailed Guidelines for Peer Assessment • 0 minutes
  • Hints and Gotchas for Homework 2 • 7 minutes
  • Homework 2 • 180 minutes
  • Homework 2 • 45 minutes

Section 3 and Homework 3 -- and Course Motivation

This section is all about higher-order functions -- the feature that gives functional programming much of its expressiveness and elegance -- and its name! As usual, the first reading below introduces you to the section, but it will make more sense once you dive in to the lectures. Also be sure not to miss the material on course motivation that we have put in a "lesson" between the other videos for this week and the homework assignment. The material is "optional" in the sense that it is not needed for the homeworks or next week's exam, but it is still very highly encouraged to better understand why the course (including Parts B and C) covers what it does and, hopefully, will change the way you look at software forever.

28 videos 6 readings 1 programming assignment 1 peer review

28 videos • Total 247 minutes

  • Introduction to First-Class Functions • 7 minutes • Preview module
  • Functions as Arguments • 8 minutes
  • Polymorphic Types and Functions as Arguments • 7 minutes
  • Anonymous Functions • 9 minutes
  • Unnecessary Function Wrapping • 5 minutes
  • Map and Filter • 8 minutes
  • Generalizing Prior Topics • 9 minutes
  • Lexical Scope • 7 minutes
  • Lexical Scope and Higher-Order Functions • 7 minutes
  • Why Lexical Scope • 11 minutes
  • Closures and Recomputation • 6 minutes
  • Fold and More Closures • 11 minutes
  • Closure Idiom: Combining Functions • 9 minutes
  • Closure Idiom: Currying • 10 minutes
  • Partial Application • 9 minutes
  • Currying Wrapup • 6 minutes
  • Mutable References • 8 minutes
  • Closure Idiom: Callbacks • 8 minutes
  • Standard-Library Documentation • 7 minutes
  • Optional: Abstract Data Types With Closures • 11 minutes
  • Optional: Closure Idioms Without Closures • 4 minutes
  • Optional: Java Without Closures • 12 minutes
  • Optional: C Without Closures • 10 minutes
  • Course-Motivation Introduction • 5 minutes
  • Why Study General PL Concepts? • 10 minutes
  • Are All PLs the Same? • 6 minutes
  • Why Functional Languages? • 11 minutes
  • Why ML, Racket, and Ruby? • 12 minutes

6 readings • Total 15 minutes

  • Section 3 Welcome Message • 5 minutes
  • Section 3 Reading Notes • 0 minutes
  • Code Files for All Section 3 Videos • 0 minutes
  • Homework 3 Detailed Guidelines for Peer Assessment • 0 minutes
  • Hints and Gotchas for Section 3 • 10 minutes
  • Homework 3 • 180 minutes
  • Homework 3 • 45 minutes

Section 4 and Part-A Exam

We finish Part A of the course with this module. As explained in more detail in the welcome message, we discuss type inference, ML's module system, and the fundamental idea in computing of two computations being equivalent. There is no programming assignment -- instead there is an exam covering all of Part A. Finally, there is a brief wrap-up video for the end of Part A that also looks ahead to Part B and Part C -- we have put it after the exam, so don't overlook it.

19 videos 5 readings 2 quizzes

19 videos • Total 144 minutes

  • Section Introduction • 1 minute • Preview module
  • What is Type Inference • 5 minutes
  • ML Type Inference • 6 minutes
  • Type Inference Examples • 10 minutes
  • Polymorphic Examples • 10 minutes
  • Optional: The Value Restriction and Other Type-Inference Challenges • 9 minutes
  • Mutual Recursion • 9 minutes
  • Modules for Namespace Management • 6 minutes
  • Signatures and Hiding Things • 7 minutes
  • A Module Example • 11 minutes
  • Signatures for Our Example • 11 minutes
  • Signature Matching • 4 minutes
  • An Equivalent Structure • 6 minutes
  • Another Equivalent Structure • 9 minutes
  • Different Modules Define Different Types • 3 minutes
  • Equivalent Functions • 8 minutes
  • Standard Equivalences • 10 minutes
  • Equivalence Versus Performance • 6 minutes
  • Part A Wrap-Up & Parts B&C Preview • 6 minutes

5 readings • Total 17 minutes

  • Section 4 Welcome Message • 7 minutes
  • Section 4 Reading Notes • 0 minutes
  • Code Files for All Section 4 Videos • 0 minutes
  • Nothing (yet) (explanation) • 0 minutes
  • Information About the Exam (Required Reading) • 10 minutes

2 quizzes • Total 120 minutes

  • Exam for Part A • 60 minutes
  • Practice Exam for Part A • 60 minutes

Instructor ratings

We asked all learners to give feedback on our instructors based on the quality of their teaching style.

basic programming homework

Founded in 1861, the University of Washington is one of the oldest state-supported institutions of higher education on the West Coast and is one of the preeminent research universities in the world.

Recommended if you're interested in Software Development

basic programming homework

University of Washington

Programming Languages, Part C

basic programming homework

Programming Languages, Part B

basic programming homework

University of Toronto

Learn to Program: Crafting Quality Code

basic programming homework

Learn to Program: The Fundamentals

Why people choose coursera for their career.

basic programming homework

Learner reviews

Showing 3 of 1817

1,817 reviews

Reviewed on Jan 29, 2023

Great course! I learned the ML programming language and functional programming in general. I recommend it to everyone interested in programming. Assignments are interesting and fun.

Reviewed on Nov 23, 2023

This is one of the best courses I've taken - not only in terms of structure and content but also in terms of quizzes, programming assignments and exams (practice and final).

Reviewed on Jun 7, 2020

Dan is a great teacher and the course material is very well organized and informative. Highly recommend this course to people who'd like to understand the principles of programming language.

New to Software Development? Start here.

Placeholder

Open new doors with Coursera Plus

Unlimited access to 7,000+ world-class courses, hands-on projects, and job-ready certificate programs - all included in your subscription

Advance your career with an online degree

Earn a degree from world-class universities - 100% online

Join over 3,400 global companies that choose Coursera for Business

Upskill your employees to excel in the digital economy

Frequently asked questions

When will i have access to the lectures and assignments.

Access to lectures and assignments depends on your type of enrollment. If you take a course in audit mode, you will be able to see most course materials for free. To access graded assignments and to earn a Certificate, you will need to purchase the Certificate experience, during or after your audit. If you don't see the audit option:

The course may not offer an audit option. You can try a Free Trial instead, or apply for Financial Aid.

The course may offer 'Full Course, No Certificate' instead. This option lets you see all course materials, submit required assessments, and get a final grade. This also means that you will not be able to purchase a Certificate experience.

What will I get if I purchase the Certificate?

When you purchase a Certificate you get access to all course materials, including graded assignments. Upon completing the course, your electronic Certificate will be added to your Accomplishments page - from there, you can print your Certificate or add it to your LinkedIn profile. If you only want to read and view the course content, you can audit the course for free.

What is the refund policy?

You will be eligible for a full refund until two weeks after your payment date, or (for courses that have just launched) until two weeks after the first session of the course begins, whichever is later. You cannot receive a refund once you’ve earned a Course Certificate, even if you complete the course within the two-week refund period. See our full refund policy Opens in a new tab .

Is financial aid available?

Yes. In select learning programs, you can apply for financial aid or a scholarship if you can’t afford the enrollment fee. If fin aid or scholarship is available for your learning program selection, you’ll find a link to apply on the description page.

More questions

How to Learn Programming – The Guide I Wish I Had When I Started Learning to Code

Jacob Stopak

Just the thought of learning to code can be very intimidating. The word code is mysterious by definition. It implies a technical form of communication that computers, and not humans, are meant to understand.

One way many people start learning to code is by picking a popular programming language and jumping in head first with no direction. This could take the form of an online coding course, a tutorial project, or a random book purchase on a specific topic.

Rarely do prospective developers start with a roadmap – a bird's eye view of the coding world that outlines a set of relevant programming concepts, languages, and tools that almost 100% of developers use every day.

In this article, I propose one such roadmap. I do this by outlining 14 steps – each one discussing an essential concept, language, or tool – that professional developers use to write code, collaborate, and create professional projects.

I meticulously chose these 14 steps based on my own personal journey learning to code, which spans almost 20 years.

Part of the reason it took me so long to feel comfortable as a developer is that I would learn about specific topics without a broader context of the coding world.

Each of the steps in this article discusses a "coding essential" – something that I believe is critical to at least know that it exists at the start of your coding journey.

One final note before listing the steps in the roadmap: of course reading this article will not make you an expert programmer. It isn't meant to. The purpose of this article is to make you aware that each one of these topics exists, and hopefully give you a basic idea of how each one works so you can build on it intelligently going forward.

14 Step Roadmap for Beginner Developers

  • Familiarize Yourself with Computer Architecture and Data Basics
  • Learn How Programming Languages Work
  • Understand How the Internet Works
  • Practice Some Command-Line Basics
  • Build Up Your Text Editor Skills with Vim
  • Take-up Some HTML
  • Tackle Some CSS
  • Start Programming with JavaScript
  • Continue Programming with Python
  • Further Your Knowledge with Java
  • Track Your Code using Git
  • Store Data Using Databases and SQL
  • Read About Web Frameworks and MVC
  • Play with Package Managers

Without further ado, let's start at the top!

1) Familiarize Yourself with Computer Architecture and Data Basics

One of the wonderful things about modern programming languages is that they enable us to create fancy applications without worrying about the nitty-gritty details of the hardware behind the scenes (for the most part).

This is called abstraction – the ability to work with higher-level tools (in this case programming languages) that simplify and narrow down the required scope of our understanding and skills.

However, that doesn't mean it's useless to know the basics of the metal that your code is executing on. At the very least, being aware of a few tidbits will help you navigate workplace conversations about high CPU and memory usage.

So, here is a bare minimum of computer architecture basics to get you started:

Your computer's most important parts live on microchips (also known as integrated circuits ).

Microchips rely on an electrical component called a transistor to function. Transistors are tiny electrical switches that are either off (0) or on (1) at any given time. A single microchip can contain millions or billions of tiny transistors embedded on it.

Most modern computers have a microchip called the Central Processing Unit (CPU) . You can think of it as the computer’s brain. It handles most of the number crunching and logical tasks that the computer performs.

Each CPU has something called an instruction set , which is a collection of binary (zeros and ones) commands that the CPU understands. Luckily, we don't really need to worry about these as software devs! That is the power of abstraction.

If the CPU is the logical center of the brain, it is useful to have memory as well to store information temporarily or for the long term.

Computers have Random Access Memory (RAM) as "working memory" (or short-term memory) to store information that is actively being used by running programs.

RAM is made up of a collection of memory addresses , which can be used to store bits of data. In older languages like C, programmers do have access to working directly with memory addresses using a feature called pointers , but this is rare in more modern languages.

Finally, we'll touch on a component you're surely familiar with – the hard drive. In our analogy of the brain, this represents long-term memory. A hard drive is an internal or external device that stores data that should persist even after the computer is turned off.

Before moving on to more details about programming languages, let's spend a second talking about data. But what exactly do we mean by the word data ?

At a high level, we think of things like text documents, images, videos, emails, files, and folders. These are all high-level data structures that we create and save on our computers every day.

But underneath the hood, a computer chip (like a CPU or RAM chip) has no idea what an "image" or a "video" is.

From a chip’s perspective, all of these structures are stored as long sequences of ones and zeros. These ones and zeros are called bits .

Bits are commonly stored in a set of eight at a time, known as a byte . A byte is simply a sequence of eight bits, such as 00000001 , 01100110 , or 00001111 . Representing information in this way is called a binary representation .

2) Learn How Programming Languages Work

In the previous section, we mentioned that most computers rely on a CPU, and a CPU can understand a specific set of instructions in the form of ones and zeros.

Therefore, we could theoretically write code that tells the CPU what to do by stringing together long sequences of ones and zeros in a form the CPU understands. Instructions written in binary form like this are called machine code .

Sounds horrible to work with, doesn't it? Well it probably is, but I wouldn't know since I mostly use higher-level programming languages like JavaScript, Python, and Java.

A higher-level programming language provides a set of human-readable keywords, statements, and syntax rules that are much simpler for people to learn, debug, and work with.

Programming languages provide a means of bridging the gap between the way our human brains understand the world and the way computer brains (CPUs) understand the world.

Ultimately, the code that we write needs to be translated into the binary instructions (machine code) that the CPU understands.

Depending on the language you choose, we say that your code is either compiled or interpreted into machine code capable of being executed by your CPU. Most programming languages include a program called a compiler or an interpreter which performs this translation step.

Just to give a few examples – JavaScript and Python are interpreted languages while Java is a compiled language. Whether a language is compiled or interpreted (or some combination of the two) has implications for developer convenience, error handling, performance, and other areas, but we won't get into those details here.

3) Understand How the Internet Works

Whatever type of programming you aspire to do, you'll run into situations where it helps to know how computers interact with each other. This typically occurs over the Internet.

The Internet is nothing more than a global collection of connected computers. In other words, it is a global network. Each computer in the network agrees on a set of rules that enable them to talk to each other. To a computer, "talking" means transferring data.

As we discussed in the previous section, all types of data – web pages, images, videos, emails, and so on – can all be represented as ones and zeros.

Therefore, you can think of the Internet as a very large set of computers that can transfer ones and zeros amongst themselves, in a way that preserves the meaning of that data. The Internet is nothing more than a digital conversation medium.

If the Internet is just a big conversation arena, let’s define the conversation participants.

First, an analogy: most human conversations require at least two participants. In most cases, one person initiates the conversation and the other person responds, assuming they are both present and available.

In Internet speak, the computer initiating the conversation is called the client . The computer responding or answering is called the server .

For example, let’s say you open a web browser and go to "www.google.com". In this scenario, your web browser is the client. By extension, you can also think of the computer you are working on as the client.

In a more abstract sense, YOU are the client because you are the one initiating the conversation. By typing "www.google.com" into the search bar and clicking <ENTER>, your browser is requesting to start a conversation with one of Google’s computers.

Google’s computer is called the server. It responds by sending the data required to display Google’s web page in your browser. And voilà! Google’s web page appears in front of your eyes. All Internet data transfers utilize this sort of client/server relationship.

4) Practice Some Command-Line Basics

The Command Line can be intimidating at first glance. It is often featured in movies as a cryptic black screen with incomprehensible text, numbers, and symbols scrolling by. It is usually associated with an evil hacker or genius techie sidekick.

The truth is that it doesn’t take a genius to use or understand the command line. In fact, it allows us to perform many of the same tasks that we are comfortable doing via a point-and-click mouse.

The main difference is that it primarily accepts input via the keyboard, which can speed up inputs significantly once you get the hang of it.

You can use the Command Line to browse through folders, list a folder’s contents, create new folders, copy and move files, delete files, execute programs, and much more. The window in which you can type commands on the Command Line is called a terminal .

Let's walk through a short tutorial of basic navigation commands that will give you a feel for working on the command line.

Once you open your terminal, a typical first question is " Where am I"? We can use the pwd command (which stands for "Print Working Directory") to figure that out. It outputs our current location in the file system which tells us which folder we are currently in.

Try it yourself:

How to Use the Command Line

If you’re on a Mac, open the Terminal app, which is essentially a Unix Command Line terminal.

If you’re running an operating system without a GUI (Graphical User Interface), like Linux or Unix, you should be at the Command Line by default when you start the computer. If your flavor of Linux or Unix does have a GUI, you’ll need to open the terminal manually.

At the prompt, type pwd and press <ENTER>. The Command Line will print out the path to the folder that you’re currently in.

By default, the active folder when opening the Command Line is the logged-in user’s home directory. This is customizable in case you want the convenience of starting in a different location.

For convenience, the home directory can be referenced using the tilde ~ character. We will use this in a few examples going forward.

Now that we know what folder we’re in, we can use the ls command to list the contents of the current directory. The ls command stands for "List".

Type ls and press <ENTER>. The contents (files and subfolders) that reside in the current directory are printed to the screen.

Rerun the previous command like this ls -al and press <ENTER>. Now we will get more details about the directory contents, including file sizes, modification dates, and file permissions.

The hyphen in the previous command allows us to set certain flags that modify the behavior of the command. In this case we added the -a flag which will list all directory contents (including hidden files) as well as the -l flag which displays the extra file details.

Next, we can create a new folder using the mkdir command, which stands for "Make Directory". Below we create a new folder called "testdir".

Type mkdir testdir and press <ENTER>. Then type ls and press <ENTER>. You should see your new directory in the list.

To create multiple nested directories at once, use the -p flag to create a whole chain of directories like this: mkdir -p directory1/directory2/directory3

The Command Line isn’t that useful if we can only stay in one location, so let’s learn how to browse through different directories in the file system. We can do this via the cd command, which stands for "Change Directory".

First, type cd testdir and press <ENTER>. Then type pwd and press <ENTER>. Note the output now shows that we are inside the "testdir" directory specified in the cd command. We browsed into it!

Type cd .. and press <ENTER>. The .. tells the Command Line to browse backwards to the parent directory.

Then type pwd and press <ENTER>. Note the output now shows that you are back in the original directory. We browsed backwards!

Next we’ll learn how to create a new empty file in the current directory.

Type touch newfile1.txt and press <ENTER>. You can use the ls command to see that the new file was created in the current directory.

Now we’ll copy that file from one folder to another using the cp command.

Type cp newfile1.txt testdir and press <ENTER>. Now use the ls and ls testdir commands to see that the new file still exists in the current directory and was copied to the "testdir" directory.

We can also move files instead of copying using the mv command.

Type touch newfile2.txt and press <ENTER> to create a new file. Next, type mv newfile2.txt testdir and press <ENTER> to move the file into the "testdir" folder.

Use the ls and ls testdir commands to confirm that the file has been moved into the "testdir" folder (it should no longer appear in the original location you created it, since it was moved not copied).

The mv command can also be used to rename files.

To do that, type touch newfile3.txt and press <ENTER> to create a new file. Then type mv newfile3.txt cheese.txt and press <ENTER> to update the file’s name. Use ls to confirm that the filed was renamed.

Finally, we can delete files and folders using the rm command.

Type rm cheese.txt and press <ENTER> to remove the file. Use ls to confirm the file was removed.

Type rm -rf testdir and press <ENTER> to remove the "testdir" directory and its contents. Use ls to confirm the directory was removed.

Note that we need to use the -rf flags when removing directories. This forces the removal of the folder and all of its contents.

5) Build Up Your Text Editor Skills with Vim

At this point, we’ve covered the basics of the Command Line and seen a few examples of how we can work with files without a mouse.

Although we now know how to create, copy, move, rename, and delete files from the Command Line, we haven’t seen how we edit the content of text files in the terminal.

Working with text files in the terminal is important because computer code is nothing more than text saved in an organized set of files.

Sure we could use a fancy text editor like Microsoft Word (or more likely specialized code editors like Sublime or Atom) to write and edit our code, but this is not required. The terminal is often the most convenient place to write and edit code since we usually already have it open to run commands!

There are several excellent text editors created specifically for this purpose, and I recommend learning the basics of one called Vim .

Vim is one of the oldest text editors around and it is a time-tested gem. Vim stands for " VI i M proved" since it is the successor to a tool called Vi .

As mentioned, Vim is a text editor that was built to run directly in the terminal, so we don’t need to open a separate window to work in or use a mouse at all. Vim has a set of commands and modes that allow us to conveniently create and edit text content using only the keyboard.

Vim does have bit of a learning curve , but with a little bit of practice, the skills you learn will pay dividends throughout your coding career.

Vim is installed by default on many operating systems. To check if it’s installed on your computer, open the Command Line and type vim -v .

If Vim opens in your terminal and shows the version, you’re good to go! If not, you’ll need to install it on your system. (Note that you can quit Vim by typing :q! and pressing <ENTER>). For more information on installing Vim, see https://www.vim.org.

In my opinion, the quickest and easiest way to learn how to use Vim is to use their built-in tutorial, the VimTutor . To run it, ensure that Vim is installed on your system, open the Command Line, type vimtutor , and press <ENTER>.

It is such a good tutorial that there is no reason for me to waste time trying to explain it here. So go do the VimTutor, like now! See you in the next section.

If you still have energy left after you've completed the VimTutor, check out these 7 Vim commands that will dramatically improve your productivity as you get started with Vim.

6) Take-up Some HTML

You can think of HTML – short for H yper T ext M arkup L anguage – as the bones of a web page. It determines the structure of the page by specifying the elements that should be displayed and the order that they should be displayed in.

Every web page that you’ve ever visited in your browser has some HTML associated with it. When you visit a web page, the web server hosting the web page sends over some HTML to your browser. Your browser then reads it and displays it for you.

Most web pages contain a fairly standard set of content, including a title, text content, links to images, navigation links, headers and footers, and more. All of this information is stored as HTML that defines the structure of the page.

One thing to keep in mind is that HTML is not technically a programming language, although it is often referred to as "HTML code".

As we’ll see later, other programming languages enable us to write code that does stuff , such as running a set of instructions in sequence. HTML doesn’t do anything. We don’t run or execute HTML. HTML just sits there in a file and waits to be sent to a web browser which will display it to the end-user.

In fact, HTML is basically just data. It is data that defines what a web page should look like, nothing more.

So how do you write HTML? HTML uses a standard set of tags (basically just labels) to identify the available elements that make up a web page. Each tag is defined using angle brackets.

For example, the title tag is defined as <title>My Page Title</title> and the paragraph tag is defined as <p>A bunch of random text content.</p> .

Each HTML element is made up of a starting tag and an ending tag. The starting tag is just the tag label in between angle brackets, like this:

<tagname>

This opens the new HTML tag. The ending tag is essentially the same, but it uses a forward slash after the first angle bracket, to mark it as an ending tag:

</tagname>

Any text between the two tags is the actual content that the page will display.

Let’s cover a couple of the most common tags in use. The first is the <html> tag. This defines the start of an HTML page. A corresponding </html> tag (note the forward slash) defines the end of the HTML page. Any content between these tags will be a part of the page.

The second is the <head> tag. This defines additional information that the browser will use to understand the page. Most of the content in this tag is not displayed to the user. A corresponding </head> tag defines the end of the HEAD section.

Previously, we saw the <title> tag. It defines the title of the web page, which the browser will display in the browser tab. This tag needs to be placed inside the <head>...</head> section.

Next is the <body> tag. All content inside this tag makes up the main content of the web page. Putting these four tags together looks something like this:

The simple HTML snippet above represents a simple web page with a title and a single paragraph as body content.

This example brings up a point we didn’t mention in the last section. HTML tags can be nested inside each other. This just means that HTML tags can be placed inside other HTML tags.

HTML provides many other tags to provide a rich set of content to web users. We won't cover them in detail here, but below is a short list for reference:

  • <p> : A paragraph of text starting on a new line.
  • <h1> : A page heading usually used for page titles.
  • <h2> : A section heading usually used for section titles.
  • <hx> : Where x is a number between 3 and 6, for smaller headings.
  • <img> : An image.
  • <a> : A link.
  • <form> : A form containing fields or inputs for a user to fill out and submit.
  • <input> : An input field for users to enter information, usually within a form.
  • <div> : A content division, used to group together several other elements for spacing purposes.
  • <span> : Another grouping element, but used to wrap text phrases within another element, usually to apply specific formatting to only a specific part of the text content.

7) Tackle Some CSS

A web page without CSS – or C ascading S tyle S heets – is like a cake without frosting. A frosting-less cake serves its purpose, but it doesn’t look appetizing!

CSS allows us to associate style properties such as background color, font size, width, height, and more with our HTML elements.

Each style property tells the browser to render the desired effect on the screen. Like HTML, CSS is not technically a programming language. It doesn’t let us perform actions, it simply lets us add styles to bare bones HTML.

Let’s see how to associate CSS styles with our HTML elements. There are three pieces to this puzzle:

The CSS selector: Used to identify the HTML element or elements we want the style to apply to.

The CSS property name: The name of the specific style property that we want to add to the matched HTML elements.

The CSS property value: The value of the style property we want to apply.

Here is an example of how these pieces come together to set the color and font size of a paragraph:

Let’s start at the beginning, before the curly braces. This is where the CSS selector goes. In this case, it is the letter p which indicates the <p> (paragraph) HTML tag. This means that the styles inside the curly braces will apply to all <p> tags on the web page.

Let’s move on to what goes inside the curly braces – the styles we want to apply to the targeted elements.

Here we find pairs of CSS properties and values, separated by a colon. The properties (in this case "color" and "font-size") are on the left. The values of these properties (in this case "red" "12px") are on the right. A semicolon ends each property/value pair.

You can probably see how this works. The snippets of CSS code above tell the browser to use red, 12px size letters for all the text placed inside <p> tags.

So how does an HTML page know to include these CSS styles? Enter the <link> HTML tag. Usually, CSS styles are created in separate files ( .css files) from the HTML. This means we need some way to import them into our HTML files so the browser knows that the styles exist.

The <link> element exists for this purpose. We include <link> elements in the <head> section of HTML files which allow us to specify the external CSS files to import:

In this example, we are importing the CSS styles specified by the href attribute, in this case the file /home/style.css .

In the next 3 sections, we'll (finally) dive into some more technical programming languages!

We'll go over a general overview of JavaScript, Python, and Java, as well as walk through some of the essential coding concepts common to the 3 languages. We will compare and contrast the language features and example code so you can hopefully get a well-rounded understanding of the basics of all three.

8) Start Programming with JavaScript

Let’s start by answering the following question: if we can use HTML to build the structure of a web page and CSS to make it look pretty, why do we need JavaScript?

The answer is that we technically don’t. If we are happy with a static site that sits there and looks pretty, we are good to go with just HTML and CSS.

The keyword here is "static". If, however, we want to add dynamic features to our web pages, such as changing content and more complex user interactions, we need to use JavaScript.

What is JavaScript?

So what exactly is JavaScript? JavaScript is a programming language that was created specifically for websites and the Internet. As we mentioned in section 2, most programming languages are either compiled or interpreted, and programs are typically run in a standalone manner.

JavaScript is somewhat unique in this respect in that it was designed to be executed directly inside web browsers. It allows us to write code representing sets of actions that will be executed on our web pages to make our sites much more dynamic.

You can either write JavaScript code in text files named with a .js extension or inside <script> tags directly in the HTML.

For many years, JavaScript code was primarily relegated to running inside web browsers. But the Node.js project changed this paradigm by creating a standalone JavaScript environment that could run anywhere.

Instead of being trapped in a browser (that is, client-side), Node.js can be installed locally on any computer to allow the development and execution of JavaScript code. You can also install Node on web servers which allows you to use JavaScript as backend code for applications instead of simply as web browser frontend code.

Now that we've covered some background, let's dive into a few basics of the JavaScript language.

Variables and Assignment in JavaScript

Variables possibly represent the most fundamental concept in programming. A variable is simply a name or placeholder that is used to reference a particular value.

The word variable implies that the stored value can change throughout the execution of the program.

You can use variables to store numbers, strings of text characters, lists, and other data structures that we will talk more about in a minute.

All programming languages use variables, but the syntax varies between different languages.

Variables are useful since we can reference their values throughout our code. This enables us to check their values as needed and perform different actions depending on how the variable’s value changes.

In JavaScript, we declare variables using the let keyword, like this: let x; .

This declares x as a variable that we can use in our code. Note that we added a semicolon at the end of the line. In JavaScript (and many other languages) semicolons are used to specify the end of each code statement.

Now that we have created the variable x , we can assign a value to it using the equals sign, also called the assignment operator : x = 10;

Here we assigned the number 10 to the variable named x . Now any time we use x in our code, the value 10 will be substituted in.

Both variable declaration and assignment can be done in one line as follows:

Data Types in JavaScript

In the last section, we stored an integer (whole number) value in the variable named x . You can also store decimal numbers, or floating-point numbers as they are known. For example, we could write: let x = 6.6; .

The different types of values we can store in variables are called data types . So far we have only seen numeric data types (integers and floating-point numbers), but we are just scratching the surface. We can store text data in variables as well.

In coding terminology, a piece of text is called a string . We can store a string value in our variable x by surrounding it in either single or double quotes:

The next data type we’ll discuss is the boolean . A boolean can only hold one of two values, true or false – and they must be all lowercase. In JavaScript, true and false are two keywords used specifically as values for boolean variables:

Note that the values true and false don’t appear within quotes the way strings do. If we surround them with quotes, the values would be strings, not booleans.

We often use booleans to control the flow of programs in conditional (if/else) statements which we’ll learn about next.

Program Flow Control Statements in JavaScript

Now that we have an understanding of variables and the basic JavaScript data types, let’s take a look at some things we can do with them.

Variables aren't that useful without being able to tell our code to do something with them. We can make our variables do things by using statements .

Statements are special keywords that allow us to perform some action in our code, often based on the value of a variable we have defined. Statements let us define the logical flow of our programs, as well as perform many useful actions that will dictate how our programs work.

If / Else Statement

The first statement we’ll discuss is the if statement. The if statement allows us to perform some action only when a desired condition is true. Here is how it works:

We defined a variable called x and set its value to 10. Then comes our if statement. After the keyword if , we have a set of parentheses containing the condition to evaluate, in this case, x > 5 . We just defined x to equal 10, so we know that this condition is true in this example.

Since the condition in the parentheses is true, the code between the curly braces will be executed, and we will see the string "X is GREATER than 5!" printed to the screen. (We didn't discuss the meaning of console.log() , so for now just know that it prints the value in the parentheses to the screen).

In the same example, we also included an else statement. This allows us to execute specific code in the event that the condition in the condition is false .

While Loops

The next type of statement we’ll discuss is the while loop . Loops enable us to repeat a block of code as many times as we desire, without copying and pasting the code over and over again.

For example, let’s assume we need to print a sentence to the screen 5 times. We could do it like this:

This works fine for only 5 messages, but what about 100, or 1000? We need a better way to repeat pieces of code multiple times, and loops allow us to do this. In coding terminology, repeating a piece of code multiple times is called iteration.

This following while loop will continue running the block of code inside it as long as the specified condition remains true:

In this example, we initialize x to the value of 1. Then we write a while loop. Similar to the if statement, we add a condition in parentheses. In this case the condition is x <= 100 . This condition will be true as long as x is less than or equal to 100.

Next we specify the block of code to execute in the curly braces. First, we print out our message to the console. Then we increment x by 1.

At this point the loop attempts to re-evaluate the condition to see if it’s still true . Variable x now has a value of 2 since it was incremented in the first loop run. The condition is still true since 2 is less than 100.

The code in the loop repeats until x gets incremented to the value of 101. At this point, x is greater than 100 so the condition is now false , and the code in the loop stops executing.

The HTML <script> Tag

Now that we’ve introduced JavaScript, let’s discuss how to add JavaScript code files into an HTML page. We can do this using an HTML tag that we haven’t discussed yet – the <script> tag.

This is similar to the <link> element that we used to add CSS files to our HTML, except that the <script> element is specifically for JavaScript.

Let’s say we saved one of the previous JavaScript examples we discussed in a file called customscript.js in the same folder as our HTML file. We can add this JavaScript file to our HTML by adding the following HTML tag into the <head>...</head> section of our HTML:

This will load in the JavaScript code from the file, which will execute when the web page is displayed in the browser.

Once you get comfortable with your JavaScript skills, you can try building some of these fun beginner-friendly projects to practice.

9) Continue Programming with Python

Now that you've learned some basic JavaScript, it will be useful to jump into another programming language – Python.

Many programming languages provide a similar set of functionality, including variables, arithmetic operators, if/else statements, loops, and functions.

It's helpful to see how different programming languages implement similar features. The concepts are usually very similar, but the syntax (the way the code is written) varies from language to language.

What is Python?

First we’ll cover a little bit of background information on Python. Like JavaScript, Python is a high- level programming language that prioritizes ease of development over the speed of execution.

In my opinion, Python is one of the best languages for beginners to learn. The syntax is clean and intuitive and it is a very popular language in the open-source and business spheres.

Earlier we talked about compiled languages versus interpreted languages. Python is an interpreted language. Each time we want to run a Python program, the Python interpreter actively processes your code and executes it line by line on your machine.

This is different than compiled languages, in which we would first use a compiler to process the code into a more optimized form (an executable), and then execute it later.

Unlike JavaScript, Python was not built to be run directly inside web browsers. Python was created to be a convenient scripting language – a language that can be used to write code for arbitrary tasks that usually execute on a user’s local computer.

Python code can be executed on any computer that has the Python interpreter installed on it. It is still a commonly used scripting language but is also used extensively for data science and server-side applications.

Variables and Assignment in Python

Like JavaScript, Python allows us to define variables. In Python we can simply use the equals sign to create and assign variables as needed:

There are two differences between the syntax for defining variables in Python and JavaScript. In Python, we don’t need the let keyword and we also don’t need a semi-colon at the end of each line.

Python uses a set of syntax rules based off of whitespace and indentation. This removes the need for line terminating characters like the semi-colon, and block scoping using curly braces.

Data Types in Python

Python also has a set of data types that we can assign to our variables. These include integers, floating-point numbers (decimals), strings, lists, and dictionaries.

Integers, floating-point numbers, and strings are essentially the same as their JavaScript counterparts, so we won’t repeat that information here.

In Python, booleans are very similar to those in JavaScript, except that the keywords True and False must be capitalized:

Program Flow Control Statements

Like in JavaScript, Python has as similar set of flow control statements, but with slightly different syntax.

This is the Python equivalent of the if/else example we saw in the JavaScript section:

We defined a variable called x and set its value to 10, followed by our if statement. Since the condition in the parentheses evaluates to True , the code indented after the if statement will be executed, and we will see the string 'X is GREATER than 5!' printed to the screen.

In Python, we use the print() function for printing information to the screen.

Also note the else statement above, which will print an alternative string to the screen if x if the condition is False .

There are two main differences between the Python code above and the JavaScript code we saw previously. Python uses a colon instead of curly braces to indicate the beginning of the if statement block.

In addition, the indentation of the print() function actually matters in Python. In JavaScript, the indentation or white space between statements doesn’t matter since JavaScript identifies code blocks using curly braces and identifies the end of a statement using a semi-colon. But in this Python example, there are no semi-colons and no curly braces!

That is because Python actually uses the white space and newline characters to identify the end of statements and code blocks.

The colon tells the Python interpreter that the if block is starting. The code that makes up the if block must be indented (1 tab = 4 spaces is the convention) for the Python interpreter to know that it is a part of the if block. The next unindented line will signal the end of the if block.

Next we’ll discuss loops in Python. The while loop in Python is essentially the same as we saw in JavaScript, but with the Python syntax:

The differences between this while loop and the JavaScript version are that:

  • We removed the let when defining our variables.
  • We removed line-ending semicolons.
  • We replaced the curly braces with a colon.
  • We made sure that the code in the loop is indented with a tab.

We printed an additional message outside of the loop to show that unindented lines of code are not a part of the loop and won't be repeated.

For beginner Pythonistas, I recommend taking a peek at the Zen of Python , which is a list of 20 rules-of-thumb for writing Pythonic code.

And when you get comfortable with the basics, try building some of these fun beginner-friendly Python projects .

10) Further Your Knowledge with Java

Now that we’ve worked with a couple of higher-level programming languages, let’s take it one step lower with Java.

Unlike JavaScript and Python which execute source code in real time using an interpreter, Java is a compiled language. This means a compiler is used (instead of an interpreter) to convert Java source code into a form the computer can understand.

Most compilers generate one or more executable files made up of machine code that are ready to run on the specific operating system and hardware platform they were compiled for.

But Java is somewhat special in that it compiles the Java source code into an intermediate form called bytecode . This is different than the machine code that most other compiled languages produce. Java bytecode is intended to be executed by something called the Java Virtual Machine (JVM) .

You can think of the JVM as a program that you install on your computer, which allows you to run Java programs by executing Java bytecode. When people talk about " whether or not Java is installed on a computer ," they are usually asking whether or not the JVM is installed on the computer.

The JVM serves a similar function to the interpreters we discussed in previous chapters. But instead of taking source code (which is stored in .java files) as an input, it takes compiled bytecode.

The benefit of this setup is that it allows bytecode compiled on particular operating systems and platforms to be executed by a JVM on any other platform.

For example, imagine we have a file of Java code that was written and compiled to bytecode on a computer running the Windows operating system. This bytecode can be executed (that is, the program can be run) by a JVM on any platform, including Windows, Mac OS, Linux, and so on.

This is not the case with most compiled executables in other programming languages, which can only execute in the environment which they were compiled for.

Variables and Assignment in Java

One major difference between Java and the languages we have seen so far (Python and JavaScript) is that Java is a statically typed language.

This means that the data types of our variables must be known and established at the time the program is compiled.

Each time we create a variable in Java code, we need to explicitly specify the data type of that variable, such as an integer, string, and so on. This is called variable declaration .

Once we declare a variable’s data type, it can only hold that type of data throughout the execution of the program.

This is very different from JavaScript and Python, where variable data types are established during program execution, also known as run time . Languages like JavaScript and Python are therefore referred to as dynamically typed languages – we don’t explicitly state variable data types in our source code and can easily reassign a variable to any type on the fly.

In Java, we create variables using this syntax:

Here the Datatype is the type of data that the variable will store, such as Integer, String, and so on. Next, the name represents the name of the variable we are defining so we can use it in our code. The value is the actual value we are assigning to the variable. Note that like JavaScript, all Java statements end in a semicolon.

Data Types in Java

In Java, the basic built-in data types are called the primitive data types and they will look very familiar based on what we have seen in higher-level languages like Python and JavaScript. The main primitive types are:

  • Integer int : Stores whole numbers between −2,147,483,648 and 2,147,483,647.
  • Float float : Stores decimal numbers between -3.4x10^38 to -1.4x10^-45 for negative values, 1.4x10^-45 to 3.4x10^38 for positive values.
  • Boolean bool : Stores one of the two boolean values true or false .

Note that there are a few other primitive types (short, long, byte, and double) that we won’t be covering here since they aren’t used as often as the others. Here is how we initialize these data types:

Integer: int x = 100;

Float: float pi = 3.14;

Char: char middleInitial = 'T';

Boolean: bool isHuman = true;

I do want to reiterate that once the data type of a variable is declared, that variable can only hold values of the specified data type.

For example, an error would be thrown if our program tried to store a character value inside a variable that was declared to be an integer. We can’t assign the character 'S' to the integer variable x in the previous example.

The next data type we’ll discuss is the string – a sequence of characters, numbers, or symbols represented as textual data.

Strings in Java are a non-primitive data type, which means they are built up from smaller parts. To declare a string variable we use the String data type and place the assigned value in double-quotes:

Program Flow Control Statements in Java

Like JavaScript, Java uses curly braces to define code blocks for if statements, loops, and functions. We’ll examine the same program control statements as in the previous chapters and update the examples to use the Java syntax.

Here is the Java if/else statement that mirrors the examples in the previous sections:

This basic if example is almost identical to the JavaScript version. The only differences are we declared the datatype of x to be int and we using System.out.println() instead of console.log() to print out our message.

Next, we’ll move on to loops in Java. Since Java and JavaScript syntax are quite similar, the while loop in Java is essentially the same as we saw in JavaScript:

This while loop will print out the specified message 100 times.

This concludes our sections on specific programming languages. It may have been a bit repetitive since we covered the same set of concepts in 3 languages, but hopefully this helped hammer in these basic but fundamental ideas.

Now we'll round out this article with a few in-between topics that you might not otherwise start learning right away.

We'll talk about an essential collaboration tool called Git. Then we'll learn to store and access data in a database. Next we'l briefly touch on Web development frameworks, and finally we'll shed some light on package managers.

11) Track Your Code Using Git

Git is the most popular Version Control System (VCS) in use today. It allows multiple developers to collaborate on software together. In this section we’ll learn what Git is, how it works, and how to use its basic commands.

Before jumping straight into Git, let’s flesh out some concepts common to most programming projects.

The full set of directories and files that make up a software project is called a codebase . The project root is the highest-level folder in the project’s directory tree. Code files can be included directly in the project root or organized into multiple levels of folders.

When the codebase is ready for testing or deployment it can be built into the program that will run on your computer. The build process can include one or more steps that convert the code written by humans into an executable that can be run on your computer’s processing chips.

Once the code is built, your program is ready to run on your specific operating system, such as Linux, Mac OS, or Windows.

Over time, developers update the project code to add new features, fix bugs, implement security updates, and more. In general, there are three ways developers can make these changes to a software project:

  • Add new files and folders to the project
  • Edit the code in existing files and folders
  • Delete existing files and folders

As projects grow and new features are added, the number of files and folders (as well as the amount of code within them) increases. Large projects can grow up to hundreds of thousands of files containing millions of lines of code.

To support this growth, the number of developers on large project teams typically increases. Large software projects can have hundreds or even thousands of developers all working in tandem.

This begs the question: " How the heck do all these developers, who may be geographically spread out all around the world, keep track of their software project code in such a way that they can work together on a single project? "

Development teams need a way to keep track of exactly what changes were made to the code, which files or folders were affected, and who made each change. Each developer also needs to be able to obtain updates from all other developers.

This process is called versioning or version control . Developers use special tools called Version Control Systems (VCS) to track, manage, and share the versions of software projects. Here are a few popular version control systems that are actively used these days:

  • Subversion (SVN)
  • Mercurial (Hg)

However, Git has won the crown as the go-to VCS of the day. It is by far the most popular VCS in use by government, commercial, and open-source communities worldwide.

Git forms the core of popular web-based VCS platforms like GitHub and Bitbucket. Git is an essential tool for any well-rounded developer to add to their skill set.

Basic Git Commands

Git creates and stores information about our software projects in something called a Git repository . A Git repository is just a hidden folder on your computer that Git uses to store data about the code files in a software project.

Each software project we work on typically has its own Git repository for storing information related to that project. This way, code related to different projects on a single computer can be tracked separately.

There are two main ways to create a Git repository on your computer. The first is to create a brand new Git repository in an existing folder on your file system.

To do this, simply open up the Command Line, create a new folder somewhere convenient like on your Desktop, and browse into it:

Now that we created a new folder and browsed into it, we can initialize a new Git repository using the command:

You should see some output similar to the following:

All of the Git commands we’ll run start with the word git followed by a space and then the specific Git command we would like to run. Sometimes we’ll add flags and arguments after the Git commands as well.

The git init command creates a hidden folder called .git in the current directory. This folder is the Git repository we mentioned above. You can see this by running the command ls -al .

The second way to get a Git repository on to your computer is to download one from somewhere else, like Bitbucket or GitHub.

Bitbucket and Github are websites that allow people to host open source projects that can be downloaded to your computer.

If you browse to a project you find interesting on Bitbucket or GitHub, you’ll see a button labeled Clone. This button will provide you a command and URL that you can copy and paste into the command line terminal. It will look something like this:

The git clone command downloads the repository from the specified URL into a new folder on your computer. The URL can either be a web URL as in the example above or an SSH URL as follows:

After running the git clone command, you should see a new folder created. If you browse into it, you’ll see all of the files and subfolders that make up the project you downloaded.

The next command we'll mention is git add <filename.ext> . The git add command is used to tell Git which files we want it to track, and to add changes in already tracked files to Git's staging area .

Once new or changes files have been staged, they can be committed to the repository by using the command git commit -m "Commit message" . This will store the changes in all staged files in the Git repository.

The git status and git log commands are handy for reviewing the current state of the working directory and the commit history of your project.

We barely scratched the surface here. Git has many more essential commands which are definitely worth getting comfortable with.

12) Store Data Using Databases and SQL

A database is a program specifically designed to efficiently store, update, retrieve, and delete large amounts of data. In a nutshell, we can think of a database as a container for a set of tables.

You have probably worked with tables in Microsoft Excel. A table is just a set of columns and rows containing data. We can set up tables in a database to store the information that our programs need to work properly.

Whether we are writing programs in JavaScript, Python, Java, or some other language, we can tell our programs to interact with databases as needed.

We can retrieve data from the database to display to our users on a web page. We can accept a web sign-up form from a user and store that user’s information in a database for later use.

Our programs can interact with databases in real-time as events transpire in our application. To do this, most databases speak a language called SQL , short for Structured Query Language .

SQL is a programming language specifically created for databases. It allows us to tell databases what to do.

A chunk of SQL code is called a query . We can write SQL queries to fetch the data we need at a particular time or to insert new data into a specific table. Roughly speaking there are two main types of SQL queries: read-SQL and write-SQL .

A read-SQL query is one that simply fetches data from the database for us to see or use. It doesn’t change the data in the database at all.

On the other hand, a write-SQL query either inserts new data into a table, updates existing data, or deletes existing data. We’ll learn how to write some basic read-SQL queries in this section.

Before writing a query, it helps to know what we are querying! Traditional databases contain tables made up of columns and rows. When we write a read-SQL query, our goal is usually to retrieve a subset of those rows and columns.

For example, let's say we have a table called PERSON with 4 columns, FIRST_NAME and LAST_NAME . We can use the following query to select all the data from only the FIRST_NAME column:

The SELECT keyword tells the database that we want to retrieve data. It is followed by the name of the column – FIRST_NAME – that we want to get.

Then we use the FROM keyword to tell the database which table we want to get the data from, in this case, the PERSON table. Also, note that all SQL commands are terminated by a semi-colon.

One of the most common requirements we have with data is to filter it. Filtering means restricting the result set based on a specified condition.

For example, we might only want to select rows from the PERSON table for people who are named "PHIL". We can apply filters in SQL queries using the WHERE keyword:

This query would return all columns in the PERSON table since we used an asterisk * in the SELECT clause instead of listing specific column names. Only rows in the PERSON table where the FIRST_NAME is set to "PHIL" would be retrieved.

Lastly, we’ll talk about sorting. There are many times when we’d like to see our query results sorted in a particular order. We can use the ORDER BY clause for this:

This will return all columns in the PERSON table sorted alphabetically by last name.

By default, the results will be sorted in ascending order, from A to Z. We can add the optional ASC or DESC keyword, to specify whether to sort in ascending or descending order:

13) Read About Web Frameworks and MVC

Oftentimes, we’ll find ourselves writing code for very common types of applications. Web applications (or web apps ) are applications that rely on the Internet in order to function. Webapps are some of the most commonly created types of software applications.

A web app is essentially a more functional and robust version of a website. Most web apps implement some backend code that resides on a web server and performs logic behind the scenes to support the application’s functionality.

Common programming languages to use for a web app’s backend code include Python, Java, and JavaScript, among others.

Some functionalities common to most web apps include:

  • Providing a convenient way to dynamically alter content on web pages
  • Performing secure user authentication via a login page
  • Providing robust application security features
  • Reading and writing data to a database

A web framework is a set of code libraries that contain the common functionalities that all web apps use out of the box. Web frameworks provide a system for developers to build their applications without having to worry about writing the code for many of the behind the scenes tasks common to all web apps.

We only need to utilize the parts of the framework that meet the needs of our web app.

For example, if we don’t need to connect to a database in a particular web app, we can just ignore the database features and use the other features that we do need.

We still have the full ability to customize the web pages that make up our application, the user flow, and the business logic. You can think of a web framework as a programming tool suite that we can use to build web apps.

Each programming language we covered in this article has one or more popular web frameworks currently in use. This is great because it gives development teams the flexibility to use the framework of the language that they are the most proficient in.

Java has the Spring Framework that's made especially convenient via Spring Boot . Python has the Django Framework . JavaScript has the Node.js runtime environment with the multiple framework options including Express.js and Meteor.js . These frameworks are all free and open-source.

14) Play with Package Managers

The final topic that we’ll cover in this guidebook is the package manager . Depending on the context, a package can either represent a standalone program that is ready to install on a computer or an external code library that we want to leverage in one of our software projects.

Since our applications often depend on these external code libraries, we also refer to them as dependencies .

A package manager is a program that helps us maintain the dependencies of a system or software project. By "maintain" we mean installing, updating, listing, and uninstalling the dependencies as needed.

Depending on the context, the package managers we’ll discuss can either be used to maintain the programs we have installed on our operating systems or to maintain the dependencies of a software project.

Mac OS X: Homebrew

Homebrew is the most popular package manager for the Mac OS X operating system. It offers a convenient way to install, update, track, list, and uninstall packages and applications on your Mac.

Many applications that can be installed via downloaded .dmg files can also be downloaded and installed using Homebrew.

Here is an example of installing the wget package via Homebrew:

Linux: Apt and Yum

Since Linux was built around the Command Line, it’s no surprise that package managers are the default way to install programs.

Most mainstream flavors of Linux ship with a built-in package manager. Advanced Package Tool (APT) is the native package manager for Debian and Ubuntu-based Linux distributions. Yellowdog Updater, Modified (YUM) is the native package manager for the RedHat Linux distribution.

Here is an example of installing Vim using APT:

And using Yum:

JavaScript: Node Package Manager (NPM)

Now that we have seen how some OS-level package managers work, let’s take a look at some programming language-specific package managers. These can help us manage the software libraries that many of our coding projects depend on. Node Package Manager (NPM) is installed by default with Node.js.

One difference between NPM and the previous package managers we have seen is that NPM can be run in local or global mode. Local mode is used to install a package only within a particular project/directory we are working on, while global mode is used to install the package on the system.

By default, packages are installed locally, but you can use the -g flag to install a package globally:

Python: Pip

Python also has a package manager called Pip . Pip may already be installed on your system as it comes prepackaged with recent versions of Python. Pip allows us to easily install packages from the Python Package Index using the pip install <package-name> command:

Java: Apache Maven

Apache Maven (usually referred to as simply Maven ) is a free and open-source tool suite that includes dependency management.

Maven is mostly used for Java projects although it does support other languages as well. Maven usage is a bit more complicated and it can do a lot of things, so we won't get into the weeds here.

In this article, I introduced a set of essential coding concepts and tools with the intention of presenting a bird’s eye view of software development that I wish I had when I started learning to code.

I covered topics including the Internet, several programming languages, version control systems, and databases with the goal of describing how these pieces of the puzzle fit together.

If you enjoyed this article, I wrote a book called the Coding Essentials Guidebook for Developers which has 14 chapters, each covering one of the topics discussed in this post.

In the book I go into even more depth on these 14 subjects, so that might be a good resource for you to check out if you got value out of this article.

After reading this, you may feel drawn to a particular language, tool, or concept. If this is the case I encourage you to dive deeper into that area to further your learning.

If you have any questions, suggestions, or concerns about this book, I would love to hear from you at [email protected] .

Read more posts .

If you read this far, thank the author to show them you care. Say Thanks

Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started

Learn C practically and Get Certified .

Popular Tutorials

Popular examples, reference materials, learn c interactively, learn c programming.

C is a powerful general-purpose programming language. It can be used to develop software like operating systems, databases, compilers, and so on. C programming is an excellent language to learn to program for beginners.

Our C tutorials will guide you to learn C programming one step at a time.

Don't know how to learn C Programming, the right way? Enroll in our Interactive C Course for FREE.

C Introduction

C flow control, c functions, structure and union, additional topics, about c programming.

  • Why learn C ?
  • How to learn C?
  • C Programming Resources
  • Keywords & Identifier
  • Variables & Constants
  • C Data Types
  • C Input/Output
  • C Operators
  • C Introduction Examples
  • C if...else
  • C while Loop
  • C break and continue
  • C switch...case
  • C Programming goto
  • Control Flow Examples
  • C Programming Functions
  • C User-defined Functions
  • C Function Types
  • C Recursion
  • C Storage Class
  • C Function Examples
  • C Programming Arrays
  • C Multi-dimensional Arrays
  • C Arrays & Function
  • C Programming Pointers
  • C Pointers & Arrays
  • C Pointers And Functions
  • C Memory Allocation
  • Array & Pointer Examples

C Programming Strings

  • C Programming String
  • C String Functions
  • C String Examples
  • C Structure
  • C Struct & Pointers
  • C Struct & Function
  • C struct Examples

C Programming Files

  • C Files Input/Output
  • C Files Examples
  • C Enumeration
  • C Preprocessors
  • C Standard Library
  • C Programming Examples
  • Procedural Language - Instructions in a C program are executed step by step.
  • Portable - You can move C programs from one platform to another, and run it without any or minimal changes.
  • Speed - C programming is faster than most programming languages like Java, Python, etc.
  • General Purpose - C programming can be used to develop operating systems, embedded systems, databases, and so on.

Why Learn C Programming?

  • C helps you to understand the internal architecture of a computer, how computer stores and retrieves information.
  • After learning C, it will be much easier to learn other programming languages like Java, Python, etc.
  • Opportunity to work on open source projects. Some of the largest open-source projects such as Linux kernel, Python interpreter, SQLite database, etc. are written in C programming.

How to learn C Programming?

  • Interactive C Course - Want to learn C Programming by solving quizzes and challenges after learning each concept? Enroll in our C Interactive Course for FREE.
  • C tutorial from Programiz - We provide step by step C tutorials, examples, and references. Get started with C.
  • Official C documentation - Might be hard to follow and understand for beginners. Visit official C Programming documentation.
  • Write a lot of C programming code - The only way you can learn programming is by writing a lot of code.

C Resources

  • Interactive C Course
  • What is C Programming?
  • C Programming References

JS Tutorial

Js versions, js functions, js html dom, js browser bom, js web apis, js vs jquery, js graphics, js examples, js references, javascript tutorial.

JavaScript is the world's most popular programming language.

JavaScript is the programming language of the Web.

JavaScript is easy to learn.

This tutorial will teach you JavaScript from basic to advanced.

Examples in Each Chapter

With our "Try it Yourself" editor, you can edit the source code and view the result.

My First JavaScript

Try it Yourself »

Use the Menu

We recommend reading this tutorial, in the sequence listed in the menu.

If you have a large screen, the menu will always be present on the left.

If you have a small screen, open the menu by clicking the top menu sign ☰ .

Learn by Examples

Examples are better than 1000 words. Examples are often easier to understand than text explanations.

This tutorial supplements all explanations with clarifying "Try it Yourself" examples.

If you try all the examples, you will learn a lot about JavaScript, in a very short time!

Why Study JavaScript?

JavaScript is one of the 3 languages all web developers must learn:

   1. HTML to define the content of web pages

   2. CSS to specify the layout of web pages

   3. JavaScript to program the behavior of web pages

This tutorial covers every version of JavaScript:

  • The Original JavaScript ES1 ES2 ES3 (1997-1999)
  • The First Main Revision ES5 (2009)
  • The Second Revision ES6 (2015)
  • The Yearly Additions (2016, 2017 ... 2021, 2022)

Advertisement

Learning Speed

In this tutorial, the learning speed is your choice.

Everything is up to you.

If you are struggling, take a break, or re-read the material.

Always make sure you understand all the "Try-it-Yourself" examples.

The only way to become a clever programmer is to: Practice. Practice. Practice. Code. Code. Code !

Test Yourself With Exercises

Create a variable called carName and assign the value Volvo to it.

Start the Exercise

Commonly Asked Questions

  • How do I get JavaScript?
  • Where can I download JavaScript?
  • Is JavaScript Free?

You don't have to get or download JavaScript.

JavaScript is already running in your browser on your computer, on your tablet, and on your smart-phone.

JavaScript is free to use for everyone.

My Learning

Track your progress with the free "My Learning" program here at W3Schools.

Log in to your account, and start earning points!

This is an optional feature. You can study at W3Schools without using My Learning.

basic programming homework

JavaScript References

W3Schools maintains a complete JavaScript reference, including all HTML and browser objects.

The reference contains examples for all properties, methods and events, and is continuously updated according to the latest web standards.

JavaScript Quiz Test

Test your JavaScript skills at W3Schools!

Start JavaScript Quiz!

JavaScript Exam - Get Your Diploma!

Kickstart your career.

Get certified by completing the course

Get Certified

COLOR PICKER

colorpicker

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail: [email protected]

Top Tutorials

Top references, top examples, get certified.

IMAGES

  1. PPT

    basic programming homework

  2. which programming language to learn first for beginners ?

    basic programming homework

  3. PPT

    basic programming homework

  4. PPT

    basic programming homework

  5. Do My Programming Homework (Get Programming Help Right Now)

    basic programming homework

  6. Programming Practise Questions (Homework 8)

    basic programming homework

VIDEO

  1. Programming Basics: Input, Processing, Output and Memory

  2. Programming Homework Helper

  3. Introduction to Computer Programming

  4. Master the Basics: C Programming Introduction

  5. Java Tutorial: Shuffling and Dealing a Deck of Cards

  6. Programming in Python: Explain Homework #3, Lottery

COMMENTS

  1. Welcome to freeCodeCamp's curriculum

    If you feel overwhelmed, that is normal. Programming is hard. Practice is the key. Practice, practice, practice. And this curriculum will give you thousands of hours of hands-on programming practice. And if you want to learn more math and computer science theory, we also have thousands of hours of video courses on freeCodeCamp's YouTube channel.

  2. Learn How to Code

    AI-Assisted Learning Get coding help quickly and when you need it to speed up your learning journey. Our AI features help you understand errors and solution code faster and get personalized feedback. Mobile IDE. Portfolio Project Assistance. Integrated Reference Docs. Explore features. Meet the creator of the course.

  3. Python Basic Exercise for Beginners with Solutions

    Write a program to remove characters from a string starting from zero up to n and return a new string. For example: remove_chars("pynative", 4) so output must be tive. Here, we need to remove the first four characters from a string. remove_chars("pynative", 2) so output must be native. Here, we need to remove the first two characters from a string.

  4. Java Exercises

    14. Write a Java Program to Compute the Sum of Array Elements. Input: [ 2, 4, 6, 7, 9] Output: 28 Click Here for the Solution 15. Write a Java Program to Find the Largest Element in Array Input: [ 7, 2, 5, 1, 4] Output: 7 Click Here for the Solution 16. Write Java Program to Find the Tranpose of Matrix

  5. Programiz: Learn to Code for Free

    Self-paced curated courses just for you! Check out our app library and download the one that you want to learn. Learn to code in Python, C/C++, Java, and other popular programming languages with our easy to follow tutorials, examples, online compiler and references.

  6. Computer Programming Basics

    Computer programming is the process of designing and writing computer programs. As a skill set, it includes a wide variety of different tasks and techniques, but our tutorials are not intended to teach you everything. Instead, they are meant to provide basic, practical skills to help you understand and write computer code that reflects things ...

  7. Python Exercises, Practice, Challenges

    Each exercise has 10-20 Questions. The solution is provided for every question. Practice each Exercise in Online Code Editor. These Python programming exercises are suitable for all Python developers. If you are a beginner, you will have a better understanding of Python after solving these exercises. Below is the list of exercises.

  8. Basic Programming Problems

    Learn Programming - How To Code. In the world of programming, mastering the fundamentals is key to becoming a proficient developer.In this article, we will explore a variety of basic programming problems that are essential for every aspiring coder to understand. By delving into these foundational challenges, you will gain valuable insights into problem-solving techniques and build a strong ...

  9. What is Programming? A Handbook for Beginners

    🔹 Basic Programming Concepts. Great. If reading this article has helped you confirm that you want to learn programming, let's take your first steps. These are some basic programming concepts that you should know: Variable: a variable is a name that we assign to a value in a computer program. When we define a variable, we assign a value to a ...

  10. Learn Java

    Arrow Chevron Down Icon. Java is an open-source, general-purpose programming language known for its versatility and stability. It's used for everything from building websites to operating systems and wearable devices. You can even find Java in outer space, running the Mars rover.

  11. Computing

    Intro to computer science - Python. Computational thinking with variables. Designing algorithms with conditionals. Simulating phenomena with loops. Playing games with functions. Learn how to code computer programs, how to design algorithms that make computers more efficient, and discover what a career in computing could look like.

  12. Python Practice for Beginners: 15 Hands-On Problems

    Python Practice Problem 1: Average Expenses for Each Semester. John has a list of his monthly expenses from last year: He wants to know his average expenses for each semester. Using a for loop, calculate John's average expenses for the first semester (January to June) and the second semester (July to December).

  13. How to Code

    And coding is a big reason it's happening. There are tons of reasons why you should learn how to code, and I will touch on some of them here. First of all, learning to code greatly enhances your analytical and problem-solving skills. Your earning potential increases: there are senior developers who make $400,000 a year.

  14. Introduction to Python Programming

    Module 1 • 8 hours to complete. This first module covers an intro to programming and the Python language. We'll start by downloading and installing the necessary tools to begin programming and writing code in Python. After learning how to print to the console, we'll get an understanding of Python's basic data types, and how to do simple ...

  15. Introductory Programming

    Language Specific Programming Courses. Beyond the introductions above which use Python, here are several introductions to other programming languages: Julia, MATLAB, Java, and C/C++. Many are taught during MIT's four-week Independent Activities Period (IAP) between the fall and spring semesters.

  16. Assignments

    This section provides the homework assignments and projects for the course along with handouts and supporting files. Browse Course Material ... assignment Programming Assignments. Download Course. Over 2,500 courses & materials Freely sharing knowledge with learners and educators around the world.

  17. Computer programming

    Community. In this course, you'll explore the wonders of what you can create with programming. Learn how to program drawings, animations, and games using JavaScript and the Processing library, and explore the technologies behind the web as you design webpages with HTML and CSS.

  18. Java programming Exercises, Practice, Solution

    Here you have the opportunity to practice the Java programming language concepts by solving the exercises starting from basic to more complex exercises. A sample solution is provided for each exercise. It is recommended to do these exercises by yourself first before checking the solution. Hope, these exercises help you to improve your Java ...

  19. Programming Languages, Part A

    Module 2 • 1 hour to complete. This module contains two things: (1) The information for the [unusual] software you need to install for Programming Languages Part A. (2) An optional "fake" homework that you can turn in for auto-grading and peer assessment to get used to the mechanics of assignment turn-in that we will use throughout the course.

  20. How to Learn Programming

    Type cp newfile1.txt testdir and press <ENTER>. Now use the ls and ls testdir commands to see that the new file still exists in the current directory and was copied to the "testdir" directory. We can also move files instead of copying using the mv command. Type touch newfile2.txt and press <ENTER> to create a new file.

  21. Learn C Programming

    Learn C Programming. C is a powerful general-purpose programming language. It can be used to develop software like operating systems, databases, compilers, and so on. C programming is an excellent language to learn to program for beginners. Our C tutorials will guide you to learn C programming one step at a time.

  22. JavaScript Tutorial

    JavaScript is one of the 3 languages all web developers must learn: 1. HTML to define the content of web pages. 2. CSS to specify the layout of web pages. 3. JavaScript to program the behavior of web pages. This tutorial covers every version of JavaScript: The Original JavaScript ES1 ES2 ES3 (1997-1999)

  23. Python Exercises, Practice, Solution

    Python is a widely used high-level, general-purpose, interpreted, dynamic programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than possible in languages such as C++ or Java. Python supports multiple programming paradigms, including object-oriented ...