login
Header Space

 
 

Re: Using the C programming language

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Brian Hansen <greencoppermine@...>
Cc: <misc@...>
Date: Saturday, December 22, 2007 - 10:08 am

On 2007-12-22 12:06, Brian Hansen wrote:

I'm not very familiar with Ada so I do not know if it allows for the
same kinds of low-level programming (which is necessary when writing an
OS or code that interacts with hardware) that C does.


The speed of comes, among other things, from the lack of security checks
and by allowing potentially unsafe operations. Again, I do not know Ada
so I do not know how it achieves its high level of safety but I would
think that runtime checks is part of it.


C++ is not inherently safer than C (in fact much C code is also valid
C++) but there are a number of mechanisms in C++ that makes some kinds
of constructs easier/more convenient. But there is nothing that can be
done in C++ that can not be done or emulated in C.

What C++ does offer with its more extensive OO support is to make it
easier to encapsulate potentially unsafe operations and constructs in
higher-level objects. By making sure that those objects never perform
any unsafe actions you eliminate some low-hanging fruit (one of the most
common security problems comes from to small string-buffers, by using
string classes instead the user does not have to concern him/her self
with such things). Of course such encapsulation is not free and there
are both speed and memory considerations.

Having said that you should be aware that most of the tougher security
issues are language independent, even code written in C# and similar
languages can have security issues.

-- 
Erik WikstrC6m
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Using the C programming language, Brian Hansen, (Sat Dec 22, 7:06 am)
Re: Using the C programming language, Ted Unangst, (Sun Dec 23, 2:40 pm)
Re: Using the C programming language, bofh, (Mon Dec 24, 1:47 am)
Re: Using the C programming language, Marc Espie, (Sun Dec 23, 1:42 pm)
Re: Using the C programming language, Nick Holland, (Sat Dec 22, 12:34 pm)
Re: Using the C programming language, Douglas A. Tutty, (Sat Dec 22, 10:25 am)
Re: Using the C programming language, Darrin Chandler, (Sat Dec 22, 11:08 am)
Re: Using the C programming language, Erik Wikström, (Sat Dec 22, 10:08 am)
Re: Using the C programming language, Kim Naim Lesmer, (Sun Dec 23, 12:01 pm)
Re: Using the C programming language, Woodchuck, (Mon Dec 24, 3:21 am)
Re: Using the C programming language, Rico Secada, (Sat Dec 22, 7:55 pm)
Re: Using the C programming language, Girish Venkatachalam, (Sat Dec 22, 7:34 am)
Re: Using the C programming language, Rico Secada, (Sun Dec 23, 2:32 am)
Re: Using the C programming language, Girish Venkatachalam, (Sun Dec 23, 3:24 am)
Re: Using the C programming language, Frederik Sausmikat, (Thu Dec 27, 8:47 pm)
Re: Using the C programming language, Robert C Wittig, (Sat Dec 22, 10:33 am)
speck-geostationary