Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.misc > #2052
| Path | csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | "Rod Pemberton" <dont_use_email@xnothavet.cqm> |
| Newsgroups | comp.lang.misc |
| Subject | Re: Wirth-ian languages |
| Date | Mon, 28 Apr 2014 21:46:00 -0400 |
| Organization | Aioe.org NNTP Server |
| Lines | 97 |
| Message-ID | <op.xe11uyjf6zenlw@localhost> (permalink) |
| References | <ljlv93$g39$1@dont-email.me> <ljm3a3$hho$1@speranza.aioe.org> <20140428111524.742@kylheku.com> <94y7v.153301$AI5.43400@fx32.am4> <20140428125523.803@kylheku.com> <ljmifb$1gn$1@dont-email.me> |
| NNTP-Posting-Host | CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-1; format=flowed; delsp=yes |
| Content-Transfer-Encoding | 7bit |
| X-Complaints-To | abuse@aioe.org |
| User-Agent | Opera Mail/12.16 (Linux) |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| Xref | csiph.com comp.lang.misc:2052 |
Show key headers only | View raw
On Mon, 28 Apr 2014 17:50:34 -0400, James Harris
<james.harris.1@gmail.com> wrote:
> I often think it strange that many people, including me, have so many
> issues with C and yet it despite the things I don't like or wish could be
> better it is still far and a away my language of choice for a lot of
> work.
> How can one language be so bad yet so choosable?
It's your perception of what is "bad" combined with your perception
of what is "useful." If you perceived other languages to be as
useful as C, then you wouldn't chose C, would you? I.e., decades
ago, when people had a choice of BASIC, Cobol, FORTRAN, or Pascal,
they usually chose BASIC. It was/is a general purpose language
good with integers and strings, albeit an unstructured language.
Although many argue for domain specific languages to solve specific
sets of problems, or argue for a high level of abstraction so that
mathematicians, physicists, or engineers can solve problems without
needing to learn how to reduce the problem to the machine level,
such languages don't work well when needed to make the machine do
something. The correct path, IMO, is for mathematicians, physicists,
and engineers to learn how to program real world machines, and learn
how to convert their problems into programs those machines can run.
Yes, I know that's not a popular perspective.
> What makes it so good to program in despite the faults that
> people identify?
I think it has two aspects. First, what C gets correct. Second,
when and where C gets stuff incorrect. Most of the incorrect
stuff is either trivial, low-use, or on the periphery.
I can identify quite a few and if you've seen my past posts, here,
a.o.d., a.l.a., c.l.a.x., you're probably aware of some of the many
faults of C.
So, let's list some (what I recall right now...) of what I think
C gets correct:
1) pointers
2) declaration syntax of objects matches usage syntax
3) symbols for symbolic operations not text, i.e., '<' instead of '.LT.'
4) curly braces for blocks
5) user doesn't have to manually maintain variables on a stack, or
manually setup and pass parameters to procedures
6) all objects map onto arrays of bytes
(ease of copying or moving blocks of data or loading files etc)
7) very good with strings and integers
8) fits the computing architecture of microprocessor based machines
9) supports two's complement arithmetic
10) nul terminated strings
It can be argued that many of these features, and others, exist in C
because the original authors (Kernighan, Ritchie, Thompson) ported
C to so many different computing platforms and had to redesign the
language to fit, as many as possible, as cleanly as possible.
Yes, I know some/many on that list are controversial too. Just mention
nul terminated strings in comp.lang.forth. Forth uses counted strings.
But, nul terminated strings solved the problem with incorrect lengths
on counted strings. Of course, it's possible in C to end up with
an unterminated string.
> In my own designs I tend to avoid including the features of C due to
> things like their lack of security but then it becomes very difficult
> to provide the same facilities in a secure way.
Bingo!
Lack of pointers is a serious problem to have. The Pascal that I learned
decades ago didn't have them. It was very difficult to solve some
basic problems without them. I'm not sure how Java etc get around the
issue. Of course, we've since learned that pointers can be very unsafe.
So, we have a power or flexibility versus safety issue.
> Rather than design a new language I wonder how feasible it would be for
> one of us to evolve C into something better by means of a series of small
> steps. The language base is there just asking to be improved. Anyone
> tried that?
I made a list of changes to C that could be done to C to create a safer,
better version of C. Each of these changes were compatible with the
C preprocessor. C's preprocessor can turn just about anything back into
valid C. E.g., I've disliked C's use of '=' for assignment. It should
be two characters to allow for searching without matching other assignment
operators in C. A simple define of ':=' to '=' will allow one to use
':=' for assignment. However, I moved on and starting developing my
own language, which I really dislike the syntax, but it parses easily.
> [C++]
Yes, many, including me see C++ as horrid. It does have a few nice ideas,
but the bulk of it ... seems to just layer on complexity for no reason.
Rod Pemberton
Back to comp.lang.misc | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Wirth-ian languages bruce axtens <bugmagnet@outlook.com> - 2014-04-28 16:23 +0000
Re: Wirth-ian languages Joe Hynes <theda@southpark.net> - 2014-04-28 17:31 +0000
Re: Wirth-ian languages Kaz Kylheku <kaz@kylheku.com> - 2014-04-28 18:47 +0000
Re: Wirth-ian languages "BartC" <bc@freeuk.com> - 2014-04-28 20:35 +0100
Re: Wirth-ian languages Kaz Kylheku <kaz@kylheku.com> - 2014-04-28 20:18 +0000
Re: Wirth-ian languages "James Harris" <james.harris.1@gmail.com> - 2014-04-28 22:50 +0100
Re: Wirth-ian languages "BartC" <bc@freeuk.com> - 2014-04-29 00:03 +0100
Re: Wirth-ian languages Kaz Kylheku <kaz@kylheku.com> - 2014-04-28 23:51 +0000
Re: Wirth-ian languages "James Harris" <james.harris.1@gmail.com> - 2014-04-29 07:59 +0100
Re: Wirth-ian languages "BartC" <bc@freeuk.com> - 2014-04-29 10:04 +0100
Re: Wirth-ian languages "James Harris" <james.harris.1@gmail.com> - 2014-04-29 11:33 +0100
Re: Wirth-ian languages "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-04-29 07:41 -0400
Re: Wirth-ian languages "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-04-28 21:46 -0400
Re: Wirth-ian languages "James Harris" <james.harris.1@gmail.com> - 2014-04-29 08:24 +0100
Re: Wirth-ian languages "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-04-29 07:33 -0400
Re: Wirth-ian languages "James Harris" <james.harris.1@gmail.com> - 2014-04-29 14:38 +0100
Re: Wirth-ian languages "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-04-30 21:28 -0400
Re: Wirth-ian languages "James Harris" <james.harris.1@gmail.com> - 2014-05-01 10:44 +0100
Re: Wirth-ian languages "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2014-04-29 09:59 +0200
Re: Wirth-ian languages Kaz Kylheku <kaz@kylheku.com> - 2014-04-29 15:51 +0000
Re: Wirth-ian languages "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2014-04-30 10:57 +0200
Re: Wirth-ian languages Kaz Kylheku <kaz@kylheku.com> - 2014-04-30 15:47 +0000
Re: Wirth-ian languages "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2014-05-01 10:18 +0200
Re: Wirth-ian languages Kaz Kylheku <kaz@kylheku.com> - 2014-05-01 16:56 +0000
Re: Wirth-ian languages "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2014-05-02 10:10 +0200
Re: Wirth-ian languages "BartC" <bc@freeuk.com> - 2014-04-30 18:27 +0100
Re: Wirth-ian languages "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2014-05-01 10:18 +0200
Re: Wirth-ian languages Kaz Kylheku <kaz@kylheku.com> - 2014-05-01 17:10 +0000
Re: Wirth-ian languages "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2014-05-02 09:22 +0200
Re: Wirth-ian languages "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-04-28 20:59 -0400
Re: Wirth-ian languages "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-04-28 21:10 -0400
Re: Wirth-ian languages Nils M Holm <news2009@t3x.org> - 2014-04-29 07:52 +0000
Re: Wirth-ian languages "BartC" <bc@freeuk.com> - 2014-04-29 09:45 +0100
Re: Wirth-ian languages Jacko <jackokring@gmail.com> - 2014-04-29 05:37 -0700
csiph-web