Introduction
Introduction
Programming
: Introduction
HK Rana
• Why we need programming languages?
• Some myths on programming languages
Contents • What is C?
• Why C is important?
• C’s features, pros, and cons
• What is the need to explore this language?
Why we need
programming languages?
• Programming is using a
language that a machine can
understand in order to get it
to perform various tasks.
Computer programming is
how we communicate with
machines in a way that
makes them function how
we need.
1- Programming starts and ends on the computer. You must be
continually writing code at the computer to be working.
• In fact, before the coding phase, programmers spend
Some serious time identifying the problem and deciding on the
solution.
myths on 2- You have to be a mathematician to write code.
• Simple and efficient – The syntax style is easy to comprehend. We can use C to design applications that were
previously designed by assembly language.
• Memory Management – It allows you to allocate memory at the runtime, that is, it supports the concept of dynamic
memory allocation.
• Dynamic Memory Allocation- When you are not sure about the memory requirements in your program and want to
specify it at the run time, that is, when you run your program, you can do it manually.
• Pointers – C language provides a pointer that stores the memory address as its value. Pointers are useful in storing
and accessing data from memory. We will study this in detail in our upcoming tutorials.
• Case Sensitive – It is pretty clear that lowercase and uppercase characters are treated differently in C. It means that
if you write “program” and “Program”, both of them would connote different meanings in C. The ‘p’ in “program” is
in lowercase format whereas, the ‘P’ in Program is in uppercase format.
• Compiler Based – C is a compiler based language, that is, to execute a code we first need to compile it.
• Structure Oriented/Modular – C is a structured programming language. This means you can divide your code and
task within a function to make it interactive. These functions also help in code reusability.
Advantages of C
Programming Language
• Portable – It is easy to install and operate and the
result file is a .exe file that is easy to execute on any
computer without any framework.
• Compiles faster – C has a faster compiler that can
compile 1000 lines of code in seconds and optimize the
code to give speedy execution.
• User-defined functions – C has many header files that
define a lot of functions, making it easier for you to
code. You can also create your functions; these are
called user-defined functions (UDFs).
• C has a lower level of abstraction – C is a very clear
and descriptive language. You can, in a way, directly
see into the machine without any conceptual hiding
and so learning C first makes the concepts very clear
for you to proceed.
• It is used in the development of Operating Systems
and Embedded Softwares. For example, the Unix
Kernel was born out of C as discussed earlier.
• It comes in handy when designing a compiler for
other programming languages.
Applicatio • Data structures and algorithms are implemented in
ns of C C
• It acts as a base language to develop new languages.
Language For instance, C++ was developed from C.
• Computer applications can be developed using C.
• Firmware is designed for electrical, industrial and
communication appliances using C.
Career
Aspects in
C • There are dozens of jobs available if you are clear with
your programming concepts.
Programmi • Companies that work on embedded programming can be
an excellent option.
ng • If you are interested in Robotics and other security devices
Language or electronic devices, you should learn c programming to
develop basic algorithms for various microcontrollers.
• You can become a Software Engineer or a Team Leader if
you are good at Data Structures.
Companie
s that Use
C
6. What is a
Compiler in C?
Integrated Development Environment
or IDE for short is an application or
software which programmers use for
programming.
1. Work on Basics
2. Start putting question tags (why, how, what) with every set of code you write
3. You learn more by helping others
4. Write simple, understandable but logical code
Good code is its own best documentation. As you're about to add a comment, ask yourself,
"How can I improve the code so that this comment isn't needed?" ~Steve McConnell
5. Spend more time in analyzing the problem, you’ll need less time to fix it
If you cannot grok the overall structure of a program while taking a shower, you are not
ready to code it. ~Richard Pattis
How to become a
good programmer?
(Contd.)