0% found this document useful (0 votes)
77 views

Background: C Programming Language

The document provides background information on the C and Python programming languages. It discusses their origins, structures, applications, advantages, disadvantages, and syntactical differences. Sample programs are also provided in both C and Python to calculate the greatest common divisor (GCD) of two numbers. The C program uses functions and printf to output the result, while the Python program defines a gcdfunction and uses print to output GCD. Key references on the history and uses of C and Python are cited.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views

Background: C Programming Language

The document provides background information on the C and Python programming languages. It discusses their origins, structures, applications, advantages, disadvantages, and syntactical differences. Sample programs are also provided in both C and Python to calculate the greatest common divisor (GCD) of two numbers. The C program uses functions and printf to output the result, while the Python program defines a gcdfunction and uses print to output GCD. Key references on the history and uses of C and Python are cited.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Name: Kenneth Kent Flores BS- CpE IV CPE 512N March 28, 2019

BACKGROUND
C programming language
The C programming language was developed and designed by Dennis M. Ritchie at the Bell
Laboratories of AT&T (American Telephone & Telegraph) in the early 1970s as a support for the growing
Unix operating system. Ken Thompson developed the B language which is derived from Martin Richard’s
basic combined programming language and utilized assembly and B language to further develop the UNIX
system. As a result of implementing high-level language like B, code could be produced much faster than
assembly. A drawback of B language was that it did not had the idea of data-types and the use of structures
was not provided. To overcome these things, Dennis Ritchie developed the C programming language
which had a powerful incorporation of high-level functionality and detailed features in an operating
system. In 1978, Kerninghan and Ritchie published a book entitled “The C Programming Language” and it
was the standard on the language of C. In 1983, the American National Standards Institute(ANSI) was
formed to standardized the programming language C. In 1988, the final standard definition ANSI C was
adopted by the International Standards Organization (ISO).
Python programming language
In the late 1980s, Python was developed as a scripting language which is an object-oriented
language. It was originally developed by Guido van Rossum who was a member of the National Research
Institute of Mathematics and Computer Science. It was designed as a response to the ABC programming
language which had the capability of exception handling and interfacing with Amoeba operating system.
The first version of the programming language was introduced in 1991 and it had a module system of
Modula-3. Later, the programming language was named as “Python”.

STRUCTURE / PARADIGM
C programming language
The following programming paradigms are used by the C programming language:
 Imperative programming paradigm which can be easily implemented and contains loops,
variables, etc.
 Structured programming paradigm which is clean, goto-free, nested control structures.
 Procedural programming paradigm which is an imperative programming that is based
upon the concepts procedure calls and instructions are grouped into procedures.
Python programming language
The following programming paradigms are used by the Python programming language:
 Imperative programming paradigm
 Structured programming paradigm
 Procedural programming paradigm
 Functional programming paradigm in which everything is binded in pure mathematical
functions style.
 Object-oriented programming paradigm in which it can define an object that send
messages to one another.
Python can support multiple programming paradigms which is a general-purpose language while C is
mainly a structured oriented programming language.

APPLICATIONS
Python can be used in many applications like web development, data science which includes
machine learning, visualization and analysis of data, scientific and numeric computing, natural language
processing, scripting, development of games and 3D, other business applications.
On the other hand, C programming language can be used operating systems, embedded systems,
new language development, computation platforms, graphics and games and other hardware applications
development.

KEY ADVANTAGES AND DISADVANTAGES


C programming language
The advantages of using C is that it is highly portable and its syntax can easily be understood. Its
compiler is very fast which makes it more efficient and effective. The maintenance is also easy because of
the code’s readability. Addition of new features is easier and faster and it is secured. It is a structured
programming language which makes the program easier to debug, test, and maintain. In addition, it has
a built-in and user-defined function. Lastly, the level of abstraction is low which makes it easy to
understand how it would interact with the machine. However, the disadvantages of using C is that it
doesn’t support the concept of object-oriented programming, there is a difficulty in fixing the bugs if the
program is very long, the implementation of data structures should require functions to be implemented
explicitly, there is no run-time and strict type checking.

Python programming language


