Re: Larkin, Power BASIC cannot be THAT good:



On Sat, 16 May 2009 15:30:56 -0700, John Larkin wrote:

You can't argue that C (and its culture) generally results in good or
secure executables, because it so obviously doesn't.

Obviously does, as Linux is written in C (the kernel, the drivers, and many if
not most applications).


The advantage of Linux is that many, many eyeballs review the code,
and the authors know that their code will be seen and criticized in
public. That probably encourages them to be more careful. Plus, the
code is debugged by many, many people.

Most programmers work on their bit of code alone. Nobody checks their
source code but themselves. They don't comment because they figure
they will remember their design intent forever, or because they were
never taught to document their own code.

Right. But this isn't C's fault. You will see more crappy code written in
C than in most other languages simply because you will see more code written in
C than in most other languages.

If you need to tackle a wide range of programming tasks, you need to know
C. There is no other language with such a wide range of applicability
(with the caveat that C++ is essentially a superset of C). You don't see
OS kernels being written in Ada or Python or BASIC.

And once you know C, you don't really *need* to know anything else. Sure,
there are lots of cases where other languages might be more suitable, but
C is usually "good enough". But there are plenty of cases where C/C++ is
the only language which is good enough.

There are a lot of half-baked programmers whose knowledge of languages
started with VB or JavaScript, maybe a couple more languages are learnt
for specific tasks, then they learn C and never need to learn another
language.

For real design C is a must :-)

What do you mean by "real design"? I do real products in assembly.

Assembly is a non-starter if you need the code to run on multiple
architectures (or if you suspect that it may need to do so in the future).
It's also unrealistic for large applications.

Most truly mission-critical, lives-depend-on-it programming (like the
stuff that flies airplanes) is done in Ada.

That kind of software development is only feasible if you have the kind
of customer who pays $2000 for a screwdriver. IOW, the DoD, NASA, ... er
just those two, really. Most software development is rather more
price-sensitive.

To be a bit more serious, the old BASIC had those gotos and line numbers,
you got stuck with no space between line numbers, and needed a renumber routine.
I found asm much more easy than that BASIC because the assembler allowed me nice
long labels.
BASIC has come a long way since then.

Absolutely. PB has all the modern constructs, WHILE, CASE, TRY/CATCH,
graphics, all that. But I still think in state machines, and GOTO is a
perfectly good way to structure state machines. Nothing flow-charts as
nicely as a program based on GOTOs. The anti-GOTO nonsense was started
by Dijkstra, who didn't program much himself and didn't have regular
access to a computer.

Dijkstra was right, though; "goto" is the antithesis of structured
programming. It's hardly ever used in high-level languages. The main use
of "goto" in C is to clean up on errors, which is done using exception
handling, constructors, and destructors in C++.

Software should be like hardware: do it the cleanest way, take your
time, document it thoroughly, get it right the first pass.

It rarely is. If you consider all the components of a complex system,
software is the least reliable, the hardest to manage, the hardest to
maintain, the most likely to destroy the company, and usually the most
expensive.

That's because it accounts for 99% of the system. Think about implementing
a PC with a dozen substantial applications using dedicated logic rather
than a CPU and software. You would be lucky to fit it onto a silicon
wafer, and even the DoD wouldn't be able to afford one.

.



Relevant Pages

  • Re: Linux in Forth?
    ... tendency to mix applications together so it takes work ... The advantage that Forth has over other languages ... >things the way programmers in other languages do them. ... But I think for that to happen the C/Forth ...
    (comp.lang.forth)
  • Re: Larkin, Power BASIC cannot be THAT good:
    ... C than in most other languages. ... It's also unrealistic for large applications. ... perfectly good way to structure state machines. ... "goto" is the antithesis of structured ...
    (sci.electronics.design)
  • Re: Larkin, Power BASIC cannot be THAT good:
    ... Most programmers work on their bit of code alone. ... C than in most other languages. ... It's also unrealistic for large applications. ... perfectly good way to structure state machines. ...
    (sci.electronics.design)
  • Re: despair
    ... You're telling DCL programmers not to use GOTO? ... Good programmers don't *need* to use GOTO in languages that have ... Many structuring tools are goto's in disguise. ...
    (comp.os.vms)
  • Re: Larkin, Power BASIC cannot be THAT good:
    ... Most programmers work on their bit of code alone. ... C than in most other languages. ... It's also unrealistic for large applications. ... "goto" is the antithesis of structured ...
    (sci.electronics.design)

Loading