What makes C or C++ a good programming language?

Quora Feeds

Active Member
Joey Kim


Most programming textbooks on Python or JavaScript have a section like this:


Unlike C or C++, [JavaScript/Python] is higher level and runs on more platforms. In addition, specific anomalies of certain host operating systems are abstracted out.

That sets a little bias against C or C++. You would think: “I like Python/JavaScript better because it’s cross platform.” Just remember that, because it’ll come in handy later in this answer.

Anyways, C/C++ is good because it’s an old standard. Unlike Python or JavaScript , or even Java, C/C++ has an unchanging “field”. Python 2.7 and 3 are radically different in many ways, yet today’s latest and greatest C compilers can still compile code from the early 90’s. A programming language is good if they can work on many platforms.

Another good part about C/C++ is its speed. When I started programming in C again (after a several-month “Python Spree”), I was astonished by the speed. A programming language is good if it is fast. Now, I’m not calling Python slow, it’s just that it’s not as fast as C.

C/C++ is also flexible. What other language lets you write Java in C?

/*
* Sun's Java is often touted as being "portable", even though my code won't
* suddenly become uber-portable if it's in Java. Truth is, Java's one of
* the most ugly, slow, and straitjacketed languages ever. It's popular
* mainly because people hear the word "portable" and go "ewww".
*
* This program, then, is dedicated to bringing about the death of Java. We
* good coders have been oppressed for too long by the lame language
* decisions of pointy-haired bosses and academics who should know better.
* It's time we stand up against this junk, and bring back the fun in
* programming! Viva La Revolution!
*/

#define aSet c
#define BufferedReader(x)1
#define byte Y[_^1]?do:)):_&1?do(.):do(`):8;++y;}
#define class int N=0,_,O=328,l=192,y=4,Y[80][64]={0},I;struct
#define do(c)a(#c "\b")
#define err c,c
#define getAllStrings(x));q()
#define if(x)b(#x)
#define IOException
#define line c
#define main(a)b(char*x){write(1,"\033[",2),null}main()
#define new
#define null a(x);}a(char*x){write(1,x,strlen(x));try;try;try;try;
#define out c,c
#define println(x)c
#define private int d(int
#define public short c;}c;typedef int BufferedReader;char*F="JF>:>FB;;BII";
#define return {return
#define static f(x){N=(N+x)%6,y--?f(0),f(1),f(4),f(1):++Y[(I=O+N[F]-66)
#define String
#define System c
#define this if(D):1,O=I,I/=16,l<_/32?if(B):l>_/32?if(A):2,l=_,_/=16,byte
#define throws
#define toArray(x)c
#define try for(;--c.c;)
#define void /16][(_=l+N[6+F]-66)/16]?O/=16,l/=32,O<I/16?if(C):O>I/16?this
#define while(k)if(2J),if(7;21H),f(0),f(4),f(4),if(H),/*

import java.io.*;
import java.util.*;

/**
* A lame Java program.
* @author J. Random Worker
*/
class LameJavaApp
{

/** The infamous Long-Winded Signature From Hell. */
public static void main(String[] args)
throws IOException
{
/* Don't get me started on this. */
BufferedReader reader =
new BufferedReader(new FileReader(args[0]));

/* What, this long incantation just to print a string? */
System.err.println("Hello world!");

/* At least this is sane. */
String line;
while ((line = reader.readLine()) != null)
System.out.println(line.length());
}

/**
* Method with a needlessly long name.
* @param aSet a set (!)
*/
private String[] getAllStrings(Set<String> aSet)
{
/*
* This dance is needed even in J2SE 5, which has type
* templates. It was worse before that.
*/
return aSet.toArray(new String[0]);
}

}


Source: http://www.ioccc.org/2005/chia/c...

Finally, C/C++ is cross-platform. “What?” you ask. “C/C++ isn’t cross platform! Let’s downvote this answer!” But think about it this way: In order to run a Python program, you have to do this: python myfile.py. Java: javac Test.class && java Test C: gcc test.c -o test && ./test. Is compiling a C program really that difficult? Sure, setting up libraries like SDL is a big pain in the ass, but you often have to set up Python and Java libraries, too. Good C/C++ code is portable, just like JavaScript/Python. Bad C/C++ code isn’t.



See Questions On Quora

Continue reading...
 
Top