Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #4363

About C++ and Delphi and ADA

From Sky89 <Sky89@sky68.com>
Newsgroups comp.programming.threads
Subject About C++ and Delphi and ADA
Date 2018-06-01 17:45 -0400
Organization A noiseless patient Spider
Message-ID <pesepq$5gg$4@dont-email.me> (permalink)

Show all headers | View raw


Hello...


About C++ and Delphi and ADA

As you know i have been programming with Delphi and with C++(i have
implemented many of my scalable algorithms in them) and
i am looking also at ADA and Rust, and what i have discovered
is that C++ is more weakly typed even with the SafeInt library that
i have presented to you here:

https://github.com/dcleblanc/SafeInt

For example you can still assign a type of char to an int type
in C++ and C and C++ and C allow also to assign two structs with some 
different types in each one of them that can be assigned ! and this is 
not allowed in Delphi and ADA for reliability reasons , because two 
structs means two different "types" for Delphi and ADA, Delphi and ADA 
doesn't even allow to assign two types of records(that means structs in 
C++) that have the same elements with the same types ! but C++ and C
allow it.. so this is why i will stop from using C++ because C++ is less 
reliable than ADA or Delphi in this strict-type safety, you can even use 
"variants" that are implemented smartly in Delphi to enhance strict-type 
safety(and thus reliability) in Delphi as i have showed you like the 
following:

-- 

program test;

uses VARIANTS,SYSUTILS;

var f:double;
      a:integer;



FUNCTION ASSIGN(a,B:VARIANT):VARIANT;

begin

IF VARTYPE(A)=VARTYPE(B) THEN
BEGIN
A:=B;
RESULT:=A;
END
ELSE RAISE EXCEPTION.CREATE('ASSIGNEMENT NOT OK');


end;

begin

a:=2;

f:=a;

A:=ASSIGN(F,A);


end.
-- 


Here is the Vartype function:

http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/Variants_VarType.html




So i will stop coding in C++ and i will continu to code in Delphi
and i will also code in Java and Rust.



Thank you,
Amine Moulay Ramdane.

Back to comp.programming.threads | Previous | Next | Find similar | Unroll thread


Thread

About C++ and Delphi and ADA Sky89 <Sky89@sky68.com> - 2018-06-01 17:45 -0400

csiph-web