What is The C Programming Language? A Tutorial for Beginners
This tutorial will give you a broad overview of basic concepts of the C programming language. We'll go over the history of the language, why and where it is used, the compilation process, and some very basic programming concepts that are common in most popular programming languages. This is not a complete guide to the language, but will rather give you a high level understanding of important C concepts and ideas as an absolute beginner to coding. Each language has its own syntax and specific ways of doing things, but the concepts covered here are common and applied to all programming languages. Having an understanding of how things work and these universal concepts can take you a long way in your coding journey. It makes learning a new technology easier in the long run. This tutorial takes heavy inspiration from the material covered in the first couple of weeks of the course CS50: Introduction To Computer Science which I highly recommend to anyone wanting to dive deeper into computer science and programming no matter their level of experience. Table of Contents The History behind the origins of C - An Overview Language Characteristics and why to consider learning C Where Is C used? Compilation process: Write-Compile-Run Hello world Header files Main program Comments Output or printing to the console Variables and assignment Assignment Declaring vs initialising a variable A couple rules for naming a variable The scope of a variable Data types Format codes Operators Arithmetic operators Assignment operator Logical operators Comparison operators Functions Function arguments Function outputs Defining a method Calling a function Boolean Expressions Conditional Statements Loops 1. While loops 2. Do-While loops Extra Reading The History of the C Programming Language The history of the C programming language is closely tied to the history of the development of the Unix Operating System. If we look back to understand what led to the development of the operating system that changed the world of computing, we'll see the steps that led to the development of C. Simply put, C was derived from the need to initially find and eventually create a language to apply on the Unix Operating system. Project MAC and MULTICS It all started in 1965 when the experimental project MAC was completed at MIT – the first system of its kind. This was the beginning of the MULTICS era. It used something called CTSS, or the Compatible Time Sharing System. This was a key innovation at that time. Up to this point, we were in the early mainframe era, where massive, powerful, and extremely costly computers used to take up entire rooms. To get tasks done, programmers would write code by hand. Then they'd punch a deck of paper tape cards that were encoded with the program written by hand. They did this by handing the sheets of paper the program was written on to operators who used a key punch machine that would punch the card's holes and represent the data and instructions on the card. Then they'd feed the punched cards to a punch card reader connected to the mainframe computer. It then converted the sequences in the cards holes to digital information. Simple tasks took a long time using this method and only one person could use each machine at a time. The idea of time sharing changed everything. Instead of using cards, it attached multiple consoles (which at the time were mechanical terminals called teletypes) to a main computer. This allowed many people to use the same computer simultaneously. Over 100 typewriter terminals spread around MIT's campus could be attached to one main big computer. This system supported up to 30 remote users at the same time, each using one of those terminals. The operating system of the main computer multitasked and circled around the people who wanted to perform computing tasks from their connected terminals and gave a few seconds to each one. It provided what seemed like a continuous service, appearing to be loading and running many programs simultaneously. But in reality it just went through each user's program very quickly. This gave the illusion that one person had the whole computer to themselves. This system proved to be extremely efficient, effective, and productive, saving time and in the long run money, since those computers were extremely expensive. Something that might have taken days to complete now took much less time. And this started enabling greater access to computing. Following the success of the CTSS, MIT decided it was time to build upon this system and take the next step. This next step would be to create a more advanced time sharing system. But they imagined a more ambitious endeavor than that: they wanted to build a system that would serve as a computing utility for programers that would be capable of supporting hundreds of users accessing the mainframe at the same time. And it would share of data and resources between them. This would require more resources, so they joined forces with General Electric and Bell Labs. This new project was named MULTICS, which stood for 'Multiplexed Information and Computing Service' and was implemented on one of General Electric's mainframes, the GE 635. This team worked on MULTICS for a number of years. But in 1969 Bell Labs left the project because it was taking too long and was too expensive. Bell Labs: The Innovation Hub Bell Labs pulling out of the MULTICS project left some employees frustrated and looking for alternatives. While working on MULTICS, the team created an unparalleled computing environment. They were used to working with time sharing systems and had seen their effectiveness. These programmers had a vast knowledge of operating systems, and the innovations from that project made them want to expand more. A group led mainly by Ken Thompson and Dennis Ritchie wanted to use communal computing and create a file system that they could share. It would have the innovative characteristics they liked from MULTICS but they'd implement it in a simple, smaller, and less expensive way.
Comments
Post a Comment