Message from discussion
Why I Hate C
Received: by 10.66.74.102 with SMTP id s6mr3425306pav.21.1347365002957;
Tue, 11 Sep 2012 05:03:22 -0700 (PDT)
Received: by 10.68.225.234 with SMTP id rn10mr1116793pbc.3.1347365002937; Tue,
11 Sep 2012 05:03:22 -0700 (PDT)
Path: t10ni4303pbh.0!nntp.google.com!r4no867861pbs.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: comp.lang.lisp
Date: Tue, 11 Sep 2012 05:03:22 -0700 (PDT)
In-Reply-To: <a6eeec27-6230-4129-9334-b72f32ece5bb@googlegroups.com>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.105.238.153;
posting-account=672jqgkAAAD2IK_vTtyyxqT0tKiPRdgZ
NNTP-Posting-Host: 71.105.238.153
References: <a6eeec27-6230-4129-9334-b72f32ece5bb@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e11f5753-c42a-4f1f-9039-7138c286223e@googlegroups.com>
Subject: Re: Why I Hate C
From: visplovesl...@gmail.com
Injection-Date: Tue, 11 Sep 2012 12:03:22 +0000
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Friday, July 13, 2012 6:38:10 PM UTC-7, Xah Lee wrote:
> =E3=80=88Programing: Why I Hate C=E3=80=89
>=20
> http://xahlee.info/comp/why_i_hate_C_lang.html
>=20
>=20
>=20
> for your amusement.
>=20
>=20
>=20
> -------------------------
>=20
>=20
>=20
> I despise C the language, not because of particular technical aspect, or =
lacking some functionality such as lacking {automatical memory management, =
module system, namespace, list/hashtable datatype, complex number datatype,=
regex, function closure, function as value, OOP support, functional progra=
ming support, =E2=80=A6}, none of that, but on certain sloppiness that's in=
the bones of C. (pretty much like unix (they bootstrap each other (it's sc=
am booting scam)))
>=20
>=20
>=20
> Perhaps the best simple example to illustrate, is its invention of the fo=
rmat function printf (first of all, F=EF=BF=BD=EF=BF=BD=EF=BF=BD THE NAME.)=
. Completely ad hoc, inflexible, cryptic syntax and semantics. When i first=
learned it (thru Perl. (C/Unix has a knack like virus. Now it's in about e=
very lang.)), i went WTF is this? (i came from Mathematica). The printf can=
print hex, but with fixed representation of the digits, and can't do arbit=
rary n-based number system. It can print decimal in several formats, but in=
a bunch of ad hoc fixed ways. And did i mention cryptic syntax? The syntax=
and semantics isn't extensible in any general way.
>=20
>=20
>=20
> There it is, the C language! In C, just about anything it does, it's done=
in a {ad hoc, fixed, inflexible, non-extensible, cryptic} way, and with a =
PRETENSE that it is done for speed and efficiency. Note the word =E2=80=9CP=
RETENSE=E2=80=9D here. That's important. I don't dislike C because it's a l=
ow-level, system language, designed for speed, but because there's a strong=
HACK element in its blood.
>=20
>=20
>=20
> (to this day, due to C's spread of printf, many programers don't really u=
nderstand what's n-based number system, they just recognize {binary, oct, h=
ex} when they see a string of 0123456789abcdef. And if you show them hex nu=
mber system using decimal digits in a list, they would be wildly flabbergas=
ted and goes =E2=80=9CWHY would you ever want do that??=E2=80=9D. To this d=
ay, the hex with 0=E2=80=A69a=E2=80=A6f have so ingrained in every computin=
g spec. In particular, RGB color e.g. #c2c2c2. (the RGB color spec, is a en=
tire story of complete ad hoc f=EF=BF=BD=EF=BF=BD=EF=BF=BD by itself (e.g. =
ad hoc range of 0 to 255, just because it is convenient at the time!). (not=
sure who started it, probably unix X11 first popularized it.)))
>=20
>=20
>=20
> =E2=80=A2 Extensive ad hoc syntax. So, we need to increment a counter oft=
en. Instead of working on a better compiler, let's invent a short syntax on=
the spot! Thus was born these abomination: {i++, ++i, i--, --i, =3D+, =E2=
=80=A6}. And witness the syntax soup: {i++, ++i, for(;;){}, while(){}, 0x12=
3, expr1 ? expr2 : expr3, sprint(=E2=80=A6%s=E2=80=A6,=E2=80=A6), =E2=80=A6=
}. These are ad hoc, cryptic, inflexible, non-extensible, syntaxes =E2=80=
=94 the nature of C. (=E2=9E=B2 The Concepts and Confusions of Prefix, Infi=
x, Postfix and Fully Nested Notations)
>=20
>=20
>=20
> =E2=80=A2 the use of bitmask as boolean parameters. (to this day, there a=
re programers who don't understand the difference, saying that bitmask is t=
he most efficient way to =E2=80=9Cencode=E2=80=9D boolean parameters. Encod=
e? Encode their ass. (this again, spread like virus. You see it in perl/pyt=
hon regex flags. Did i mention cryptic? (and WTF is a flag?))) (i've wrote =
this one out in full: Programing Language Design: the Hack of Bitmask Used =
as Boolean Parameters.)
>=20
>=20
>=20
> =E2=80=A2 the include as a lib system. No namespace. Granted, in the 1970=
s, computing resources are meager. Many of C's issues we can't really blame=
C. But, the key point i want to emphasize is, that everything in C is done=
is a sloppy no-design way without any apology. If pressed, the C types del=
ight in the ad hoc cryptic nature as hackery. (much inherited by Perl) So, =
C's include has gone into Perl, and from Perl to PHP. (luckly, include fell=
off starting with Perl in the late 1990s. Most langs now have a namespace/=
module system.)
>=20
>=20
>=20
> =E2=80=A2 cryptic error code. This have been transfused into the veins of=
unix. You have to check the exit code, then you need to decode the error c=
ode. And here we onto the related bitmask f=EF=BF=BD=EF=BF=BD=EF=BF=BD as i=
n unix.
>=20
>=20
>=20
> C and unix are such a sloppy scumbag that they act like a virus. (this po=
int has been well exposited by lisper Richard P Gabriel's =E3=80=88The Rise=
of =E2=80=9CWorse is Better=E2=80=9D=E3=80=89.) C spawned csh, C++, Perl, =
Java, Pretty Home Page (aka PHP) (and the entire C-like syntax langs), C#, =
Go Lang. They ride on sloppiness and speed which masquerade as portability =
and distributed like drugs. The whole C Unix things spread like drugs, in p=
articular: unix, perl, Apache, MySQL. Their slogan is often =E2=80=9CMOST P=
opular in Industry!=E2=80=9D. And as a consequence, usually =E2=80=9CIndust=
ry STANDARD=E2=80=9D! O, and there is one thing that always accompanies the=
se: $FREE$! (as in, free drugs!)
>=20
>=20
>=20
> So, C++ is better? if you think C++ fixed C, then this whole essay has be=
en written in vain. C++ is far worse. (in the context of this essay, Java c=
an be considered as a improvement of C.)
>=20
>=20
>=20
> =E2=80=A2 The Rise of =E2=80=9CWorse is Better=E2=80=9D (1991) By Ric=
hard P Gabriel. @ http://dreamsongs.com/RiseOfWorseIsBetter.html
>=20
> =E2=80=A2 Defective C++ (2007) By Yossi Kreinin. @ http://yosefk.com/=
c++fqa/defective.html
>=20
>=20
>=20
> =E2=80=A2 The Nature of the Unix Philosophy
>=20
> =E2=80=A2 Lambda in Python 3000
>=20
> =E2=80=A2 Pattern Matching vs Lexical Grammar Specification
>=20
> =E2=80=A2 Unix Pipe as Functional Language
>=20
> =E2=80=A2 Computer Language Design: What's List Comprehension and Why=
is It Harmful?
>=20
> =E2=80=A2 Language, Purity, Cult, and Deception
>=20
> =E2=80=A2 Scheme =EF=BC=86 Failure
>=20
>=20
>=20
> yours truely,
>=20
>=20
>=20
> Xah
So what programs have you done in lisp?
What websites can I go to that you have done in lisp?
Are you much happier with the results?
Do you run them websites on archlinux?