[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: Why is C so popular?



On Thu, Aug 28, 2003 at 12:55:56PM -0400, Mark Roach wrote:
> On Thu, 2003-08-28 at 09:10, Anders Arnholm wrote:
> > On Thu, Aug 28, 2003 at 06:46:09AM -0500, Ron Johnson wrote:
> > > Lets take my MUA, Evolution, for example.  It's not processor 
> > > intensive.  Why couldn't it be written in Python?  
> > One of the main reasons is that Python leaves a loot of the resolving to
> > runtime, that means that the code actually has to be run before you can
> > see tha actuall typo found at compile time in languanges as C. 
> 
> This is such a fallacy. It's very easy to make code that compiles but
> crashes. Compilers just compile code, they do not give it a magic "This
> program is well written" certificate. Use pychecker, be happy. or better
> yet, test your code.

PyChecker, I'll have a look at that. But that still doesn't change than
main think if you say test you code that applies to any other langunage
too, and we ahve lint for C. In the real world testing to often gets
pushed to far away in the developemnt, I know what I'm talking about I
have been working almost all the time since 1998. Mostly developing test
enviroment for different products. There is no such magic that makes it
possible to test everything.

PyUnits is a good test engine but I leaves some parts that stilla are
hard to test, that could contain runtime errors. Testing also is a hard
bussinis to figure out whar the heck is going to happen in runtime. The
tools at the meoment for C is far more advances that the availible tools
for Python.

> > Yes that kind of problem would be removed, but Python code has other
> > parts that may as well fail. Many being simples problems of types that
> > simply isn't resolved untill runtime and as all code isn't run all the
> > time it may burry it self long down and hidden. I think that is bad for
> > large projects.
> 
> how is that different from some C code casting inappropriately deep in
> the bowels of your app? In python, you at least get a useful exception,
> in C you just get a nasty segfault and fun with the debugger.

Well the usefullness of this messange (or the more commonly seen
exception in Java or C++) could be discussed. The bottom line is that in
all languages good disipline and good rutines for testing is the most
importand. You will always have a loot of trobles, you will always leave
someting that you didn't expect to happen. All probrams in all
languanges have the problems, changing langunage will not with any magic
make this go away.

So making a office/mail suit using Python insteda of C wount make it any
better or less likely to crash for the user becaues the problems are not
in the language it in something else. There bu not saying that Python
might not be a good languange for the work or that C might not be a
langes for this kind of work.

/ Balp
-- 
      o_   Anders Arnholm,               HiQ - Consultant
 o/  /\    anders@arnholm.nu             Phone  : +46-703-160969
/|_, \\    http://anders.arnholm.nu/     http://www.hiq.se
/
`

Attachment: pgpFsMHRDEpkw.pgp
Description: PGP signature


Reply to: