Core Concepts I

Learn to Code Today!

Learn 10x faster: coding, no-code and data skills. Join millions of users mastering new tech skills and accelerating their career with Enki.
Get started

This is part of “An intro to Coding” series of posts, with content from the Enki app. If you stumbled upon this, you can start from the beginning.

Let's quickly introduce the building blocks we'll cover in this course.

Program

Even though they're super fast, computers are annoyingly literal - you have to spell out everything for them.

A program consists of one or more commands we're asking the computer to do. It's a sequence of specific tasks. A list of TODOs for the computer.

Variables

For a program to remember values, it needs a place to store them.

This is where variables come in. They serve as storage containers for data.

Data Types

Computers don't know always know the difference between 1 and one. Sometimes we have to help them out.

Using data types, we can mark data with a label that helps the program know the kind of value it holds, such as a number, text, etc.

This is useful because text doesn't have the same capabilities as a number. For example, what's the square root of cat?

Organizing behavior

Using functions we can organize commands into groups and give each group a name.

For example, if you had a program that was meant to simulate a person going for a run, you might have a function called goForARun that makes use of the following commands:

  • lift left leg
  • lift right leg
  • inhale
  • exhale

The function goForARun would now be a new command in your program that consists of 4 subcommands.

Sharing functionality

New commands created with functions can be used anywhere in the program, many times if needed.

For example, you could use the command goForARun anytime your user presses the controls to speed up their game character.

Easier to read

Just like organizing a book by chapters makes the book easier to read, so does organizing your program into functions.

Functions give the program structure.

💡 You should give your functions explanatory names to make it easier for the reader to understand what they do.

About Enki

  • Fully personalized online up-skilling
  • Unlimited AI coaching
  • Designed by Silicon Valley experts

More articles

Meet your AI-enabled coach

Professional athletes have a coach for every aspect of their performance. Why can’t you for your work? Enki’s AI-powered coaching on-demand - combined with state of the art, structured learning content - makes this a reality.
1
1:1 AI Coaching
How do I remove duplicate emails?
Convert the list to a set and back to a list. Sets automatically remove duplicates.
2
Personalized Exercises
3
Interactive practice

Unlock full access to all skills on Enki with a 7-day free trial

Get started