What about programming?#

Welcome to the first edition of Snefru: Learning Programming with C!

What is programming?#

Programming is a skill that allows you to tell a computer what to do. Programming involves writing a program. This program communicates a set of instructions that the computer can understand. The computer then executes these instructions to accomplish the task you want to do.

To communicate these instructions, we use a programming language. A programming language is a set of rules that allow us to write instructions that the computer can understand. One of the most common programming languages is C.

Why learn programming?#

Now that you know what programming is, you might be wondering why you should learn programming. It seems like there are many engineering systems built in C, but how will this help you?

There are many reasons to learn programming. Here are a few:

  1. Automate your tasks

    Programming can help you automate several day-to-day tasks, avoiding the need to do boring tasks that kill your creativity. Automating a task can arguably save you a lot of time. You will indeed initially spend more time to automate the task, but once automated, you will save a lot of time in the long run.

    A few years ago, one project went viral on GitHub. It has scripts written by an employee to automate jobs that took him more than 90 seconds. Tasks include fixing common problems caused by clients and texting his wife a “late at work” message randomly selected from a list of many reasons. My favorite script connects with the office coffee machine, and sends an order to the machine to start brew coffee before he gets to the machine from his desk.

    Warning

    Disclaimer: The authors are NOT responsible for any damage caused to your relationship or coffee machine if you use the referred code 😄

  2. Acquire transferable skills

    Programming can help you learn how to think logically and solve problems. As you start working on larger projects with several lines of code, you will learn how break down a problem into smaller pieces and solve them. You will learn computational thinking. This is necessary not only to solve problems, but to also communicate your solutions to others. All these skills are important not only for an engineer, but for many other careers.

  3. Allows a wide range of career opportunities

    Since programming involves learning several skills, there is a wide range of careers that you can choose from. For example, you can choose to be a software engineer, a data scientist, a web developer, or a game developer. Software can be used in psychology, medicine, music, film-making and many other fields. For example, in the Electrical and Computer Engineering Department, Professor Jonathan Rose has been using software to build chat-bots for mental health research, and Professor Steve Mann has been using software to build a wearable camera, referred to as EyeTap, that can capture your memories. Even if you are in a non-coding role, knowing how to code will help you collaborate with a programmer to revolutionize your field.

    If I told you 15 years ago that a taxi company will be worth 49B USD today, you would probably think I am crazy. But this is exactly what happened to Uber. The company was founded by two engineers who wanted to solve a problem they had with the taxi service in San Francisco. They wrote a program that matched drivers with passengers. This program was the foundation of the company that is now worth 49B USD.

Why learn C?#

Applicability: C is a general-purpose programming language that is used to write programs for a wide variety of applications. For example, the operating system on your computer, such as Windows, Linux, Mac OS X is mostly written in C. The programs that you use to browse the web and play games are also written in C. Even the compilers such as MINGW and Clang C, which are programs that translate your C code into machine code, are written in C!

Programs running on embedded systems, such as the microcontrollers in your smart phone, your smart watch, and your smart fridge are written in C.

Speed and Energy efficiency: Living in a world run by programs, energy efficiency and speed are important. C is known to be the best energy efficient programming language. Since C is a compiled language, it runs faster than interpreted languages such as Python.

Flexibility: C is a low-level programming language. This means that it gives you more control over the computer. You can directly access the memory of the computer, and you can directly control the hardware of the computer – as we will see in this course. This allows you to write programs that are more efficient and faster.

Transferable knowledge: C has a syntax that is very similar or close to many other programming languages. This will make it easy later on to learn other programming languages.

How to program?#

This is what we answer throughout this book.

Let’s get started 💪.

Who is this book for?#

It is intended to be a resource for students in the first year of the University of Toronto’s APS105: Computer Fundamentals course. It is also intended to be a resource for students who are self-learning C.

Warning

This website is under development.