You are on page 1of 8

Shull 1

Damian Shull
Prof. Wolcott
ENC1102
06 October 2015
Genre Analysis: Programming in C/C++
How many programming languages do you think there are today? As of today there are
over 20 major languages but new languages can be created everyday using other languages. The
reason being is that programmers can develop new languages from previously built languages.
C just happens to be derivatives of many languages used today in society such as Java, PHP,
Python. C#, etc (Superset of C/C++) Even though there is no definite amount of
programming languages out in the world today, there are numerous amounts of languages that
programmers today use for different reasons. In my genre analysis I am going to focus on the
programming languages C and C++, plus the discourse community of these two languages.
To understand the discourse community behind the world of C/C++ programmers, it is
important to know what exactly genre is in order to develop the perception of the discourse
community of programmers. Amy Devitt, an english professor states in her essay Generalizing
about Genre that genre entails purposes, participants, and themes, so understanding genre
entails understanding a rhetorical and semiotic situation and a social context. (Generalizing
about Genre: New Conceptions of an Old Concept, 575). Devitt practically says that if you
know the purpose, themes and the participants of the discourse community, thus you will
understand the context and the social aspect of the discourse community. Moving on, you may
question yourself as to why did the discourse community behind programming name a coding
language C. Well, it was named after the programming language B in the 1970s. C was created

Shull 2

by Dennis M. Ritchie, an employee of Bell Labs, a.k.a AT&T. C was created because its
predecessor did not have the ability to produce structures within code nor did B have data-types,
which are variables that computers use to decipher the difference between text commands.
Further into my research I learned the discourse community that uses C is to provide low-level
access to memory for hardware/software, provide language constructs that map efficiently to
machine instructions, and to require minimal run-time support. (History of C, Why We Use C
Programming Language)
After C was created, nearly a decade later C++ came out and it is still used today.
Basically C++ is a super set of C. A superset means that C++ can use the same functions that C
uses but you cannot use functions from C++ in C. (Superset of C/C++). C++ is different than C
because it has a lot more functions than C and varies widely from variables, the lexis among
programmers and the overall structuring of the code as it is being developed.
Furthermore I am going to discuss the image in Appendix A. It is a C program by the
way. Ultimately the C program prints a number at the end. The code begins with
#include<stdio.h>. This means to include standard input and output of C functions. The next
line int main (void) just means to include the main functions within C. After that line you will
see curly brackets {} . This lets the computer know where the meat of the program is. Now let
me explain what is in the meat, the C program starts off with variables index and m. The
programmer has to set these two to variables using int which means integer, these variables can
only be integers. The int is a variable data-type int lets the computer know that index and
m have become numbers, intergers. Another aspect of C is that you can set variables equal to
something, in this case m equals one. Moving on, there are commands in C called loops which
basically makes the computer execute the program over and over again until something stops the

Shull 3

loop. The loop is called for but for isn't the only loop in C/C++. Within the parenthesis of
for is an expression for the loop to follow. The programmer has set index equal to one, index
is less than 10 < and index++ within the expression. What index++ means is that it is
incrementing by one every time the program goes into the loop until index is no longer less
than ten. When it is no longer less than ten the program will multiply by the variable m. Since
nine is the last number that is less than ten, the variable index equals nine and since variable
m equals one, nine times one equals nine, therefore, this program outputs or prints the number
nine. The output action is printf which means print function. The reason why the discourse
community makes programs like these are to solve equations that can take a long time to
compute by hand, so they write equations in C so the computer can do the math.
Moving on, in Appendix B we are looking at a C++ program. The program is simply the
code for a program that checks if a letter is a vowel or not. In this case you can see that Appendix
A and Appendix B differ a lot from each other. To simplify what the C++ program does is that it
asks the user to input a letter, which is recorded and becomes checked among the vowels in the
known english alphabet. Since AEIOU are the only vowels, the program checks the recorded
character (ch) you entered and sees if it matches AEIOU case by case. If the character the
user entered equals to one of the vowels, the program will tell you that it is a vowel. If it's not a
vowel the program will tell you it is a consonant. The application for these programs could be
used to determine the number of vowels there are in a sentence or in words but this program is
the basis for determining vowels and is an example of what C++ looks like compared to a C
program.
The similarities between the two programs have certain things in common but there is
only a small amount that are similar even though they are almost the same code language. First,

Shull 4

both programs ultimately print out something at the end and they also vaguely contain the same
syntax as they both contain indentations. If you didn't notice already they both contain an
include function. You could run Appendix A within the compiler of Appendix B but you cannot
do that vice versa. The use of semicolons ; in both is a declaration of an ending of a function, it
just means for the computer to move on to the next line. All the words bolded in dark blue are
variables and data types. In C there are types of loops called switch, this loop can be used also
be used in C++. In conclusion the discourse community involved in this area relies on the
knowledge from the language C in order to read and use the language C++.
Obviously both programs don't compute the same thing nor look the same. The amount of
differences between the two programs are enormous. To begin both programs utilize different
#include functions. The program in appendix A has #include <stdio.h> while Appendix B has
#include<iostream>. You cannot tell from the images but C is written from top down, while C++
is written down-up. We can see that Appendix B is a lot smaller than Appendix A in the amount
of lines of code each of them have. Appendix B has the use of data types cout which is C++s
version of printf. The reason for my compare and contrasts of the two program was to make a
point about the discourse community that is involved with this language. Understanding Amy
Devitt's definition of genre helps outsiders of the programming discourse community realize the
contexts within programs.
Now after reading this I hope there wasnt much confusion because it's a lot of new and
uncommon information. The reason for my essay was to point out the programming discourse
community that uses C/C++ which helped and helps build all the software in technology in the
world today. Every button you press is manually using software and every application on your
phone and computer are programs written with different languages. Everywhere you look

Shull 5

software is being used and is only going to become more advanced in the future. My essay about
the C language and its younger brother C++ was to inform people outside of the discourse
community to understand the genre of programming a little better than before and why these
programs are used today.

Appendix A: C

Shull 6

<http://dyamar.com/examples-of-for-loop-usage-in-c-language>

Appendix B: C++

Shull 7

<http://fahad-cprogramming.blogspot.com/2012/08/switch-statement-in-c-programming.html>.

Works Cited

Shull 8

Thakur, Dinesh. "History of C, Why We Use C Programming Language."History of C, Why We


Use C Programming Language. Computer Notes, n.d. Web. 29 Sept. 2015.
Devitt, Amy J. "Generalizing about Genre: New Conceptions of an Old Concept." Academia.
Amy J. Devitt, n.d. Web. 06 Oct. 2015.
<http://www.academia.edu/554809/Generalizing_about_genre_New_conceptions_of_an_old_co
ncept>.
"Examples of FOR Loop Usage in C Language." Dyamar. Dyamar Engineering, 22 Apr. 2013.
Web. 06 Oct. 2015. <http://dyamar.com/examples-of-for-loop-usage-in-c-language>
"Superset of C/C++." StackOverflow. Username: Peppers, 6 June 2015. Web. 06 Oct. 2015.
<http://stackoverflow.com/questions/30378080/what-does-it-mean-when-one-language-is-aparallel-superset-of-another>.
Munir, Fahad. "C++ Programming Tutorial for Beginners." Fahad-cprogramming.blogspot.com.
Fahad Munir, 2012. Web. 06 Oct. 2015. <http://fahadcprogramming.blogspot.com/2012/08/switch-statement-in-c-programming.html>.
Chvez, Jorge Domnguez. "Why Do We Still Use C and C++ Languages ?"ResearchGate. User:
Abdul Ashu, 9 Jan. 2013. Web. 06 Oct. 2015.
<http://www.researchgate.net/post/Why_do_we_still_use_C_and_C_languages>.
Administrator of "the Crazy Programmer" "Difference between C and C++." The Crazy
Programmer. The Crazy Programmer, 15 Mar. 2015. Web. 06 Oct. 2015.
<http://www.thecrazyprogrammer.com/2015/03/difference-between-c-and-c-c-vs-c.html>.

You might also like