The advantages of using python is that it can easily be learn because it the syntax can easily be
understood by both programmers and non-programmers. It requires lesser time of coding because of its
efficiency, and it has a user-friendly environment. In addition, it also serves as a foundation to learn other
programming languages. Also, it is flexible and building the prototypes and ideas are much quicker when
using Python. The cost for maintenance for the program is also reduced because of the sustainability of
the code. It also extensively supports large standard of libraries and frameworks, has a feature of
integration and it improves the productivity of the programmer. Lastly, it can facilitate test driven
development by enabling programmers to create prototype of software development applications rapidly
and it enables them to meet the emerging trends of software development in the future. The
disadvantages of python is the execution speed of Python is slow because it works with an interpreter,
the design has several issues, the layer of database access of the language is naturally underdeveloped
and primitive. The language less suitable in game and mobile development. In addition, it has a runtime
error and its design is limited and needs more evaluation or testing. It has a high level of memory
consumption and it is not used in web browser because it is unsecured.

SYNTACTICAL DIFFERENCES AND SIMILARITIES


The similarities of both programming languages is that both are case sensitive, chain assignments
are allowed, operators such as assignment and comparison are present in both languages, they have the
standard form of the for loop, break and continue, if with else statements are present in both languages.
The assignment of list or array element and initialization of constant array/list are present.
The differences between the both programming languages is that Python can execute any file in
the project while C must only execute one source code file. To comment in python, it uses the # up to the
end of the line while C uses // (single-line comment) and /* */ (multiple-line comment) in commenting.
In C program, the main function is executed first while the execution of the program in Python is from the
beginning until the end of the file. By including other files, the python utilizes “import module” or “from
module import * while C utilizes the #include<stdio.h> or #include “otherfile.h”. In addition, python does
not have a declaration of its variable while C must have a declaration of its data type to a variable so that
it can be used. Simultaneous assignment is allowed in Python but it does not allow increment operators.
On the other hand, C doesn’t allow simultaneous assignment of variables but it can increment its
operators. Also, they both have different syntax for the for loop statement and the statement for do-
nothing in Python is “pass” while in C is only a “semicolon (;)”. Python doesn’t have switch statement and
pointers compared to C which utilizes these functions.

SAMPLE PROGRAM

C Programming Language Python Programming Language


#include <stdio.h>
def gcdfunction(n1, n2):
int gcdfunction(int n1, int n2);
if n2 == 0:
int gcdfunction(int n1, int n2) {
return n1
if (n2 == 0) {
else:
return n1;
return gcd(n2, n1 % n2)
}

else {
print("GCD: " + str(gcd(12, 20)))
return gcd(n2, n1 % n2);

int main() {

printf("GCD: %d\n", gcdfunction(12, 20));

return 0;

}
REFERENCES & CITATIONS:
Tulchak, L. V., & Маrchuk, А. О. (2016). History of Python (Doctoral dissertation, ВНТУ).

Kerninghan, B. W., & Ritchie, D. M. (1998). The C programming language. Englewood Cliffs: Prentice Hall.

D. M. Ritchie, “The Development of the C Language †,” 1993.

Kiusalaas, J. (2005). Introduction to Python. In <i>Numerical Methods in Engineering with Python</i> (pp.
1-26). Cambridge: Cambridge University Press. doi:10.1017/CBO9780511812217.002

Sugi, Y. (2018, June 15). What exactly can you do with Python? Here are Python's 3 main applications.
Retrieved March 28, 2019, from https://medium.freecodecamp.org/what-can-you-do-with-python-the-
3-main-applications-518db9a68a78

Rongala, A. (2018, April 05). Applications of C / C in the Real World. Retrieved March 28, 2019, from
https://www.invensis.net/blog/it/applications-of-c-c-plus-plus-in-the-real-world/

Uses of Python | Top 10 Uses of Python In Real World. (2018, December 21). Retrieved March 28, 2019,
from https://www.educba.com/uses-of-python/
Mindfire Solutions. (2017, April 24). Advantages and Disadvantages of Python Programming Language.
Retrieved March 28, 2019, from https://medium.com/@mindfiresolutions.usa/advantages-and-
disadvantages-of-python-programming-language-fd0b394f2121

WebCase. (2018, August 10). Advantages and Disadvantages of Python Programming Language. Retrieved
March 28, 2019, from https://webcase.studio/blog/advantages-and-disadvantages-python-
programming-language/

ProBytes software. (2017, September 26). Advantages and Disadvantages of Python Web Development.
Retrieved March 28, 2019, from https://www.probytes.net/blog/advantages-disadvantages-python/

Srivastav, H. (2018, May 3). ADVANTAGES AND DISADVANTAGES OF PYTHON. Retrieved March 28, 2019,
from
http://www.allaboutweb.biz/advantages-disadvantages-python/

Dhakal, S. (2018, November 9). Advantages and Disadvantages of C programming Language. Retrieved
March 28, 2019, from https://myknowledgetoyoudude.blogspot.com/2018/11/advantages-and-
disadvantages-of-c.html

You might also like