:: Re: [DNG] C vs C++
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: kc-devuan
Fecha:  
A: dng
Asunto: Re: [DNG] C vs C++
6 Oct 2024 02:44:37 Erik Christiansen via Dng <dng@???>:

> and  in providing pointers, C merely mimics the behaviour of the hardware.


Pointers are everywhere in C including pointers to pointers and they make reading code more difficult and writing code more fragile and dangerous. This is proven by history.

Ada has Addresses for overlaying on menory or accessing particular locations (spark supports most but limits some uses of that because obviously that can lead to erroneous behaviour) and Access types which can be used for heap based containers etc.. Pointer equivalents are therefore only used when necessary. Typically zero cost conversions are done instead with size checks at compile time etc..

regards, kc